Edgewall Software

Ticket #7320 (closed defect: fixed)

Opened 5 months ago

Last modified 3 months ago

traceback for genshi-related error

Reported by: anonymous Owned by: jonas
Priority: high Milestone: 0.11.1
Component: general Version: 0.11-stable
Severity: major Keywords:
Cc:

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

modpython_egg_cache.patch (1.3 KB) - added by jonas 4 months ago.
Set PYTHON_EGG_CACHE using PythonOption?

Change History

  Changed 5 months ago by eblot

  • status changed from new to closed
  • resolution set to invalid

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...

  Changed 5 months ago by luis.silva@…

  • status changed from closed to reopened
  • severity changed from normal to major
  • priority changed from normal to high
  • version set to 0.11-stable
  • milestone set to 0.11
  • resolution invalid deleted

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...

  Changed 5 months ago by dna

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

  Changed 5 months ago by davidck@…

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.

follow-up: ↓ 7   Changed 5 months ago by davidck@…

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.

follow-up: ↓ 14   Changed 5 months ago by buhrt@…

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   Changed 5 months ago by anonymous

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.

follow-up: ↓ 13   Changed 5 months ago by 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

  Changed 4 months ago by conny@…

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?

  Changed 4 months ago by mail@…

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

  Changed 4 months ago by jkempf@…

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

  Changed 4 months ago by anonymous

Teste

in reply to: ↑ 8   Changed 4 months ago by anonymous

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   Changed 4 months ago by anonymous

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)

Changed 4 months ago by jonas

Set PYTHON_EGG_CACHE using PythonOption?

  Changed 4 months ago by jonas

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.

  Changed 4 months ago by anonymous

  • status changed from reopened to closed
  • resolution set to fixed

Fixed in r7406 and r7407.

  Changed 4 months ago by markokobal

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?

  Changed 3 months ago by suCrabu@…

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.

  Changed 3 months ago by lsegal

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.

Add/Change #7320 (traceback for genshi-related error)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from jonas. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.