Edgewall Software
Modify

Ticket #3887 (closed defect: wontfix)

Opened 5 years ago

Last modified 4 years ago

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

Reported by: BK <bruiseknee@…> Owned by: jonas
Priority: normal Milestone:
Component: general Version: 0.10
Severity: normal Keywords: trac-post-commit-hook needinfo
Cc:
Release Notes:
API 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

Change History

comment:1 Changed 5 years ago by mgood

  • 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 Changed 5 years ago by cboos

  • Resolution set to wontfix
  • Status changed from new to closed

No feedback, closing.

comment:3 follow-up: Changed 4 years ago by arbrandes@…

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 in reply to: ↑ 3 Changed 4 years ago by anonymous

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.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from jonas. Next status will be 'closed'
Author


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

 
Note: See TracTickets for help on using tickets.