Edgewall Software
Modify

Opened 17 years ago

Closed 15 years ago

Last modified 9 years ago

#6300 closed defect (worksforme)

Database newer than Trac version

Reported by: olig15@… Owned by: Jonas Borgström
Priority: high Milestone:
Component: general Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

When i run Trac though mod_python on apache on FC5 i get this error in my code

[Mon Nov 05 04:50:46 2007] [error] [client 90.193.172.63] PythonHandler trac.web.modpython_frontend: Traceback (most recent call last):
[Mon Nov 05 04:50:46 2007] [error] [client 90.193.172.63] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch\n    result = object(req)
[Mon Nov 05 04:50:46 2007] [error] [client 90.193.172.63] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/trac/web/modpython_frontend.py", line 87, in handler\n    gateway.run(dispatch_request)
[Mon Nov 05 04:50:46 2007] [error] [client 90.193.172.63] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/trac/web/wsgi.py", line 87, in run\n    response = application(self.environ, self._start_response)
[Mon Nov 05 04:50:46 2007] [error] [client 90.193.172.63] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 377, in dispatch_request\n    env = _open_environment(env_path, run_once=run_once)
[Mon Nov 05 04:50:46 2007] [error] [client 90.193.172.63] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 58, in _open_environment\n    env_cache[env_path] = open_environment(env_path)
[Mon Nov 05 04:50:46 2007] [error] [client 90.193.172.63] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/trac/env.py", line 435, in open_environment\n    if env.needs_upgrade():
[Mon Nov 05 04:50:46 2007] [error] [client 90.193.172.63] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/trac/env.py", line 315, in needs_upgrade\n    if participant.environment_needs_upgrade(db):
[Mon Nov 05 04:50:46 2007] [error] [client 90.193.172.63] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/trac/env.py", line 373, in environment_needs_upgrade\n    raise TracError, 'Database newer than Trac version'
[Mon Nov 05 04:50:46 2007] [error] [client 90.193.172.63] PythonHandler trac.web.modpython_frontend: TracError: Database newer than Trac version

I have tried the trac-admin update command, and it tells me that my database is already up-to-date.

When i use the builtin tracd using the same environment there is no problem, and my trac install works perfectly.

This is my entry in httpd.conf

<VirtualHost *:80>
	ServerName trac.sourcebans.net
		<Location />
	   		SetHandler mod_python
	   		PythonInterpreter main_interpreter
	   		PythonHandler trac.web.modpython_frontend 
	   		PythonOption TracEnv /home/sourcebans/trac_env
		</Location>
</VirtualHost>

Attachments (0)

Change History (7)

comment:1 by Noah Kantrowitz, 17 years ago

Resolution: worksforme
Status: newclosed

The code being used by mod_python is a newer version than that being used by trac-admin. In general installation issues should be directed at the MailingList or IrcChannel.

comment:2 by Jazz Yao-Tsung Wang, 16 years ago

Reference: http://use.perl.org/~Beatnik/journal/35866

~$ sudo apt-get install sqlite3
~$ sudo sqlite3 /forge/trac_pool/grid/db/trac.db
SQLite version 3.3.8
Enter ".help" for instructions
sqlite> select * from system;
database_version|20
sqlite> update system set value = 19 where name = "database_version";
sqlite> .quit

comment:3 by anonymous, 15 years ago

Resolution: worksforme
Status: closedreopened

I've the same problem described below but I cannot fix it following your istructions, my db version is 21.

sqlite>select * from system;
database_version|21
initial_database_version|21
youngest_rev|

$ rpm -q trac
trac-0.10.5-2.el5

$ cat /etc/redhat-release 
Scientific Linux SL release 5.2 (Boron)
Last edited 9 years ago by Ryan J Ollos (previous) (diff)

comment:4 by Christian Boos, 15 years ago

Resolution: worksforme
Status: reopenedclosed

Well, you have db version 21 (i.e. Trac 0.11 and above) and you now want to use Trac 0.10.5, so you need to downgrade it to 20…

sqlite> update system set value = 20 where name = "database_version";

comment:5 by jan@…, 14 years ago

Hi,

after a trac upgrade from version 0.10 to 0.11 I had an empty db file. Luckily there was the backup. So I copied the backup to trac.db and ran the

