Modify

Opened 17 years ago

Closed 16 years ago

Last modified 13 years ago

#20 closed defect (fixed)

fails with request for r/w permissions when user possesses them already

Reported by: rercola@… Owned by: anonymous
Priority: major Milestone:
Component: email2trac Version: 0.1
Keywords: Cc:

Description

I have a Trac 0.10.3 install on this machine, and I grabbed email2trac 0.10, configured it using dpkg-buildpackage, and installed it as a deb.

I edited the config to point to my trac install, and then edited postfix to point appropriately and run run_email2trac.

It silently failed a number of times before I thought to turn on syslog, and it now prints the following error:

Aug 9 06:30:07 einstein email2trac: Traceback (most recent call last): Aug 9 06:30:07 einstein email2trac: File "/usr/bin/email2trac", line 1062, in ? tktparser.parse(sys.stdin) Aug 9 06:30:07 einstein email2trac: File "/usr/bin/email2trac", line 647, in parse self.db = self.env.get_db_cnx() Aug 9 06:30:07 einstein email2trac: File "/var/lib/python-support/python2.4/trac/env.py", line 182, in get_db_cnx return DatabaseManager?(self).get_connection() Aug 9 06:30:07 einstein email2trac: File "/var/lib/python-support/python2.4/trac/db/api.py", line 75, in get_connection return self._cnx_pool.get_cnx(self.timeout or None) Aug 9 06:30:07 einstein email2trac: File "/var/lib/python-support/python2.4/trac/db/pool.py", line 101, in get_cnx cnx = self._connector.get_connection(self._kwargs) Aug 9 06:30:07 einstein email2trac: File "/var/lib/python-support/python2.4/trac/db/sqlite_backend.py", line 113, in get_connection return SQLiteConnection(path, params) Aug 9 06:30:07 einstein email2trac: File "/var/lib/python-support/python2.4/trac/db/sqlite_backend.py", line 150, in init raise TracError?('The user %s requires read _and_ write ' \ Aug 9 06:30:07 einstein email2trac: TracError?: The user trac requires read _and_ write permission to the database file /var/acmtrac/trac-project/db/trac.db and the directory it is located in.

However, if we check the permissions... # ls -al /var/acmtrac/trac-project/db total 6352 drwxr-xr-x 2 trac trac 4096 Aug 9 06:22 . drwxr-xr-x 10 trac root 4096 Aug 9 06:10 .. -rw-r--r-- 1 trac root 2149376 Aug 9 06:22 trac.db

I'm rather at a loss. Trac functions fine, for what it's worth, so whatever it is, it's not breaking trac itself, just email2trac...

Attachments (0)

Change History (11)

comment:1 Changed 17 years ago by rercola@…

I can't believe I forgot both how to do formatting like that in trac and how to attach logs. I'm so ashamed.

Aug  9 06:30:07 einstein email2trac: Traceback (most recent call last): 
Aug  9 06:30:07 einstein email2trac:   File "/usr/bin/email2trac", line 1062, in ?     tktparser.parse(sys.stdin) 
Aug  9 06:30:07 einstein email2trac:   File "/usr/bin/email2trac", line 647, in parse     self.db = self.env.get_db_cnx() 
Aug  9 06:30:07 einstein email2trac:   File "/var/lib/python-support/python2.4/trac/env.py", line 182, in get_db_cnx     return DatabaseManager(self).get_connection() 
Aug  9 06:30:07 einstein email2trac:   File "/var/lib/python-support/python2.4/trac/db/api.py", line 75, in get_connection     return self._cnx_pool.get_cnx(self.timeout or None) 
Aug  9 06:30:07 einstein email2trac:   File "/var/lib/python-support/python2.4/trac/db/pool.py", line 101, in get_cnx     cnx = self._connector.get_connection(**self._kwargs) 
Aug  9 06:30:07 einstein email2trac:   File "/var/lib/python-support/python2.4/trac/db/sqlite_backend.py", line 113, in get_connection     return SQLiteConnection(path, params) 
Aug  9 06:30:07 einstein email2trac:   File "/var/lib/python-support/python2.4/trac/db/sqlite_backend.py", line 150, in __init__     raise TracError('The user %s requires read _and_ write ' \ 
Aug  9 06:30:07 einstein email2trac: TracError: The user trac requires read _and_ write permission to the database file /var/acmtrac/trac-project/db/trac.db and the directory it is located in. 
# ls -al /var/acmtrac/trac-project/db
total 6352
drwxr-xr-x  2 trac trac    4096 Aug  9 06:22 .
drwxr-xr-x 10 trac root    4096 Aug  9 06:10 ..
-rw-r--r--  1 trac root 2149376 Aug  9 06:22 trac.db

comment:2 Changed 17 years ago by anonymous

  • Owner changed from bas to anonymous
  • Status changed from new to assigned

No problem, but the message is very clear no permission ;-). The debian package has as defaults:

  • trac_user: www-data
  • mta_user: nobody

So you have to adjust it to you environment. Maybe i will make it configurable via debconf. For know use the configure options. See Installation on trac pages or edit Makefile.in

comment:3 Changed 17 years ago by rercola@…

In other words, the error message is incorrect.

When it says "trac" requires permissions for the folder, it really means "www-data"?

This is...very silly.

comment:4 Changed 17 years ago by rercola@…

Additionally, changing the user to trac from www-data made the error in syslog cease, but it still fails to generate a bug, silently.

This makes me think that another error is occurring somewhere that's not raising an exception?

comment:5 Changed 17 years ago by anonymous

We have a lot of confusion going on. What kind of setup do you have. from the mail i think you have tracd running and which mta do you run (qmail, sendmail, postfix ...).

The trac_userid is the user that writes to the file. In my situation it is www-data because apache is running under this userid.

the mta_userid is in my situation nobody we are running postfix. You have adjust this to your enviroment. The debian packages uses this a default values. If you adjust soemthing in Makefile.in, first:

debian/rules clean 
debian/rules binary

or if you adjust the Makefile.in

make distclean
./configure
make
}}

