IOError: No space left on device - which device?

前端 未结 4 1205
走了就别回头了
走了就别回头了 2021-02-06 06:56

I\'m uploading a small file (8.5 Mb) to a flask test server.

When the file finishes uploading, the server reports:

    File \"/home/ubuntu/.virtualenvs/e         


        
4条回答
  •  有刺的猬
    2021-02-06 07:12

    Werkzeug stores files over a certain size in your temp directory using tempfile.TemporaryFile(), but take into account that those files are unlinked for security. You won't see them listed in the directory. tempfile.gettempdir() is the correct method of determining the directory used for this.

    Your /var/tmp directory is probably configured for a smaller partition. Check with df -h to see if that partition still has enough space left. You also need to check for free inodes, with df -i.

    It could also be that a process (possibly yours) is hanging on to such unlinked files too long and the space hasn't been returned to the OS yet. You can check for processes holding on to deleted files with:

    lsof -nP | grep '/var/tmp' | grep '(deleted)'
    

    or

    find /proc/*/fd -ls | grep '/var/tmp' | grep  '(deleted)'
    

提交回复
热议问题