Edgewall Software
Modify

Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#7320 closed defect (fixed)

traceback for genshi-related error

Reported by: anonymous Owned by: Jonas Borgström
Priority: high Milestone: 0.11.1
Component: general Version: 0.11-stable
Severity: major Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

i was able to resolve this by installing a non-zipped genshi egg. i am running trac from branches/0.11-stable

[Tue Jun 10 11:32:49 2008] [error] [client xx.xxx.xxx.xxx] PythonHandler trac.web.modpython_frontend: Traceback (most recent call last):
[Tue Jun 10 11:32:49 2008] [error] [client xx.xxx.xxx.xxx] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 287, in HandlerDispatch\n    log=debug)
[Tue Jun 10 11:32:49 2008] [error] [client xx.xxx.xxx.xxx] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 464, in import_module\n    module = imp.load_module(mname, f, p, d)
[Tue Jun 10 11:32:49 2008] [error] [client xx.xxx.xxx.xxx] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r7189-py2.4.egg/trac/web/__init__.py", line 1, in ?\n    from trac.web.api import *
[Tue Jun 10 11:32:49 2008] [error] [client xx.xxx.xxx.xxx] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r7189-py2.4.egg/trac/web/api.py", line 29, in ?\n    from trac.util import get_last_traceback
[Tue Jun 10 11:32:49 2008] [error] [client xx.xxx.xxx.xxx] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r7189-py2.4.egg/trac/util/__init__.py", line 33, in ?\n    from trac.util.html import escape, unescape, Markup, Deuglifier
[Tue Jun 10 11:32:49 2008] [error] [client xx.xxx.xxx.xxx] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r7189-py2.4.egg/trac/util/html.py", line 16, in ?\n    from genshi import Markup, escape, unescape
[Tue Jun 10 11:32:49 2008] [error] [client xx.xxx.xxx.xxx] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/Genshi-0.5-py2.4-linux-i686.egg/genshi/__init__.py", line 28, in ?
[Tue Jun 10 11:32:49 2008] [error] [client xx.xxx.xxx.xxx] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/Genshi-0.5-py2.4-linux-i686.egg/genshi/core.py", line 544, in ?
[Tue Jun 10 11:32:49 2008] [error] [client xx.xxx.xxx.xxx] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/Genshi-0.5-py2.4-linux-i686.egg/genshi/_speedups.py", line 7, in ?
[Tue Jun 10 11:32:49 2008] [error] [client xx.xxx.xxx.xxx] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/Genshi-0.5-py2.4-linux-i686.egg/genshi/_speedups.py", line 4, in __bootstrap__
[Tue Jun 10 11:32:49 2008] [error] [client xx.xxx.xxx.xxx] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/setuptools-0.6c6-py2.4.egg/pkg_resources.py", line 840, in resource_filename\n    return get_provider(package_or_requirement).get_resource_filename(
[Tue Jun 10 11:32:49 2008] [error] [client xx.xxx.xxx.xxx] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/setuptools-0.6c6-py2.4.egg/pkg_resources.py", line 1311, in get_resource_filename\n    return self._extract_resource(manager, zip_path)
[Tue Jun 10 11:32:49 2008] [error] [client xx.xxx.xxx.xxx] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/setuptools-0.6c6-py2.4.egg/pkg_resources.py", line 1331, in _extract_resource\n    real_path = manager.get_cache_path(
[Tue Jun 10 11:32:49 2008] [error] [client xx.xxx.xxx.xxx] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/setuptools-0.6c6-py2.4.egg/pkg_resources.py", line 921, in get_cache_path\n    self.extraction_error()
[Tue Jun 10 11:32:49 2008] [error] [client xx.xxx.xxx.xxx] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/setuptools-0.6c6-py2.4.egg/pkg_resources.py", line 887, in extraction_error\n    raise err
[Tue Jun 10 11:32:49 2008] [error] [client xx.xxx.xxx.xxx] PythonHandler trac.web.modpython_frontend: ExtractionError: Can't extract file(s) to egg cache\n\nThe following error occurred while trying to extract file(s) to the Python egg\ncache:\n\n  [Errno 13] Permission denied: '/root/.python-eggs'\n\nThe Python egg cache directory is currently set to:\n\n  /root/.python-eggs\n\nPerhaps your account does not have write access to this directory?  You can\nchange the cache directory by setting the PYTHON_EGG_CACHE environment\nvariable to point to an accessible directory.\n

