简体   繁体   中英

VSCode Remote Container - Error: ENOSPC: No space left on device

I have been using the VSCode Remote Container Plugin for some time without issue. But today when I tried to open my project the remote container failed to open with the following error:

Command failed: docker exec -w /home/vscode/.vscode-server/bin/9833dd88 24d0faab /bin/sh -c echo 34503 >.devport
rejected promise not handled within 1 second: Error: ENOSPC: no space left on device, mkdir '/home/vscode/.vscode-server/data/logs/20191209T160810

It looks like the container is out of disk space but I'm not sure how to add more.

Upon further inspection I am a bit confused. When I run df from in the container it shows that I have used 60G of disk space but the size of my root directory is only ~ 9G .

$ df
Filesystem      Size  Used Avail Use% Mounted on
overlay          63G   61G     0 100% /
tmpfs            64M     0   64M   0% /dev
tmpfs           7.4G     0  7.4G   0% /sys/fs/cgroup
shm              64M     0   64M   0% /dev/shm
/dev/sda1        63G   61G     0 100% /etc/hosts
tmpfs           7.4G     0  7.4G   0% /proc/acpi
tmpfs           7.4G     0  7.4G   0% /sys/firmware

$ du -h --max-depth=1 /
9.2G    /

What is the best way to resolve this issue?

It looks like all docker containers on your system share the same disk space. I found two solutions:

  1. Go into Docker Desktop's settings and increase the amount of disk space available.

  2. Run docker container prune to free disk space being used by stopped containers.

In my case I had a bunch stopped docker containers from months back taking up all of the disk space allocated to Docker.

Try docker system prune --all if you don't see any container or images with docker ps and docker images , but be careful it removes all cache and unused containers, images and network. docker ps -a and docker images -a shows you all the containers and images including ones that are currently not running or not in use.

Check the docs if problem persists: Clean unused docker resources

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM