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. MOD_PYTHON ERROR 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', '/'] MODULE CACHE DETAILS 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 } httpd-2.2.10-2.i386 mod_python-3.3.1-8.i386 python-2.5.2-1.fc10.i386 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 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: http://yourserver.example.org/cblr/svc/op/nopxe/system/foo 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): self.__xmlrpc_setup() 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!
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. Thanks.