#5200 closed defect (worksforme)
trac-post-commit-hook works manually but not from Subversion.
Reported by: | denney | Owned by: | Jonas Borgström |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | 0.10.4 |
Severity: | major | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
I'm running Subversion 1.4.3 and Trac 0.10.4. I had installed the post commit hook previously and it worked fine.
I had to move the server the other day and decided to install everything from scratch again. I copied the "Repos" and "Tracs" directories (the Subversion repositories and Trac directories) and then restored them after I had reinstalled everything.
Everything works great off the bat except for the post commit hook. It runs when a commit is made because I can echo the command into a log file and it looks fine…
Python "C:\Server\Repos\RepoTest\hooks\trac-post-commit-hook" -p "C:\Server\Tracs\RepoTest" -r "32"
Python is in the path and no errors are logged anywhere. It appears to run fine but the commit is not processed by Trac. If I copy and paste the exact line from the log file and run it from the command line, I get the exact same output (nothing) but it DOES process the commit in Trac.
I cannot figure out what is happening. I don't think it's a permission error as, 1, this is a Windows server and 2, all the folders have write permissions to "Everybody".
Trac and Subversion are running on Windows XP SP2.
Attachments (0)
Change History (8)
comment:1 by , 18 years ago
comment:2 by , 18 years ago
I believe it has access. Is there a debug option or a way to check if it does on Windows XP?
I believe it must be something to do with the copying of the backup because it worked fine with the EXACT same software before the server move. Nothing has changed.
comment:3 by , 18 years ago
I've found an error by running the commit on the server machine itself.
C:\Users\Denney\Desktop\Temp\RepoTest>svn commit -m "Fixes #1." Sending vendors\testvendor\current\Was Copy (2) of afile.txt Transmitting file data . Committed revision 36.
Warning: 'post-commit' hook failed with error output: Traceback (most recent call last):
File "C:\Server\Repos\RepoTest\hooks\trac-post-commit-hook", line 207, in
File "C:\Server\Repos\RepoTest\hooks\trac-post-commit-hook", line 146, in
it
chgset = repos.get_changeset(rev)
File "C:\Server\Software\Python\Lib\site-packages\trac\versioncontrol\cac
", line 45, in get_changeset
self.authz)
File "C:\Server\Software\Python\Lib\site-packages\trac\versioncontrol\cac
", line 253, in init
raise NoSuchChangeset(rev)
trac.versioncontrol.api.NoSuchChangeset: No changeset 36 in the repository
comment:4 by , 18 years ago
Well, the trac-post-commit-hook needs to perform a sync before being able to access the latest changeset. This has been fixed in the latest versions of the script. Look at log:branches/0.10-stable/contrib/trac-post-commit-hook and check whether you're using the appropriate version of the script.
comment:5 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
How odd… What worked before doesn't now but after updating the script to the latest contrib version, it works again.
Thanks for that.
comment:6 by , 18 years ago
Description: | modified (diff) |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
Well, what worked before was probably not 0.10.4 as this was only released two days ago :-)
Anyway, as it now works for you, all is fine, I'm just reopening to change the resolution.
comment:7 by , 18 years ago
Resolution: | → worksforme |
---|---|
Status: | reopened → closed |
comment:8 by , 18 years ago
Note that I since found an issue with the trac-post-commit-hook which can happen in scoped repositories. See [5308-5309].
If that was indeed the case in the original problem report, please reopen, so that I can assign the ticket to 0.10.5.
Have you checked that the python process run by the Subversion hook has proper access to the Python bindings for Subversion? They are needed now.