How to free up disk space for a user?

Hello Everyone,

I am currently facing the problem that a user has completely exhausted his disc space and therefore can no longer start a single profile. He is therefore also unable to clean up the disk space.

How can the user or an admin clean up the disc space?

Here is the error message that appears on startup:

Could not determine npm prefix: Command '['/opt/conda/bin/npm', 'prefix', '-g']' returned non-zero exit status 228.
OSError: [Errno 28] No space left on device
    with open(self.browser_open_file, "w", encoding="utf-8") as f:
  File "/opt/conda/lib/python3.11/site-packages/jupyter_server/serverapp.py", line 2913, in write_browser_open_file
    self.write_browser_open_file()
  File "/opt/conda/lib/python3.11/site-packages/jupyter_server/serverapp.py", line 2890, in write_browser_open_files
    self.write_browser_open_files()
  File "/opt/conda/lib/python3.11/site-packages/jupyter_server/serverapp.py", line 3023, in start_app
    self.start_app()
  File "/opt/conda/lib/python3.11/site-packages/jupyter_server/serverapp.py", line 3119, in start
    serverapp.start()
  File "/opt/conda/lib/python3.11/site-packages/jupyter_server/extension/application.py", line 623, in launch_instance
             ^^^^^^
    sys.exit(main())
  File "/opt/conda/bin/jupyterhub-singleuser", line 10, in <module>
Traceback (most recent call last):

Thank you very much for your help.

You’ll most likely need to gain admin access to your system outside of JupyterHub.

How you do this access depends on how you’ve deployed JupyterHub. For example if you’re running JupyterHub on a standalone server you should be able to ssh into the server as an admin, or failing that obtain console access. If you’re using the Z2JH helm chart on Kubernetes you could either follow your Kubernetes storage provider instructions for increasing the size of the volume, or mount the volume into a temporary admin pod (e.g. running busybox) to delete some files.

Thank you. The second case applies to me and I will do it for the user.
In future, I will give users the option of clearing the cache folder at the touch of a button, for example.

1 Like