Edgewall Software
Modify

Opened 18 years ago

Closed 17 years ago

Last modified 14 years ago

#5522 closed defect (fixed)

Upgrade failed: TracError: Missing "youngest_rev" in cache metadata

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

Description (last modified by Christian Boos)

Hey there,

I recently tried an upgrade from 0.10 to 0.10.4, following the instructions in TracUpgrade. I installed the new version, ran trac-admin /var/lib/trac upgrade, and trac-admin /var/lib/trac wiki upgrade. When I restarted Apache, I continually receive the following error on each page request.

Traceback (most recent call last):
  File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 406, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 191, in dispatch
    chosen_handler = self._pre_process_request(req, chosen_handler)
  File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 263, in _pre_process_request
    chosen_handler = f.pre_process_request(req, chosen_handler)
  File "/usr/lib/python2.3/site-packages/trac/versioncontrol/api.py", line 73, in pre_process_request
    self.get_repository(req.authname).sync()
  File "/usr/lib/python2.3/site-packages/trac/versioncontrol/cache.py", line 97, in sync
    raise TracError('Missing "youngest_rev" in cache metadata')
TracError: Missing "youngest_rev" in cache metadata

I've also tried removing /usr/share/trac and /usr/lib/python2.3/site-packages/trac and reinstalling. Same outcome. Any help is greatly appreciated. My trac installation is offline.

Attachments (0)

Change History (20)

comment:1 by tim@…, 18 years ago

Resolution: fixed
Status: newclosed

With a little bravery and some googling, this is resolved.

As suggested in another ticket, inserting the youngest_rev value into the trac.db file was the fix for this problem.

sqlite3 /var/lib/trac/db/trac.db "insert into system values ('youngest_rev', );"

Cheers, Tim Denike

comment:2 by Emmanuel Blot, 18 years ago

Resolution: fixed
Status: closedreopened

comment:3 by Emmanuel Blot, 18 years ago

Resolution: worksforme
Status: reopenedclosed

comment:4 by Christian Boos, 18 years ago

It's nevertheless strange you had the error in the first place, as trac-admin ... upgrade normally does insert this 'youngest_rev' value in the system table.

If someone has a reproducible recipe for this problem, please don't hesitate write it down here and to reopen the ticket.

comment:5 by deb@…, 18 years ago

Resolution: worksforme
Status: closedreopened

I just encountered the same problem when I upgraded our trac installations from 0.10.3 to 0.10.4. I followed the steps as detailed in the upgrade guide. After my first attempt, I started from scratch and removed the share/trac and python/site-packages/trac directories. Both attempts resulted in the same error.

We are currently using python 2.4.4 and sqlite 3.3.13. Inserting 'youngest_rev' into the database fixed the problem, although there was a typo in the above command. It should be

sqlite3 /var/lib/trac/db/trac.db "insert into system values ('youngest_rev', );"

comment:6 by anonymous, 18 years ago

After my last post, I discovered there is a bug in posts which include a single quote followed immediately by another single quote. That is why the first example was missing the empty quotes. I have added the example again, but this time wrapped in a code block. In a code block the single quotes remain.

sqlite3 /var/lib/trac/db/trac.db "insert into system values ('youngest_rev','');"

comment:7 by cliff.brake@…, 17 years ago

I just ran into the same problem moving a 0.10 dataset to another machine running 0.10.4 — even after running trac-upgrade. The above fix fixed the problem.

comment:8 by sid, 17 years ago

Resolution: worksforme
Status: reopenedclosed

Sounds like we've got a fix. Closing again.

comment:9 by anonymous, 17 years ago

Resolution: worksforme
Status: closedreopened

I got this same error on an upgrade from 0.10.3.1 to 0.10.4. The manual insert fixed it, but it seems like "trac-admin upgrade" has a bug.

comment:10 by Christian Boos, 17 years ago

Description: modified (diff)
Keywords: needinfo added
Milestone: 0.10.5

Was the trac.versioncontrol.svn_fs component enabled during the upgrade? (and the repository_dir set?)

comment:11 by anonymous, 17 years ago

Had the same problem. In my case I first updated subversion, which broke some svn functionality after that i ran trac-admin upgrade.

In my case it seems like it was caused by my broken subversion install

comment:12 by Christian Boos, 17 years ago

Keywords: needinfo removed

Ok, that makes sense. I should probably backport r5815 - thought I did, but apparently not.

comment:13 by david.barnhill@…, 17 years ago

I get the same error message. I have a fresh install "yum install trac" on RHEL5.1. The data is from another system running Trac 0.9 When I attempt to "fix" trac.db with the sqlite3 statement,

sqlite3 /var/lib/trac/db/trac.db "insert into system values ('youngest_rev', );"

I get the following; SQL error: near ")": syntax error

comment:14 by Timothy Denike, 17 years ago

Due to formatting, the empty double-quotes are being dropped. Make sure you have two quotes before the final ) char.

sqlite3 /var/lib/trac/db/trac.db "insert into system values ('youngest_rev','');"

comment:15 by ante@…, 17 years ago

trac-admin upgrade won't be successful if repository location is invalid

for example, when I moved my trac/svn from windows to linux. I made svn-admin upgrade on linux, but didn't change repository_path in trac.ini.

You should correct svn repository_dir value before trac upgrade.

windows:

[trac]
  repository_dir = c:\svn\myproject

linux:

[trac]
  repository_dir = /var/lib/svn/myproject

comment:16 by andrew@…, 17 years ago

Probably a cleaner way of fixing this is to perform a 'trac-admin … resync', which just worked for me.

comment:17 by Christian Boos, 17 years ago

Resolution: fixed
Status: reopenedclosed

Backported r5815 in r7060.

comment:18 by andrew.hardy@…, 14 years ago

I had the same problem upgrading from 0.11 to 0.12. In my case the repository_dir does correctly point to the repository but we are using UNC paths e.g. repository_dir =
snap\svn\myproject

in reply to:  18 comment:19 by andrew.hardy@…, 14 years ago

Replying to andrew.hardy@…:

I had the same problem upgrading from 0.11 to 0.12. In my case the repository_dir does correctly point to the repository but we are using UNC paths e.g. repository_dir =
snap\svn\myproject

\\snap\svn\myproject

comment:20 by Christian Boos, 14 years ago

[OT] should we make \\ more friendly with UNC paths? Matching for something like '\\\\(?:[^\w]|$)'

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.