sqlite> update system set value = 19 where name = "database_version";

yet my trac keeps complaining that the db is newer than the trac version. Here's my apache log:

[Thu Apr 01 10:14:39 2010] [error] [client 89.0.132.191] mod_python (pid=3911, interpreter='main_interpreter', phase='PythonHandler', handler='trac.web.modpython_frontend'): Application error
[Thu Apr 01 10:14:39 2010] [error] [client 89.0.132.191] ServerName: 'trac.anyit.de'
[Thu Apr 01 10:14:39 2010] [error] [client 89.0.132.191] DocumentRoot: '/var/www/trac'
[Thu Apr 01 10:14:39 2010] [error] [client 89.0.132.191] URI: '/mfd/'
[Thu Apr 01 10:14:39 2010] [error] [client 89.0.132.191] Location: None
[Thu Apr 01 10:14:39 2010] [error] [client 89.0.132.191] Directory: '/var/www/trac/'
[Thu Apr 01 10:14:39 2010] [error] [client 89.0.132.191] Filename: '/var/www/trac/mfd/'
[Thu Apr 01 10:14:39 2010] [error] [client 89.0.132.191] PathInfo: ''
[Thu Apr 01 10:14:39 2010] [error] [client 89.0.132.191] Traceback (most recent call last):
[Thu Apr 01 10:14:39 2010] [error] [client 89.0.132.191]   File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch\n    default=default_handler, arg=req, silent=hlist.silent)
[Thu Apr 01 10:14:39 2010] [error] [client 89.0.132.191]   File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1229, in _process_target\n    result = _execute_target(config, req, object, arg)
[Thu Apr 01 10:14:39 2010] [error] [client 89.0.132.191]   File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1128, in _execute_target\n    result = object(arg)
[Thu Apr 01 10:14:39 2010] [error] [client 89.0.132.191]   File "/var/lib/python-support/python2.5/trac/web/modpython_frontend.py", line 87, in handler\n    gateway.run(dispatch_request)
[Thu Apr 01 10:14:39 2010] [error] [client 89.0.132.191]   File "/var/lib/python-support/python2.5/trac/web/wsgi.py", line 87, in run\n    response = application(self.environ, self._start_response)
[Thu Apr 01 10:14:39 2010] [error] [client 89.0.132.191]   File "/var/lib/python-support/python2.5/trac/web/main.py", line 377, in dispatch_request\n    env = _open_environment(env_path, run_once=run_once)
[Thu Apr 01 10:14:39 2010] [error] [client 89.0.132.191]   File "/var/lib/python-support/python2.5/trac/web/main.py", line 58, in _open_environment\n    env_cache[env_path] = open_environment(env_path)
[Thu Apr 01 10:14:39 2010] [error] [client 89.0.132.191]   File "/var/lib/python-support/python2.5/trac/env.py", line 435, in open_environment\n    if env.needs_upgrade():
[Thu Apr 01 10:14:39 2010] [error] [client 89.0.132.191]   File "/var/lib/python-support/python2.5/trac/env.py", line 315, in needs_upgrade\n    if participant.environment_needs_upgrade(db):
[Thu Apr 01 10:14:39 2010] [error] [client 89.0.132.191]   File "/var/lib/python-support/python2.5/trac/env.py", line 373, in environment_needs_upgrade\n    raise TracError, 'Database newer than Trac version'
[Thu Apr 01 10:14:39 2010] [error] [client 89.0.132.191] TracError: Database newer than Trac version

interesting is the "environment needs upgrade" part since if I rerun the upgrade the output is

Database is up to date, no upgrade necessary.

Thanks,

Jan

comment:6 by anonymous, 9 years ago

If I'd like propose a better handling of this issue (overwriting the version value until trac-admin upgrade works fails with error

Warning: Detected setuptools version 5.5.1. The environment variable 'PKG_RESOURCES_CACHE_ZIP_MANIFESTS' must be set to avoid significant performance degradation.
The upgrade failed. Please fix the issue and try again.

OperationalError: table cache already exists

in my case.

Should I open a seperate issue?

comment:7 by Ryan J Ollos, 9 years ago

It's unlikely that we'll add special handing for something that is an InstallationIssue, however you are welcome to propose ideas on the trac-dev MailingList.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.