Modify

Opened 11 years ago

Closed 11 years ago

Last modified 4 years ago

#526 closed defect (fixed)

Permission denied on VERSION

Reported by: jonathan.kelly@… Owned by: Bas van der Vlies
Priority: normal Component: EmailtoTracScript
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

Trac 0.10 (Debian package) + Postfix on Debian Stable.

Here's what syslog says when receiving a new ticket through e-mail:

email2trac: Traceback (most recent call last):
Jul 19 14:30:00 qcinfra email2trac:   File "/usr/local/bin/email2trac", line 816, in ?     env = Environment(settings['project'], create=0)
Jul 19 14:30:00 qcinfra email2trac:   File "/usr/lib/python2.3/site-packages/trac/env.py", line 126, in __init__     self.verify()
Jul 19 14:30:00 qcinfra email2trac:   File "/usr/lib/python2.3/site-packages/trac/env.py", line 174, in verify     fd = open(os.path.join(self.path, 'VERSION'), 'r')
Jul 19 14:30:00 qcinfra email2trac: IOError: [Errno 13] Permission denied: '/var/local/trac/ti/VERSION'

But:

qcinfra:/usr/local/bin# ls -aulh /var/local/trac/ti/VERSION
-rwxrwxrwx  1 www-data www-data 27 Jul 19 14:22 /var/local/trac/ti/VERSION

Any ideas?

Attachments (0)

Change History (9)

comment:1 Changed 11 years ago by Bas van der Vlies

Can you run email2trac with the supplied message? If yes then there is a problem with you setup?

  • Are all directories in your path accesible for the user www-data?
  • which MTA do you use + under whichh user runs the MTA?

comment:2 in reply to:  1 Changed 11 years ago by jonathan.kelly@…

I ran

mail tracproj < msg.txt

with the supplied message and I get the exact same error message in syslog. What does it mean, exactly?

The www-data user can view the VERSION file just fine:

qcinfra:~# su www-data
qcinfra:/root$ more /var/local/trac/ti/VERSION
Trac Environment Version 1

I'm running Postfix (2.3.0-1) on Debian. The MTA_USER is postfix. The TRAC_USER is www-data.

Note that my alias file looks like this:

tracproj: |/usr/local/bin/email2trac

I followed mpalmer@…'s advice and created, for testing purposes, /root/aliases where the above command is listed. There's no tracproj reference in /etc/aliases.

If I use run_email2trac, I get:

(Command died with status 254: "/usr/local/bin/run_email2trac")

Thanks!

comment:3 Changed 11 years ago by anonymous

I never used this setup. So i do not know if this works. Can you for reference use the setup that we use if this works then you can better contact mpalmer@… for further info on this subject

comment:4 Changed 11 years ago by anonymous

For testing purpose i mean run this as root:

/usr/local/bin/email2trac < msg.txt

If this is oke. Then it is definitly a permission problem in your setup

comment:5 in reply to:  4 Changed 11 years ago by anonymous

qcinfra:~/email2trac-0.7.6# whoami
root
qcinfra:~/email2trac-0.7.6#  /usr/local/bin/email2trac < msg.txt
TD: saving email to /tmp/tmpPxDSA4.email2trac

tail /var/log/syslog:

Jul 21 08:50:10 qcinfra email2trac: Traceback (most recent call last):
Jul 21 08:50:10 qcinfra email2trac:   File "/usr/local/bin/email2trac", line 818, in ?     tktparser.parse(sys.stdin)
Jul 21 08:50:10 qcinfra email2trac:   File "/usr/local/bin/email2trac", line 487, in parse     self.new_ticket(m)
Jul 21 08:50:10 qcinfra email2trac:   File "/usr/local/bin/email2trac", line 413, in new_ticket     self.set_reply_fields(tkt, msg)
Jul 21 08:50:10 qcinfra email2trac:   File "/usr/local/bin/email2trac", line 315, in set_reply_fields     ticket['cc'] = self.to_unicode(mail_list)
Jul 21 08:50:10 qcinfra email2trac: UnboundLocalError: local variable 'mail_list' referenced before assignment

thanks!

comment:6 Changed 11 years ago by anonymous

This is a bug in the reply_all setting. It is fixed in trunk version or set reply_all :0 in email2trac.conf.

comment:7 in reply to:  6 Changed 11 years ago by anonymous

Ah, new stuff is happening.

qcinfra:~/email2trac-0.7.6#  /usr/local/bin/email2trac < msg.txt
TD: Failure sending notification on creation of ticket #2: 'bool' object has no attribute 'abs_href'

...and the ticket shows up in Trac. Yay! I'll go work on fixing this permission problem.

comment:8 Changed 11 years ago by jonathan.kelly@…

Resolution: fixed
Status: newclosed

I fixed my permission problem. What wasn't clear is that if you're not using run_email2trac but using email2trac directly, the tracproj user in the aliases file must have read/write permission to the Trac project database. Thanks!

comment:9 Changed 11 years ago by integratedsoftware.com

I have this exact same problem after following the directions on TracOnFedoraCore.

The SELinux on the bottom fixed this for me.

sudo chcon -R -t httpd_sys_content_t /srv/trac
sudo chcon -R -t httpd_sys_content_t /srv/svn

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Bas van der Vlies.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.