Skip to content

AWS CodeBuild Failed with Error: no space left on device

0

Hi,

Our codebuild project failed to execute with the error: no space left on device. It was working fine for a long time. Just happened with this error a couple days ago!

------
ERROR: failed to solve: failed to register layer: Error processing tar file(exit status 1): write /opt/jboss/wildfly/modules/system/layers/base/org/jctools/main/jctools-core-2.1.2.jar: no space left on device

I added the command "df -h" to check the disk usage, I got the following result:

[Container] 2024/05/24 07:58:41.941881 Running command df -h
Filesystem      Size  Used Avail Use% Mounted on
overlay          95G   94G  1.8G  99% /
tmpfs            64M     0   64M   0% /dev
tmpfs           7.8G     0  7.8G   0% /sys/fs/cgroup
/dev/nvme0n1p1   95G   94G  1.8G  99% /codebuild/output
shm             512M     0  512M   0% /dev/shm
tmpfs           7.8G  432K  7.8G   1% /run/docker.sock
tmpfs           7.8G     0  7.8G   0% /proc/acpi
tmpfs           7.8G     0  7.8G   0% /proc/scsi
tmpfs           7.8G     0  7.8G   0% /sys/firmware

I don't believe I used 94GB of disk space to build a WildFly based docker image!

What went wrong? Please help!

Thanks a lot! Xiang

asked 2 years ago1.1K views
2 Answers
1

Hello.

Although this is a temporary solution, I thought that if I set a large size of computing to the Codebuild build, the disk capacity would increase, so I could avoid the error.
https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html

Are you using local cache with Codebuild?
This is just my prediction, but I thought that when using local cache, past data may remain and take up space on the disk.
https://aws.amazon.com/jp/blogs/devops/improve-build-performance-and-save-time-using-local-caching-in-aws-codebuild/

I think there is a possibility that the Inode is being used up, so try running the following command before building to erase the data.

docker exec front df -i
docker volume rm $(docker volume ls -qf dangling=true)
EXPERT
answered 2 years ago
EXPERT
reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.