Modify

Opened 5 years ago

Closed 5 years ago

#4170 closed defect (worksforme)

Environment upgrade doesn't work for first installation - NameError: global name 'ENV' is not defined

Reported by: nicholas Owned by: richard
Priority: normal Component: TracTicketTemplatePlugin
Severity: blocker Keywords:
Cc: Trac Release: 0.11

Description

Using source:tractickettemplateplugin/0.11@4553

Migrate from template files to db.
Traceback (most recent call last):
  File "/usr/bin/trac-admin", line 8, in <module>
    load_entry_point('Trac==0.11rc2', 'console_scripts', 'trac-admin')()
  File "/usr/lib/python2.5/site-packages/Trac-0.11rc2-py2.5.egg/trac/admin/console.py", line 1249, in run
    return admin.onecmd(command)
  File "/usr/lib/python2.5/site-packages/Trac-0.11rc2-py2.5.egg/trac/admin/console.py", line 104, in onecmd
    rv = cmd.Cmd.onecmd(self, line) or 0
  File "/usr/lib/python2.5/cmd.py", line 219, in onecmd
    return func(arg)
  File "/usr/lib/python2.5/site-packages/Trac-0.11rc2-py2.5.egg/trac/admin/console.py", line 1108, in do_upgrade
    self.__env.upgrade(backup=do_backup)
  File "/usr/lib/python2.5/site-packages/Trac-0.11rc2-py2.5.egg/trac/env.py", line 442, in upgrade
    participant.upgrade_environment(db)
  File "build/bdist.linux-i686/egg/tickettemplate/ttadmin.py", line 102, in upgrade_environment
  File "build/bdist.linux-i686/egg/tickettemplate/upgrades.py", line 30, in add_tt_table
  File "build/bdist.linux-i686/egg/tickettemplate/upgrades.py", line 96, in _findAllTmpls
NameError: global name 'ENV' is not defined

Attachments (0)

Change History (3)

comment:1 follow-up: Changed 5 years ago by nicholas

I tried adding a "global ENV" at the top of add_tt_table(), but the second "trac-admin upgrade" said that no upgrade was required.

comment:2 in reply to: ↑ 1 Changed 5 years ago by richard

  • Status changed from new to assigned

[4931]

  • fixed

Replying to nicholas:

I tried adding a "global ENV" at the top of add_tt_table(), but the second "trac-admin upgrade" said that no upgrade was required.

You have to fixed this problem in trac's database manually.

1. delete from system where name = 'tt_version'

2. drop table tt_template

3. drop table tt_custom

Hope this helps.

comment:3 Changed 5 years ago by richard

  • Resolution set to worksforme
  • Status changed from assigned to closed

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from richard. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.