#3887 closed defect (wontfix)
Latest trac-post-commit-hook in Trac 0.10 works manually or svnserve but not apache
| Reported by: | Owned by: | Jonas Borgström | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | general | Version: | 0.10 |
| Severity: | normal | Keywords: | trac-post-commit-hook needinfo |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
If I vipw & allow apache to log in, then sudo su - apache", then run:
env - /opt/svn/svntstprj1/hooks/post-commit /opt/svn/svntstprj1 17
then it works fine.
It also works fine via svnserve.
However, going through apache gives:
Traceback (most recent call last):
File "/opt/svn/svntstprj1/hooks/trac-post-commit-hook", line 183, in __init__
tn.notify(ticket, newticket=0, modtime=self.now)
File "/usr/lib/python2.4/site-packages/trac/ticket/notification.py", line 127, in notify
NotifyEmail.notify(self, ticket.id, subject)
File "/usr/lib/python2.4/site-packages/trac/notification.py", line 208, in notify
Notify.notify(self, resid)
File "/usr/lib/python2.4/site-packages/trac/notification.py", line 106, in notify
self.begin_send()
File "/usr/lib/python2.4/site-packages/trac/notification.py", line 270, in begin_send
self.server = smtplib.SMTP(self.smtp_server, self.smtp_port)
File "/usr/lib/python2.4/smtplib.py", line 244, in __init__
(code, msg) = self.connect(host, port)
File "/usr/lib/python2.4/smtplib.py", line 306, in connect
raise socket.error, msg
error: (13, 'Permission denied')
Unexpected error while processing ticket ID 1: (13, 'Permission denied')
All the relevant trac and svn files are owned by apache. (We only allow apache access; svnserve was done only to test this.)
Attachments (0)
Change History (4)
comment:1 by , 19 years ago
| Keywords: | needinfo added |
|---|
follow-up: 4 comment:3 by , 18 years ago
I had the same problem (Apache + Trac 0.10.4). What I had to do was add a PYTHON_EGG_CACHE="/tmp" to svnrepo/hooks/post-commit. Alternatively, you can create a /var/www/.python-eggs/ with read/write permissions for the apache user.
comment:4 by , 18 years ago
Replying to arbrandes@gmail.com:
I had the same problem (Apache + Trac 0.10.4). What I had to do was add a PYTHON_EGG_CACHE="/tmp" to svnrepo/hooks/post-commit. Alternatively, you can create a /var/www/.python-eggs/ with read/write permissions for the apache user.
Thank you for the fix. This was driving me nuts.



The error is that it's being denied permission to open a socket for sending the notification email. Check whether SELinux is enabled, since you may have a rule that is preventing Trac from sending emails when running in that way.