Attachments (1)

modpython_egg_cache.patch (1.3 KB ) - added by Jonas Borgström 16 years ago.
Set PYTHON_EGG_CACHE using PythonOption

Download all attachments as: .zip

Change History (21)

comment:1 by Emmanuel Blot, 16 years ago

Resolution: invalid
Status: newclosed

This is an installation issue (and as such should have been posted to the MailingList).

The root cause of the error is shown in the last line:

Permission denied: '/root/.python-eggs'

and the solution to resolve it is also printed out…

comment:2 by luis.silva@…, 16 years ago

Milestone: 0.11
Priority: normalhigh
Resolution: invalid
Severity: normalmajor
Status: closedreopened
Version: 0.11-stable

I'm having this problem even with python_egg_path defined as: "SetEnv PYTHON_EGG_CACHE /tmp/". The same directive was used in older versions of trac sucessfully. Either this is a problem with trac or with genshi 0.5 (i've not managed to exclude that option yet)

This directive is ignored…

I'm changing the severity to major as Genshi defaults its install method to zipped egg…

comment:3 by dna, 16 years ago

I've the same problem while upgrading from Trac 0.11dev-r6658 to HEAD. The Apache directive is ignored.

comment:4 by davidck@…, 16 years ago

Also having the same issue. Setting ENV PYTHON_EGG_CACHE did not work for me neither. Reinstalled Genshi 0.5 / Trac 0.11rc2 did not make a difference.

comment:5 by davidck@…, 16 years ago

Found the answer on the net, some other guy having the same issue. Solution: Extract Genshi egg as a directory under the same egg name.

comment:6 by buhrt@…, 16 years ago

Trac 0.12dev-r7204 on Fedora 8, apache (httpd-2.2.8-1.fc8) still gives:

[Thu Jun 12 18:10:57 2008] [error] [client 192.168.1.90] ExtractionError: Can't extract file(s) to egg cache\n\nThe following error occurred while trying to extract file(s) to the Python egg\ncache:\n\n [Errno 13] Permission denied: '/root/.python-eggs'\n\nThe Python egg cache directory is currently set to:\n\n /root/.python-eggs\n\nPerhaps your account does not have write access to this directory? You can\nchange the cache directory by setting the PYTHON_EGG_CACHE environment\nvariable to point to an accessible directory.\n

Adding:

SetEnv PYTHON_EGG_CACHE /tmp

inside the

<Location /trac>

block didn't help.

The quick/simple fix is to add to the end of: /etc/sysconfig/httpd export PYTHON_EGG_CACHE=/tmp

Then restart Apache.

in reply to:  5 comment:7 by anonymous, 16 years ago

Replying to davidck@gmail.com:

Found the answer on the net, some other guy having the same issue. Solution: Extract Genshi egg as a directory under the same egg name.

FYI: this worked for me too. Thank you very much davidck.

comment:8 by anonymous, 16 years ago

Hey

For anyone still clueless I did the following.

added the environment variables (Im not sure if this has any affect) by changing

/etc/apache2/sites-enabled/trac to:

<Location /trac>

SetHandler mod_python PythonInterpreter main_interpreter PythonHandler trac.web.modpython_frontend PythonOption TracEnvParentDir /var/lib/trac PythonOption TracUriRoot /trac SetEnv PYTHON_EGG_CACHE /tmp

