No usable temporary directory found

OpenCurious picture OpenCurious · Jun 8, 2013 · Viewed 64.7k times · Source

I am trying to find a temp directory , but when i am trying to get the directory using

tempfile.gettempdir()

it's giving me error of

 File "/usr/lib/python2.6/tempfile.py", line 254, in gettempdir
    tempdir = _get_default_tempdir()
  File "/usr/lib/python2.6/tempfile.py", line 201, 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', '/home/openerp/openerp-server']

The permission on the directory is 777 owned by root.

Answer

Atul Arvind picture Atul Arvind · Jun 8, 2013

This kind of error occured in two case

  1. permission(should be drwxrwxrwt and owened by root)
  2. space

To check space(disk usage)just run the command on terminal

df -h

Will list the disk usage on unix and get the output like

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda5        28G   15G   12G  58% /

If the root(mounted on /) usage is 100%.

You need to clean the tmp directory or restart the machine or make some space on the root.