Edgewall Software

Ticket #5522 (closed defect: fixed)

Opened 18 months ago

Last modified 6 months ago

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

Reported by: tim@… Owned by: jonas
Priority: high Milestone: 0.10.5
Component: general Version: 0.10.4
Severity: major Keywords:
Cc:

Description (last modified by cboos) (diff)

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

Change History

Changed 18 months ago by tim@…

  • status changed from new to closed
  • resolution set to fixed

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

Changed 18 months ago by eblot

  • status changed from closed to reopened
  • resolution fixed deleted

Changed 18 months ago by eblot

  • status changed from reopened to closed
  • resolution set to worksforme

Changed 18 months ago by cboos

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.

Changed 17 months ago by deb@…

  • status changed from closed to reopened
  • resolution worksforme deleted

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', );"

Changed 17 months ago by anonymous

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','');"

Changed 16 months ago by cliff.brake@…

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.

Changed 13 months ago by sid

  • status changed from reopened to closed
  • resolution set to worksforme

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

Changed 13 months ago by anonymous

  • status changed from closed to reopened
  • resolution worksforme deleted

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.

Changed 13 months ago by cboos

  • keywords needinfo added
  • description modified (diff)
  • milestone set to 0.10.5

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

Changed 13 months ago by anonymous

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

Changed 13 months ago by cboos

  • keywords needinfo removed

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

Changed 12 months ago by david.barnhill@…

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

Changed 12 months ago by Timothy Denike

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','');"

Changed 12 months ago by ante@…

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

Changed 11 months ago by andrew@…

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

Changed 6 months ago by cboos

  • status changed from reopened to closed
  • resolution set to fixed

Backported r5815 in r7060.

Add/Change #5522 (Upgrade failed: TracError: Missing "youngest_rev" in cache metadata)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from jonas. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.