How to solve jenkins 'Disk space is too low' issue? How to solve jenkins 'Disk space is too low' issue? jenkins jenkins

How to solve jenkins 'Disk space is too low' issue?


You can easily change the threshold from jenkins UI (my version is 1.651.3):

[jenkins nodes preventing monitoring page]


Update: How to ensure high disk space

This feature is meant to prevent working on slaves with low free disk space. Lowering the threshold would not solve the fact that some jobs do not properly cleanup after they finish.

Depending on what you're building:

  1. Make sure you understand what is the disk output of your build - if possible - restrict the output to happen only to the job workspace. Use workspace cleanup plugin to cleanup the workspace as post build step.
  2. If the process must write some data to external folders - clean them up manually on post build steps.

Alternative1 - provision a new slave per job (use spot slaves - there are many plugins that integrate with different cloud provider to provision on the fly machines on demand)

Alternative2 - run the build inside a container. Everything will be discarded once the build is finished


Beside above solutions, there is a more "COMMON" way - directly delete the largest space consumer from Linux machine. You can follow the below steps:

  1. Login to Jenkins machine (Putty)
  2. cd to the Jenkins installation path

Using ls -lart to list out hidden folder also, normally jenkin installation is placed in .jenkins/ folder

[xxxxx ~]$ ls -lart

drwxrwxr-x 12 xxxx 4096 Feb 8 02:08 .jenkins/

  1. list out the folders spaces

Use df -h to show Disk space in high level

du -sh ./*/ to list out total memory for each subfolder in current path.

du -a /etc/ | sort -n -r | head -n 10 will list top 10 directories eating disk space in /etc/

  1. Delete old build or other large size folder

enter image description here

Normally ./job/ folder or ./workspace/ folder can be the largest folder. Please go inside and delete base on you need (DO NOT delete entire folder).

rm -rf theFolderToDelete


You can limit the reduce of disc space by discarding the old builds. There's a checkbox for this in the project configuration.