views:

370

answers:

2

I have installed trac 0.11.6 stable with mod_wgsi with running on apache server on my windows server 2008. When I do commit through TSVN, trac-post-commit-hook does not update and send out email notification. However if I use windows command line run: Python trac-post-commit-hook -p C:/trac -r 97 from my window command line, it updates my tickets and sends emails. Someone suggested that it might be windows suppress sending mail causing the script fai acting on updating ticket, on the command line, it finds suitable environment variables and it worked. I commented out sending email part from trac-post-commit-script, it still does not update trac ticket. There are no error message either. Here are some information about my trac environment: C:\trac C:\Phyton26 C:\Python26\Scripts C:\src\ C:\src\genshi C:\src\trac C:\src\xmlrpcplug C:\src\spam-filter my repository localtion is on E drive E:\myrepository Here is my post-commit.bat

REPOS="$1"
REV="$2"
call %~dp0\trac-post-commit-hook.cmd %1 %2

trac-post-commit-hook.cmd:

@ECHO OFF
SET TRAC_ENV=C:\trac
SET PYTHON_PATH=C:\Python26
SET TRAC_PATH=C:\trac
IF NOT EXIST %TRAC_ENV% GOTO :EOF
set PATH=%PYTHON_PATH%;%PATH%
set PYTHONPATH=%TRAC_PATH%;%PYTHONPATH%
SET REV=%2

for /F %%A in ('svnlook author -r %REV% %1') do set AUTHOR=%%A
for /F "delims==" %%B in ('svnlook log -r %REV% %1') do set LOG=%%B
Python "%~dp0\trac-post-commit-hook" -p "%TRAC_ENV%" -r "%REV%" 2>&1 1>>c:/temp/trachook.log

I turned trac debug one, if there is any help to identify the problem, the last part of debug code is:

2010-01-08 14:56:23,474 Trac[svn_fs] DEBUG: Subversion bindings imported
2010-01-08 14:56:23,479 Trac[cache] INFO: repos rev [150] != cached rev [149]
2010-01-08 14:56:23,483 Trac[cache] INFO: Trying to sync revision [150]
2010-01-08 14:56:23,486 Trac[cache] DEBUG: Caching node change in [150]: (u'trunk/wwwroot/Default.aspx', 'file', 'edit', u'trunk/wwwroot/Default.aspx', 149)

Thank you for your help Lynda

A: 

Ok, I dunno about the hook, but I can tell you that it almost looks like your Trac<-->SVN setup is out of sync. Try doing a forced resync from the command line and see if that resolves a portion of it. Do this:

trac-admin resync

...as the appropriate user, and see if that resolves the out-of-sync.

Avery Payne
A: 

I experienced exactly the same when upgrading my VisualSVN server to the latest and greatest. Going from 1.1 to 2.1 they changed the user which the Service is logging on as to NETWORK SERVICE. I solved my problem by set the correct access rights for this user to both the Trac projects and SVN repositories directories.

;-D Hans

Hans K. Aspenberg