Help Center/ ModelArts/ Troubleshooting/ DevEnviron/ Code Running Failures/ Error Occurs When Using a Notebook Instance to Run Code, Indicating That No File Is Found in /tmp
Updated on 2024-04-30 GMT+08:00

Error Occurs When Using a Notebook Instance to Run Code, Indicating That No File Is Found in /tmp

Symptom

When the a notebook instance is used to run code, the following error occurs:

FileNotFoundError: [Error 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', 'home/ma-user/work/SR/RDN_train_base']
Figure 1 Code running error

Possible Cause

Check whether a large amount of data is saved in /tmp.

Solution

  1. Go to the Terminal page. In the /tmp directory, run the du -sh * command to check the space usage of the directory.
    sh-4.3$cd /tmp
    sh-4.3$du -sh *
    4.0K    core-js-banners
    0       npm-19-41ed4c62
    6.7M    v8-compile-cache-1000
  2. Delete unnecessary large files.
    1. Delete the sample file test.txt: rm -f /home/ma-user/work/data/test.txt
    2. Delete the sample folder data: rm -rf /home/ma-user/work/data/