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

Eason picture Eason · Apr 26, 2012 · Viewed 64k times · Source

I have deployed Jenkins in my CentOS machine, Jenkins was working well for 3 days, but yesterday there was a Disk space is too low. Only 1.019GB left. problem.

How can I solve this problem, it make my master offline for hours?

Answer

orshachar picture orshachar · Dec 22, 2016

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