Opened 9 years ago

Closed 9 years ago

#48758 closed defect (fixed)

Trac is not importing new Subversion revisions

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: admin@…
Priority: High Milestone:
Component: server/hosting Version:
Keywords: Cc: su-v, jerryyhom, anddam (Andrea D'Amore), mojca (Mojca Miklavec)
Port:

Description

The process that imports new Subversion revisions into the Trac repository browser stopped working 8 days ago (see the log), probably the same time Trac itself went offline. Now that Trac is back up, that process may need to be started or restarted.

Change History (15)

comment:1 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Could you look into this problem, please?

comment:2 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Priority: NormalHigh

Keith, can you please fix this problem?

comment:3 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Keith, can you give us any information about this problem?

comment:4 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Keith, can you fix this please? It's been 4 weeks.

comment:5 Changed 9 years ago by keith_dart@…

Do you know anything about how this is supposed to work? I'm looking into it now, but I haven't used trac before so I'm not sure where to start. If you have any ideas please let me know.

comment:6 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

When things are working, revisions appear in Trac seconds after being committed to the Subversion repository, making me think there must be a post-commit script in the Subversion repository's hooks directory initiating the import. Maybe there's a stuck lock file or the script is hung. So see if looking through that post-commit script gives you any ideas.

comment:7 Changed 9 years ago by keith_dart@…

Thanks for the tip. There is indeed a post-commit hook that does that. IT also writes to a log file and that log file indicated there was a lock that it couldn't obtain.

Now, I just updated and rebooted most of the macosforge VMs. So this may just happen to be fixed now. Try it out and let me know. Also let me know if something else broke. :)

comment:8 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Thanks, but the log still shows no new revisions.

comment:9 Changed 9 years ago by danielluke (Daniel J. Luke)

trac-admin probably needs to be manually run to re-sync trac with the svn repo (I'm not sure if the hook script will 'catch up' if there were missing commits, but we can't test that because of #49288).

comment:10 Changed 9 years ago by pixilla (Bradley Giesbrecht)

After r141300 the trac browser is still outdated.

comment:11 Changed 9 years ago by su-v

Cc: suv-sf@… added

Cc Me!

comment:12 Changed 9 years ago by jerryyhom

Cc: jerryyhom@… added

Cc Me!

comment:13 Changed 9 years ago by anddam (Andrea D'Amore)

Cc: and.damore@… added

Any update on this?

changeset is not showing anything after r139798.

Last edited 9 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:14 Changed 9 years ago by mojca (Mojca Miklavec)

Cc: mojca@… added

Cc Me!

comment:15 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

Revisions are importing into Trac now and will update automatically in the future.

There were multiple problems which are now fixed.

First, the custom SELinux contexts of the Trac server were lost during an OS upgrade in October. I've restored the contexts of the sync'd copy of the svn repository on the Trac server to working order, in such a way that they will not be lost in the future. This allows the repository to be seen by Trac again (#49389) and allows its hook scripts to run again, which is where things get imported into Trac.

Second, the import process was aborting with this error:

svnsync: post-revprop-change hook failed (exit code 2) with output:
TypeError: %d format: a number is required, not unicode

There's both a post-commit hook (to import revisions after they're committed) and a post-revprop-change hook (to import changes to existing revisions, such as when someone changes a log message). Both hook scripts call trac-admin to import the relevant data. The problem is that when svnsync runs, it sets some revision properties of revision 0, before and after the sync, such as a lock that indicates when syncing is in progress and also the number of the last successfully synced revision. This causes the post-revprop-change hook to run, which runs trac-admin, telling it to update the data for revision 0. I think the error message we see is Trac's way of saying "Revision 0 doesn't exist in Trac", which is true, but I don't know how this ever worked before. It may be that 3 months ago, when this problem started, Subversion was upgraded to a newer version, and that older versions didn't call the post-revprop-change hook for revision 0. Or it may be that Trac was upgraded to a newer version which has a bug when told to import revision 0 instead of ignore it.

To work around this problem, I changed the post-revprop-change hook script to do nothing if the revision number is 0.

Note: See TracTickets for help on using tickets.