Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

Last modified 10 years ago

#3887 closed defect (wontfix)

Latest trac-post-commit-hook in Trac 0.10 works manually or svnserve but not apache

Reported by: BK <bruiseknee@…> 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 Matthew Good, 18 years ago

Keywords: needinfo added

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.

comment:2 by Christian Boos, 18 years ago

Resolution: wontfix
Status: newclosed

No feedback, closing.

comment:3 by arbrandes@…, 17 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.

in reply to:  3 comment:4 by anonymous, 17 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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.