Git repository not receiving changes after migration to Trac-1.4

26 views
Skip to first unread message

Mo

unread,
Nov 18, 2019, 8:14:57 AM11/18/19
to Trac Users
Hi,

after the migration to Trac-1.4, the git source repository does not see any changes anymore.
git log on the plain repo has the recent changes, but /browser only shows the old versions from before the update.

Looking at the debug log I find:
{{{
2019-11-18 14:05:30,983 Trac[PyGIT] DEBUG: requested non-weak PyGIT.Storage instance for '/mnt/data/userspace/project/MM/'
2019-11-18 14:05:30,983 Trac[git_fs] DEBUG: enabled CachedRepository for '/mnt/data/userspace/project/MM/'
2019-11-18 14:05:30,994 Trac[PyGIT] DEBUG: Detected changes in git repository '/mnt/data/userspace/project/MM/'
2019-11-18 14:05:30,995 Trac[PyGIT] DEBUG: triggered rebuild of commit tree db for '/mnt/data/userspace/project/MM/'
2019-11-18 14:05:31,104 Trac[PyGIT] DEBUG: rebuilt commit tree db for '/mnt/data/userspace/project/MM/' with 3338 entries (took 108.9 ms)
2019-11-18 14:05:31,122 Trac[cache] DEBUG: Missing revision record (10, 'bd07952741441c37cd416fdc51d4a26d806e5bb4') in 'mt6'
}}}
Is this related to the missing changes?

Best regards,
Mo

Jun Omae

unread,
Nov 18, 2019, 9:47:27 AM11/18/19
to trac-...@googlegroups.com
I guess that explicit synchronization via post-receive hook in your
Git repository doesn't work.
Please try to execute `trac-admin $ENV repository sync mt6` and make
sure your hook scripts work well.

See also https://trac.edgewall.org/wiki/TracRepositoryAdmin#ExplicitSync.


--
Jun Omae <jun...@gmail.com> (大前 潤)

Mo

unread,
Nov 19, 2019, 9:17:32 AM11/19/19
to Trac Users
Am Montag, 18. November 2019 15:47:27 UTC+1 schrieb Jun Omae:

I guess that explicit synchronization via post-receive hook in your
Git repository doesn't work.
Please try to execute `trac-admin $ENV repository sync mt6` and make
sure your hook scripts work well.

Now the changes are there.
Did something change here from Trac-1.2.3 to 1.4? I did not need the explicit repository sync before.

I have
[git]
cached_repository
= enabled
persistent_cache
= enabled

The process looks like this: A 5-minutly cronjob calls a script doing 'git p4 sync' into a repo that was initially created like 'git p4 clone --bare //DEPOT@all'.
Then the script parses the last changes and calls 'trac-admin $ENV changeset added $repo $revision' for every revision in order to make Trac check the changes for mentioned ticket numbers adding a comment about the submission to every ticket.
That was working like this with Trac-1.2.3.
Do I need to call 'repository sync' now additionally?

Best regards,
- Mo

RjOllos

unread,
Nov 19, 2019, 11:24:49 AM11/19/19
to Trac Users
Nothing has changed, you still just need to call "changeset added". Sync is used to "catch up" when the Trac is not yet sync'ed.

Possibly there is something wrong with your Cron script. I would check logged info for that script, or try to run it manually and inspect the output. Based on previous things you've described, you may need to use the full path to trac-admin, as it sounds like python2.7 is not the default on your server.

- Ryan 

Mo

unread,
Nov 22, 2019, 3:27:32 AM11/22/19
to Trac Users
Am Dienstag, 19. November 2019 17:24:49 UTC+1 schrieb RjOllos:

Possibly there is something wrong with your Cron script. I would check logged info for that script, or try to run it manually and inspect the output. Based on previous things you've described, you may need to use the full path to trac-admin, as it sounds like python2.7 is not the default on your server.

Thank you very much. That was the reason. After installing Trac via pip2, trac-admin was not in $PATH anymore. I already added the new ~/.local/bin to $PATH in the profile (beside ~/bin and ~/opt/bin..). But the main reason was, that 'sudo -u trac trac-admin' was not sourcing the profile. It does now like 'sudo -iu trac trac-admin'.

Best regards,
- Mo
Reply all
Reply to author
Forward
0 new messages