Red Hat Bugzilla – Bug 491977
Mod python "no usuable temporary directory found"
Last modified: 2009-03-26 12:33:30 EDT
Description of problem:
I have a package that uses mod_python that has worked before well in the past. On F10, I am getting the following error from tempfile, only under mod_python.
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)
File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1202, in _process_target
module = import_module(module_name, path=path)
File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 296, in import_module
File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 680, in import_module
File "/var/www/cobbler/svc/services.py", line 16, in <module>
from mod_python import Session
File "/usr/lib/python2.5/site-packages/mod_python/Session.py", line 40, in <module>
tempdir = tempfile.gettempdir()
File "/usr/lib/python2.5/tempfile.py", line 262, in gettempdir
tempdir = _get_default_tempdir()
File "/usr/lib/python2.5/tempfile.py", line 209, in _get_default_tempdir
("No usable temporary directory found in %s" % dirlist))
IOError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/']
MODULE CACHE DETAILS
Accessed: Tue Mar 24 15:34:40 2009
Instance: 1 [IMPORT]
Generation: 0 [ERROR]
Modified: Fri Mar 6 16:55:07 2009
In my usage, the problem is "every other" intermittent. SELinux is disabled. Previous versions of Fedora did not have this problem and the underlying code has not changed to my knowledge. Googling a bit I've seen other people report this same problem with PSP but could not find a Bugzilla related to it.
While this is not the minimalistic path to reproduction, here's a simple step to get it to happen.
yum install cobbler
cobbler distro add --name=foo --kernel=/tmp/foo --initrd=/tmp/foo
cobbler profile add --name=foo --distro=foo
cobbler system add --name=foo --mac=AA:BB:CC:DD:EE:FF --profile=foo
Visit in your browser:
Every other reload, I get the above error and traceback.
The code in question is "cobbler/services.py", which you can look for:
Basically the code in question makes an XMLRPC connection to a daemon and returns a value. I'm not sure why it has any dealings with tempfile at this point -- though if you google for info about the traceback there are other hits that discuss this (but no answers that I could find).
Let me know how I can be of further help, thanks!
Ok, we found the solution to this.. though mod_python may need some help to deal with it.
If there are any ez_installed python packages that are compressed .egg files (not .egg-infos) you have to unzip them so mod_python does not have to. Once this is done, things appear to work fine for me.
Very weird, but it's all good now.