</Location>

Then: easy_install -m genshi went to the python directory /usr/lib/python2.5/site-packages$ deleted the genshi egg ran easy_install -z genshi==0.5

comment:9 by conny@…, 16 years ago

I can not understand what just happened. I updated from 0.11b1 to 0.11, and all of a sudden when I restarted apache2 my SetEnv PYTHON_EGG_CACHE was no longer taken into respect.

AFAICR I didn't modify Apache in since I last restarted it… :-/

Is this a Trac 0.11 issue or an Apache 2.2 mod_env bug/vagueness?

comment:10 by mail@…, 16 years ago

Upgraded from 0.11rc1 to 0.11. Experiencing same symptoms as conny@.

comment:11 by jkempf@…, 16 years ago

Upgraded from 0.10.4 to 0.11, same symptoms as conny@.

comment:12 by anonymous, 16 years ago

Teste

in reply to:  8 comment:13 by anonymous, 16 years ago

Replying to anonymous:

Hey

For anyone still clueless I did the following.

added the environment variables (Im not sure if this has any affect) by changing

/etc/apache2/sites-enabled/trac to:

<Location /trac>

SetHandler mod_python PythonInterpreter main_interpreter PythonHandler trac.web.modpython_frontend PythonOption TracEnvParentDir /var/lib/trac PythonOption TracUriRoot /trac SetEnv PYTHON_EGG_CACHE /tmp

</Location>

Then: easy_install -m genshi went to the python directory /usr/lib/python2.5/site-packages$ deleted the genshi egg ran easy_install -z genshi==0.5

Should be

easy_install -Z genshi==0.5

-Z option ensures the egg is unzipped when installed

in reply to:  6 comment:14 by anonymous, 16 years ago

Replying to buhrt@aftinc.net:

The quick/simple fix is to add to the end of: /etc/sysconfig/httpd export PYTHON_EGG_CACHE=/tmp

Then restart Apache.

This worked for me, too, and was the only method that worked (tried the other methods as well)

by Jonas Borgström, 16 years ago

Attachment: modpython_egg_cache.patch added

Set PYTHON_EGG_CACHE using PythonOption

comment:15 by Jonas Borgström, 16 years ago

The main issue here is that we can't set the env variable PYTHON_EGG_CACHE from values passed using SetEnv since these values are only available at request handling time and not at the initial import.

attachment:modpython_egg_cache.patch uses a different approach and instead uses a global PythonOption:

PythonOption PYTHON_EGG_CACHE /some/path

But for this to work this statement needs to be placed outside any virtualhost or location section.

comment:16 by anonymous, 16 years ago

Resolution: fixed
Status: reopenedclosed

Fixed in r7406 and r7407.

comment:17 by markokobal, 16 years ago

I can not set the PYTHON_EGG_CACHE, using

apache-2.2.9 trac-0.11_2

Have tried inside

<Location> Set PYTHON_EGG_CACHE /some/path …

and aslo directly into httpd.conf with; PythonOption PYTHON_EGG_CACHE /some/path

Is there really no way of changing the PYTHON_EGG_CACHE?

comment:18 by suCrabu@…, 16 years ago

I've been able to solve this on BSD (apache 2.2.9 + mod_python) creating a trac.env file under /usr/local/etc/apache22/envvars.d which reads

  export PYTHON_EGG_CACHE=/tmp

This has the effect of exporting the PYTHON_EGG_CACHE variable to the apache process on startup. Any similar trick in your favorite Un*x/Apache flavour should work.

comment:19 by lsegal, 16 years ago

suCrabu, that's a beautiful fix for us BSD users, thanks! I'll use this until FreeBSD ports gets sync'd up with the next release.

comment:20 by voltechs@…, 15 years ago

tried suCrabu's "fix", with no luck. http-error.log still reports the value to be ""

Grrr, I hate it when things like this break for no good reason.

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.