comment:6 Changed 17 years ago by rercola@…

In my situation, the mta user is postfix and the tracd user is trac using suexec CGI.

I did modify both users appropriately in makefile.in and rebuilt the package cleanly, then installed it.

Again, the result which occurs is that postfix thinks it delivered the mail to run_email2trac, run_email2trac spits out nothing to syslog (with the syslog writing config option enabled, and as you saw above, quite functional), and a bug is not opened or updated.

...interesting.

I just emailed it again and got a status 254 return which did not occur previously.

Command died with status 254: "/usr/bin/run_email2trac"

Prior, I had received the following:

relay=local, delay=0, status=sent (delivered to command: /usr/bin/run_email2trac)

The only thing I changed were the mta-user and trac-user in the makefile.in from the defaults to my respective values of postfix and trac.

comment:7 Changed 17 years ago by rercola@…

Also, to be clear, I did rebuild with debian/rules clean [etc] and install the resulting package. :)

Perhaps my mta-user should be nobody, instead.

Hm. That results in the prior condition of reporting the email delivered to the command, but no bug being opened.

relevant postfix output:

relay=local, delay=1, status=sent (delivered to command: /usr/bin/run_email2trac)

comment:8 Changed 16 years ago by bas

  • Resolution set to fixed
  • Status changed from assigned to closed

Closes ticket, no comments anymore

comment:9 Changed 16 years ago by anonymous

I had this problem... basically. I thought postfix was running under "postfix" user. But after 2 hours of pulling my hair out... I found when it kicks off a command from the alias it was running as "nobody". (everything else postfix seems to be running as postfix)

I did something like this in the postfix aliases

 tracticket: |"whoami > /tmp/posty"

I guess I could have just done a touch.

Hope this helps someone. -Scott Serr

comment:10 Changed 16 years ago by anonymous

Thanks for the update, i also had suggested it to somebody. We must create a FAQ with these kind of tips.

comment:11 Changed 13 years ago by anonymous

My solution:

Build email2trac src with opt: ./configure --with-mta_user=www-data make,make install

And run fetchmail as www-data, that's OK.

Add Comment

Modify Ticket

Change Properties
Action
as closed The owner will remain anonymous.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.