Modify ↓
Opened 12 years ago
Closed 12 years ago
#11653 closed defect (duplicate)
Fails: Environment object has no attribute get_db_ctx
| Reported by: | Quince | Owned by: | Jun Omae |
|---|---|---|---|
| Priority: | high | Component: | TracJsGanttPlugin |
| Severity: | major | Keywords: | |
| Cc: | Quince | Trac Release: | 1.0 |
Description
Trying to migrate in-place from MySQL to PostgreSQL. Prepared user and empty database in PostgreSQL and ran ./trac-migrate.py --in-place /srv/trac postgres://tracuser:xxxxxxxx@127.0.0.1/trac?schema=new_schema
Result:
/usr/lib/python2.7/site-packages/pkg_resources.py:1054: UserWarning: /root/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
warnings.warn(msg, UserWarning)
Traceback (most recent call last):
File "./trac-migrate.py", line 55, in <module>
sys.exit(main(sys.argv[1:]) or 0)
File "./trac-migrate.py", line 51, in main
return TracMigrationCommand(env)._do_migrate(dest, dburi)
File "/tmp/tracmigrate/admin.py", line 29, in _do_migrate
return self._do_migrate_inplace(dburi)
File "/tmp/tracmigrate/admin.py", line 60, in _do_migrate_inplace
env = self._create_env(env_path, dburi)
File "/tmp/tracmigrate/admin.py", line 92, in _create_env
env = Environment(env_path, create=True, options=options)
File "/usr/lib/python2.7/site-packages/trac/core.py", line 124, in __call__
self.__init__(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/trac/env.py", line 288, in __init__
setup_participant.environment_created()
File "build/bdist.linux-x86_64/egg/tracjsgantt/tracpm.py", line 81, in environment_created
AttributeError: 'Environment' object has no attribute 'get_db_ctx'
Any fix or work-around? Thanks
Attachments (0)
Change History (1)
comment:1 Changed 12 years ago by
| Component: | TracMigratePlugin → TracJsGanttPlugin |
|---|---|
| Resolution: | → duplicate |
| Status: | new → closed |
Note: See
TracTickets for help on using
tickets.



A duplicate of #11651. Also, it is a TracJsGanttPlugin isssue.
The plugin doesn't work if it's enabled on initenv.
$ cat inherit.ini [components] tracjsgantt.* = enabled [logging] log_type = stderr log_level = DEBUG $ ~/venv/trac/1.0.1/bin/trac-admin ~/var/trac/th11651 initenv --inherit=$PWD/inherit.ini th11651 sqlite:db/trac.db ... Initenv for '/home/jun66j5/var/trac/th11651' failed. Failed to create environment. 'Environment' object has no attribute 'get_db_ctx' Traceback (most recent call last): File "/home/jun66j5/venv/trac/1.0.1/lib/python2.5/site-packages/trac/admin/console.py", line 456, in do_initenv options=options) File "/home/jun66j5/venv/trac/1.0.1/lib/python2.5/site-packages/trac/core.py", line 124, in __call__ self.__init__(*args, **kwargs) File "/home/jun66j5/venv/trac/1.0.1/lib/python2.5/site-packages/trac/env.py", line 288, in __init__ setup_participant.environment_created() File "/home/jun66j5/src/trac/trac-hacks/tracjsganttplugin/0.11/tracjsgantt/tracpm.py", line 85, in environment_created self.upgrade_environment(self.env.get_db_ctx()) AttributeError: 'Environment' object has no attribute 'get_db_ctx'It seems to be no work around.