Modify

Opened 9 years ago

Closed 9 years ago

#345 closed enhancement (fixed)

trac installation detection exception false positive

Reported by: quinn@… Owned by: bas
Priority: major Milestone:
Component: email2trac Version: 2.8.4
Keywords: Cc:

Description

On a new installation of email2trac 2.8.4, I got this error:

{{{
{q@oak/0 ~} echo hello | sudo -u apache /usr/bin/email2trac --project=asdf
Can not find a a valid trac installation, solutions could be:
        set PYTHONPATH
        use the --virtualenv <dir> option
}}}

However Trac is installed in the default location, and python is able to
find it with the default configuration:

{{{
{q@oak/0 ~} python -c 'from trac import __version__ as trac_version; print
trac_version'
0.12.5
}}}

So I discovered the problem is not that email2trac cannot find Trac, but
that there was a missing dependancy. I modified /usr/bin/email2trac to
display the detail of the exception:

{{{
--- /usr/bin/email2trac.orig    2014-11-17 09:25:11.000000000 -0600
+++ /usr/bin/email2trac 2014-11-17 09:25:16.000000000 -0600
@@ -2755,6 +2755,7 @@
         from trac import config as trac_config

     except ImportError, detail:
+        print detail
         print "Can not find a a valid trac installation, solutions could
be:"
         print "\tset PYTHONPATH"
         print "\tuse the --virtualenv <dir> option"
}}}

And it displayed this:

{{{
{q@oak/0 ~} echo hello | sudo -u apache /usr/bin/email2trac --project=ex
No module named genshi.builder
Can not find a a valid trac installation, solutions could be:
        set PYTHONPATH
        use the --virtualenv <dir> option
}}}

Installing package `python-genshi` solved the problem. However, while
installing the `python-genshi` package (version 0.5.1-7.1.el6) fixed the
problem, allowing email2trac to run correctly, it broke Trac exactly in the
way described by this user:
<https://oss.trac.surfsara.nl/email2trac/ticket/298>. When I have only the
package `python-genshi06` installed with Trac 0.12.5 it works fine, but not
email2trac.

In reference to this problem, setting `PYTHONPATH` didn't help. instead I
found the solution was to create a symlink:
{{{
sudo ln -s /usr/lib/python2.6/site-packages/Genshi-0.6-py2.6.egg/genshi
/usr/lib/python2.6/site-packages/genshi
}}}

This is probably only a problem for CentOS/RHEL users who have Trac
installed form the EPEL repository.

Quinn

Attachments (0)

Change History (2)

comment:1 Changed 9 years ago by bas

  • Status changed from new to assigned
  • Type changed from defect to enhancement

Thanks for the patch. I will apply it, it improves the error message

comment:2 Changed 9 years ago by bas

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

In 656:

improve error messag when email2trac fails to start, closes #345

Add Comment

Modify Ticket

Change Properties
Action
as closed The owner will remain bas.
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.