Trac/SVN Post Commit Hook only partially working

122 views
Skip to first unread message

Christian Patzer

unread,
May 16, 2012, 4:33:25 PM5/16/12
to Trac Users
I was running Trac/SVN on Windows 2008R2 and had this working.

I am currently running trac on Ubuntu 11.10. I ran a fresh install
today to attempt to fix this problem I'm having to no avail.

When I commit using Tortoise SVN the post commit hook successfully re-
syncs the repository and I can see my comments in the timeline.
However referencing a ticket does not add the comment to the ticket. I
have done hours and hours of troubleshooting on this and have found
nothing.

The trac.log doesn't show any errors ocuring either.

When I run from the command line as user 'ubersvn' I get the same
behavior. No errors, message in timeline but not referencing ticket :-
[

I have enabled the tracopt.ticket.commit_updater.* in the ini both
trying manually and through the web interface which explicitly sets
the commit updater. Still can't get it to work.

Anybody have any new ideas?

Thanks!


Mirek Lauš

unread,
May 17, 2012, 5:03:58 AM5/17/12
to Trac Users
On May 16, 10:33 pm, Christian Patzer <christian.pat...@gmail.com>
wrote:
I'm experiencing exactly the same issue. The reference is only
appended to open
tickets, closed tickets are not touched:

This is maybe relevant debug output:
2012-05-17 10:58:58,993 Trac[formatter] DEBUG: Executing Wiki macro
Image by provider <trac.wiki.macros.ImageMacro object at 0x818cbfad0>
2012-05-17 10:58:59,021 Trac[formatter] DEBUG: Executing Wiki macro
CommitTicketReference by provider
<tracopt.ticket.commit_updater.CommitTicketReferenceMacro object at
0x818cbfcd0>

But the commit message is not appended to the ticket.

-ml

AcesHidden

unread,
May 17, 2012, 1:44:49 PM5/17/12
to trac-...@googlegroups.com
I honestly thing it's a bug with Trac installation itself. Tired of pulling my hair out!

Christian

unread,
May 23, 2012, 4:42:51 PM5/23/12
to trac-...@googlegroups.com
Okay,

     So, I have tracked this down to a permissions problem. If I run:

chmod -R o+rw /var/trac

The ticket gets updated successfully. One can easily see why I wouldn't want to do this.

My permissions are set up as follows.

Everything under /opt/ubersvn is set to group ubersvn and owner ubersvn
Everything under /var/trac is set to group www-data and owner www-data
The user ubersvn is a member of the www-data group so it has permission to write to the trac.db file /var/trac/sites/web/db/trac.db and it's directory. Thus the commit hook appears to work and refreshes the repository on the trac installation (i.e. I can see the commit message in the timeline)

Now, in my commit hook script I attempted to add some logging like this: /var/trac/sites/web changeset added "/opt/ubersvn/repositories/web" "refs #270" >> log.txt

I got a permissions error.

So I guess the question is what user needs permission to what in my trac installation to update the dang tickets OR which directory can I set to 777 to accomplish this instead of the whole /var/trac tree?

Any help would be GREATLY appreciated!

Cooke, Mark

unread,
May 24, 2012, 2:08:40 AM5/24/12
to trac-...@googlegroups.com
> -----Original Message-----
> From: trac-...@googlegroups.com On Behalf Of Christian
> Sent: 23 May 2012 21:43
> To: trac-...@googlegroups.com
> Subject: [Trac] Re: Trac/SVN Post Commit Hook only partially working
>
> Okay,
>
> So, I have tracked this down to a permissions problem. If I run:
>
> chmod -R o+rw /var/trac
>
> The ticket gets updated successfully. One can easily see why
> I wouldn't want to do this.
>
> My permissions are set up as follows.
>
> Everything under /opt/ubersvn is set to group ubersvn and
> owner ubersvn
> Everything under /var/trac is set to group www-data and owner www-data
> The user ubersvn is a member of the www-data group so it has
> permission to write to the trac.db file
> /var/trac/sites/web/db/trac.db and it's directory. Thus the
> commit hook appears to work and refreshes the repository on
> the trac installation (i.e. I can see the commit message in
> the timeline)
>
> Now, in my commit hook script I attempted to add some logging
> like this: /var/trac/sites/web changeset added
> "/opt/ubersvn/repositories/web" "refs #270" >> log.txt

I'm not a *nix user but it looks to me like there might be one of two issues: a) the www-data user (who is running the hook script) needs permission to /opt/ubersvn (i.e. add www-data to ubersvn group?) and you allowed only the other way round? ...and/or b) you need to consider where `log.txt` is going to end up, apache will run the hook with a very minimal (empty!) environment...

~ mark c
> --
> You received this message because you are subscribed to the
> Google Groups "Trac Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/trac-users/-/I4V2volYkcIJ.
> To post to this group, send email to trac-...@googlegroups.com.
> To unsubscribe from this group, send email to
> trac-users+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/trac-users?hl=en.
>
>
Reply all
Reply to author
Forward
0 new messages