Issue23

If you're reporting an issue for setuptools 0.7 or higher, please use BitBucket

Title SandboxViolation: mkdir('/Users/zooko/.python-eggs', 511) {}
Priority bug Status resolved
Superseder Nosy List pje, zooko
Assigned To zooko Keywords

Created on 2008-06-10.22:32:34 by zooko, last changed 2009-10-14.14:43:26 by zooko.

Messages
msg407 (view) Author: zooko Date: 2009-10-14.14:43:25
This has never recurred for me in the intervening 16 months, I never knew how to 
reproduce it, nobody else has reported it, so let's close this ticket assuming 
that your fix r65939 was good.
msg98 (view) Author: pje Date: 2008-08-21.18:47:11
If I knew how to reproduce the problem, I could've tested it myself.  ;-)

But I would check and see if one of the applicable eggs is now being installed
--always-unzip, or has zip-safe=False, where before it was installed zipped. 
Judging from the tracebacks, the egg in question would by PyOpenSSL, I'm guessing.
msg96 (view) Author: zooko Date: 2008-08-21.18:37:05
I'm afraid I'm not able to reproduce this, either on my Macbook Pro or on the
"yukyuk" buildslave -- the two places where I encountered this previously.

https://dev.allmydata.com/buildbot-tahoe-prod/builders/zooko%20yukyuk%20hardy/builds/18

Any suggestions on how to reproduce this problem so I can test r65939?  I
already tried removing the ~/.python-eggs directory and that didn't trigger the
problem.
msg90 (view) Author: pje Date: 2008-08-21.17:43:25
Fix applied to trunk, r65939.  Please test ASAP and confirm that it fixes the
problem.
msg84 (view) Author: zooko Date: 2008-08-13.17:21:11
Sorry, here is a link that doesn't require authorization:

http://allmydata.org/buildbot-tahoe-prod/builders/zooko%20yukyuk%20hardy/builds/17/steps/compile/logs/stdio
msg83 (view) Author: zooko Date: 2008-08-13.17:19:40
Here's what seems to be another instance of the same problem:

https://dev.allmydata.com/buildbot-tahoe-prod/builders/zooko%20yukyuk%20hardy/builds/17/steps/compile/logs/stdio
msg73 (view) Author: pje Date: 2008-08-05.15:23:20
It looks like this problem occurs if a resource extraction needs to make one or
more directories.  The call to ensure_directory() in
ResourceManager.get_cache_path() needs to be replaced with something that
bypasses the sandbox.  This is tricky because saving os.mkdir won't help;
makedirs() will call the sandboxed version of mkdir.  The ensure_directory()
call needs to be wrapped in a try/finally that swaps in the original os.mkdir.
msg45 (view) Author: zooko Date: 2008-06-10.22:33:21
Note that Twisted and pyOpenSSL are both already installed -- both having just
been installed minutes before with "easy_install Twisted" and "easy_install
pyOpenSSL".
msg44 (view) Author: zooko Date: 2008-06-10.22:32:34
When I do "easy_install Nevow" on my Mac OS 10.4 on PowerPC, I get the following:

Searching for Nevow
Reading http://pypi.python.org/simple/Nevow/
Reading http://divmod.org/trac/wiki/DivmodNevow
Reading http://divmod.org/projects/nevow
Reading http://www.divmod.org/
Best match: Nevow 0.9.31
Downloading
http://divmod.org/trac/attachment/wiki/SoftwareReleases/Nevow-0.9.31.tar.gz?format=raw
Processing Nevow-0.9.31.tar.gz
Running Nevow-0.9.31/setup.py -q bdist_egg --dist-dir
/tmp/easy_install-_xanA9/Nevow-0.9.31/egg-dist-tmp-3qYEDS
/tmp/easy_install-_xanA9/Nevow-0.9.31/nevow/context.py:37: Warning: 'with' will
become a reserved keyword in Python 2.6
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.5/bin/easy_install",
line 8, in <module>
    load_entry_point('setuptools==0.6c8', 'console_scripts', 'easy_install')()
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/setuptools/command/easy_install.py",
line 1671, in main
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/setuptools/command/easy_install.py",
line 1659, in with_ei_usage
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/setuptools/command/easy_install.py",
line 1675, in <lambda>
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/core.py",
line 151, in setup
    dist.run_commands()
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py",
line 974, in run_commands
    self.run_command(cmd)
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py",
line 994, in run_command
    cmd_obj.run()
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/setuptools/command/easy_install.py",
line 211, in run
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/setuptools/command/easy_install.py",
line 446, in easy_install
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/setuptools/command/easy_install.py",
line 476, in install_item
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/setuptools/command/easy_install.py",
line 655, in install_eggs
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/setuptools/command/easy_install.py",
line 930, in build_and_install
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/setuptools/command/easy_install.py",
line 919, in run_setup
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/setuptools/sandbox.py",
line 27, in run_setup
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/setuptools/sandbox.py",
line 63, in run
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/setuptools/sandbox.py",
line 29, in <lambda>
  File "setup.py", line 8, in <module>
    # 
  File "/tmp/easy_install-_xanA9/Nevow-0.9.31/setupcommon.py", line 2, in <module>
  File "/tmp/easy_install-_xanA9/Nevow-0.9.31/nevow/__init__.py", line 143, in
