Upgrade reported as failed if trac.ini.sample is not writable
|Reported by:||Ryan J Ollos||Owned by:||Jun Omae|
Upgrade reported as failed if
trac.ini.sample is not writable:
$ trac-admin /var/trac/trac upgrade The upgrade failed. Please fix the issue and try again. OSError: [Errno 13] Permission denied: '/var/trac/trac/conf/trac.ini.sample'
However, since trac.ini.sample is updated after the database upgrade, the database upgrade has succeeded and executing upgrade again reports that upgrade isn't needed. This might be confusing to the user.
Better behavior would be to update the trac.ini.sample before the upgrade so that the database isn't upgraded in the event of failure updating trac.ini.sample.
I've only tested with trunk so far. At least on trunk, the following change seems to be good:
diff --git a/trac/env.py b/trac/env.py index b7dae8351..cc24b6577 100644
a b class Environment(Component, ComponentManager): 770 770 except Exception as e: 771 771 raise BackupError(e) 772 772 773 774 773 775 for participant in upgraders: 774 776 self.log.info("upgrading %s...", participant) 775 777 with self.component_guard(participant, reraise=True): … … class Environment(Component, ComponentManager): 779 781 if dbm.connection_uri != 'sqlite::memory:': 780 782 dbm.shutdown() 781 783 782 self._update_sample_config() 783 784 del self.database_version 784 785 return True
Change History (5)
comment:4 by , 3 years ago
|Milestone:||1.2.3 → 1.0.17|
|Release Notes:||modified (diff)|
|Status:||assigned → closed|