0

My VPS has Ubuntu 22.04.4 LTS. I got the message from the Docker container when installed the npm dependencies inside this container:

 > [front_server 4/4] RUN npm install --no-package-lock:
36.78 npm error code ENOSPC
36.78 npm error syscall write
36.78 npm error errno ENOSPC
36.78 npm error nospc Invalid response body while trying to fetch https://registry.npmjs.org/@prisma%2fdebug: ENOSPC: no space left on device, write
36.78 npm error nospc There appears to be insufficient space on your system to finish.
36.78 npm error nospc Clear up some disk space and try again.
36.78 npm error A complete log of this run can be found in: /root/.npm/_logs/2025-05-16T02_20_30_681Z-debug-0.log

I have executed this installation a several tens times before, but there was not such message. Looks like some kind of garbage has been accumulated all of this time.

  • Of course, I have pruned all dangling Docker images, containers and volumes (I have added to appendix the lists of containers and volumes).
  • The VPS is been used only for the hosting of single web application (herewith, the staging and production versions. No unrelated files has been consciously uploaded to VPS.

The output of df -h:

Filesystem      Size  Used Avail Use% Mounted on
tmpfs           196M  1.4M  195M   1% /run
/dev/vda1        49G   49G  164M 100% /
tmpfs           979M   28K  979M   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           979M  648K  979M   1% /run/qemu
/dev/vda15      105M  6.1M   99M   6% /boot/efi
tmpfs           196M  4.0K  196M   1% /run/user/1002

Looks like the /dev/vda1 is full. I didn't think this would happen, because there is no the large files like videos or HD images in my VPS.

Here is the output of du -hx --max-depth=1 /:

2.0G    /usr
107M    /boot
5.9M    /etc
4.0K    /media
4.0K    /mnt
68K     /tmp
4.0K    /srv
5.1M    /home
24K     /snap
44G     /var
16K     /lost+found
344K    /root
16K     /opt
49G     /

sudo du -hx --max-depth=1 /var output:

131M    /var/cache
40K     /var/tmp
4.1G    /var/log
4.0K    /var/crash
40G     /var/lib
2.0M    /var/backups
92M     /var/www
4.0K    /var/local
16K     /var/spool
64K     /var/snap
4.0K    /var/mail
4.0K    /var/opt
44G     /var

The /var takes 44G, and inside /var, the lib takes 40GB. As expected, almost of these 40GB takes /var/lib/docker:

8.0K    /var/lib/ubuntu-release-upgrader
242M    /var/lib/apt
42M     /var/lib/postgresql
4.0K    /var/lib/misc
3.5M    /var/lib/command-not-found
20K     /var/lib/update-notifier
8.0K    /var/lib/landscape
4.0K    /var/lib/usb_modeswitch
8.0K    /var/lib/vim
39G     /var/lib/docker
// ...

Again, below /var/lib/docker, almost volume has been occupied by /var/lib/docker/overlay2 (38GB).

Appendix

Docker Image

Indented as one-time usage (one image/container per app version).

FROM node:22.15-alpine3.20

WORKDIR /var/www/example.jp

COPY . /var/www/example.jp

RUN npm install --no-package-lock

Remain Images (docker images)

Nothing that takes a several GBs.

REPOSITORY                         TAG       IMAGE ID       CREATED          SIZE
example-front_server-staging      latest    cc13e6b0fdb7   55 minutes ago   719MB
example-front_server-production   latest    a047474d5c29   2 months ago     360MB
mysql                              9.1.0     56a8c14e1404   7 months ago     603MB
postgres                           16.2      8e4fc9e18489   15 months ago    431MB

docker system df output

TYPE            TOTAL     ACTIVE    SIZE      RECLAIMABLE
Images          4         3         2.114GB   718.6MB (33%)
Containers      3         3         4.299kB   0B (0%)
Local Volumes   4         3         287.6MB   22.88MB (7%)
Build Cache     235       0         32GB      32GB

Answers to questions from comments

What command did you execute repeatedly?

docker compose up --build. When I used -d flag, off course, I has stopped it manually.

What does docker container ls show?

3 containers, all of them has been launched intentionally. No dangling ones.

CONTAINER ID   IMAGE                              COMMAND                   CREATED         STATUS        PORTS                                                  NAMES
a8fa1cc4ef9f   mysql:9.1.0                        "docker-entrypoint.s…"   4 days ago      Up 4 days     33060/tcp, 0.0.0.0:3305->3306/tcp, :::3305->3306/tcp   Example-Database-Staging
882370b06266   example-front_server-production   "docker-entrypoint.s…"   2 months ago    Up 2 months   0.0.0.0:443->443/tcp, :::443->443/tcp                  Example-FrontServer-Production
8392a42a9abd   postgres:16.2                      "docker-entrypoint.s…"   10 months ago   Up 2 months   0.0.0.0:5432->5432/tcp, :::5432->5432/tcp              Example-Database-Production

What does docker volume ls show?

4 volumes, not unexpected ones.

DRIVER    VOLUME NAME
local     Example-DatabaseData-Production
local     Example-DatabaseData-Staging
local     Example-Uploads-Staging
local     Uploads-Production

0 Answers0