<module>
  File "/tmp/easy_install-_xanA9/Nevow-0.9.31/nevow/__init__.py", line 29, in load
  File "/tmp/easy_install-_xanA9/Nevow-0.9.31/nevow/util.py", line 183, in
_namedAnyWithBuiltinTranslation
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.3-fat.egg/twisted/python/reflect.py",
line 426, in namedAny
    topLevelPackage = _importAndCheckStack(trialname)
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.3-fat.egg/twisted/python/reflect.py",
line 377, in _importAndCheckStack
    return __import__(importName)
  File "/tmp/easy_install-_xanA9/Nevow-0.9.31/formless/webform.py", line 24, in
<module>
  File "/tmp/easy_install-_xanA9/Nevow-0.9.31/nevow/static.py", line 18, in <module>
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.3-fat.egg/twisted/web/error.py",
line 11, in <module>
    from twisted.web import http
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.3-fat.egg/twisted/web/http.py",
line 36, in <module>
    from twisted.internet import interfaces, reactor, protocol, address
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.3-fat.egg/twisted/internet/reactor.py",
line 11, in <module>
    from twisted.internet import selectreactor
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.3-fat.egg/twisted/internet/selectreactor.py",
line 21, in <module>
    from twisted.internet import posixbase
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.3-fat.egg/twisted/internet/posixbase.py",
line 25, in <module>
    from twisted.internet import tcp, udp
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.3-fat.egg/twisted/internet/tcp.py",
line 29, in <module>
    from OpenSSL import SSL
  File "build/bdist.macosx-10.3-fat/egg/OpenSSL/__init__.py", line 11, in <module>
  File "build/bdist.macosx-10.3-fat/egg/OpenSSL/rand.py", line 7, in <module>
  File "build/bdist.macosx-10.3-fat/egg/OpenSSL/rand.py", line 4, in __bootstrap__
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/pkg_resources.py",
line 841, in resource_filename
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/pkg_resources.py",
line 1311, in get_resource_filename
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/pkg_resources.py",
line 1332, in _extract_resource
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/pkg_resources.py",
line 921, in get_cache_path
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/pkg_resources.py",
line 887, in extraction_error
pkg_resources.ExtractionError: Can't extract file(s) to egg cache

The following error occurred while trying to extract file(s) to the Python egg
cache:

  SandboxViolation: mkdir('/Users/zooko/.python-eggs', 511) {}

The package setup script has attempted to modify files on your system
that are not within the EasyInstall build area, and has been aborted.

This package cannot be safely installed by EasyInstall, and may not
support alternate installation locations even if you run its setup
script by hand.  Please inform the package's author and the EasyInstall
maintainers to find out if a fix or workaround is available.

The Python egg cache directory is currently set to:

  /Users/zooko/.python-eggs

Perhaps your account does not have write access to this directory?  You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.
History
Date User Action Args
2009-10-14 14:43:26zookosetstatus: testing -> resolved
messages: + msg407
2008-08-21 18:47:11pjesetmessages: + msg98
2008-08-21 18:37:05zookosetmessages: + msg96
2008-08-21 17:43:25pjesetstatus: chatting -> testing
assignedto: zooko
messages: + msg90
keyword: - needpatch
2008-08-13 17:21:11zookosetmessages: + msg84
2008-08-13 17:19:40zookosetmessages: + msg83
2008-08-05 15:23:20pjesetnosy: + pje
messages: + msg73
keyword: + needpatch
2008-06-10 22:33:21zookosetstatus: unread -> chatting
messages: + msg45
2008-06-10 22:32:34zookocreate