Bug 491977 - Mod python "no usuable temporary directory found"
Mod python "no usuable temporary directory found"
Product: Fedora
Classification: Fedora
Component: mod_python (Show other bugs)
All Linux
medium Severity high
: ---
: ---
Assigned To: Joe Orton
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2009-03-24 15:41 EDT by Michael DeHaan
Modified: 2009-03-26 12:33 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-03-26 12:33:30 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Michael DeHaan 2009-03-24 15:41:12 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.  


ProcessId:      10253
Interpreter:    'localhost.localdomain'

ServerName:     'localhost.localdomain'
DocumentRoot:   '/var/www/html'

URI:            '/cblr/svc/op/nopxe/system/F10AB'
Location:       None
Directory:      '/var/www/cobbler/svc/'
Filename:       '/var/www/cobbler/svc/op'
PathInfo:       '/nopxe/system/F10AB'

Phase:          'PythonHandler'
Handler:        'services'

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
    log, import_path)

  File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 680, in import_module
    execfile(file, module.__dict__)

  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', '/']


Accessed:       Tue Mar 24 15:34:40 2009
Generation:     0

_mp_cb62af599b9ec7a553f07c92e369abb6 {
  FileName:     '/var/www/cobbler/svc/services.py'
  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.
Comment 1 Michael DeHaan 2009-03-24 15:52:04 EDT
While this is not the minimalistic path to reproduction, here's a simple step to get it to happen.

yum install cobbler
touch /tmp/foo
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:

    def nopxe(self,system=None,**rest):
        return str(self.remote.disable_netboot(system))

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!
Comment 2 Michael DeHaan 2009-03-26 12:33:30 EDT
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.


Note You need to log in before you can comment on or make changes to this bug.