Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#10287 closed defect (fixed)

Error on commit

Reported by: Ryan J Ollos Owned by: Michael Renzmann
Priority: normal Component: TracHacks
Severity: normal Keywords:
Cc: Steffen Hoffmann, osimons Trac Release: 0.10

Description (last modified by Ryan J Ollos)

I've seen the following error on commit:

post-commit hook failed (exit code 1) with output:
/srv/ line 47: /var/trac/trachacks010/log/trac-hacks-post-commit.log: No such file or directory

Attachments (0)

Change History (12)

comment:1 Changed 7 years ago by Ryan J Ollos

It looks like there are a couple of changes needed in /srv/, and maybe pre-revprop-change as well.

I'm too tired to deal with this now, but will make the changes and test in the morning if someone doesn't beat me to it.

comment:2 Changed 7 years ago by Michael Renzmann

Status: newassigned
Trac Release: 0.120.10

Should be fixed now. Please test and report back.

comment:3 Changed 7 years ago by Ryan J Ollos

hasienda mentioned on IRC last evening that the post-commit hook is still not working, and I'm seeing the same thing. I had to manually insert ticket/8690.

comment:4 Changed 7 years ago by Ryan J Ollos

Here is a hint. I still received the following email, even though there was not a comment inserted in the ticket:

#10292: Line number IDs are not necessarily unique
Reporter:  rjollos  |       Owner:  rjollos
    Type:  defect   |      Status:  new
Priority:  normal   |   Component:  LinenoMacro
Severity:  normal   |    Keywords:
 Release:  0.12     |
 In [11941], the `IHTMLPreviewAnnotator` that is utilized was changed to
`trac.mimeview.api.LineNumberAnnotator`, which includes an anchor for
each  line number. If there is more than one line-numbered code block in
a  resource, then the line numbers will not be unique.

 This was brought to my attention in the ticket for adding the feature
to  the Trac core, t:#10834.

Ticket URL: <>
Trac Hacks - Plugins Macros etc. <> Trac Hacks -
Hosting for Trac Plugins, Macros, etc.

comment:5 Changed 7 years ago by Ryan J Ollos

I ran a touch /srv/, and after a commit the file is populated with:

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import site' failed; use -v for traceback
Traceback (most recent call last):
  File "/usr/local/bin/trac-post-commit-hook-010", line 71, in <module>
    import re
ImportError: No module named re

comment:6 Changed 7 years ago by Ryan J Ollos

(In [11970]) Refs #10287: Deleted 0.11 directory and renamed 0.12 directory to trunk.

comment:7 Changed 7 years ago by Ryan J Ollos

Description: modified (diff)

comment:8 Changed 7 years ago by Ryan J Ollos

Resolution: fixed
Status: assignedclosed

Changed the first line of /usr/local/bin/trac-post-commit-hook-010:




comment:9 Changed 7 years ago by Ryan J Ollos

The only thing being added to the log on commit now is the benign:

/srv/ DeprecationWarning: the md5 module is deprecated; use hashlib instead
  import md5
/usr/lib/python2.6/dist-packages/spambayes/ DeprecationWarning: the sets module is deprecated
  from sets import Set

comment:10 Changed 7 years ago by osimons

The DeprecationWarning should be gone now. No point having this message in the logs as long as we really only run released packages anyway.

I've added this:

import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)

to /etc/python2.6/

comment:11 Changed 7 years ago by osimons

Actually better to only hide the warnings for our Trac related code. I've moved the statements to a new /srv/ file instead.

comment:12 Changed 7 years ago by Ryan J Ollos

I added rjollos, hasienda and osimons in the pre-revprop-change hook as users that are allowed to edit log messages. The post-revprop-change hook needs to be configured to resync the edited revisions. I did the resync manually tonight when editing [12029].

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Michael Renzmann.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.