[Jenkins] No Space Left on the Disk or Copy to /tmp directory failed
![[Jenkins] No Space Left on the Disk or Copy to /tmp directory failed](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1670738964983%2Fi8179iTdh.webp&w=3840&q=75)
Search for a command to run...
![[Jenkins] No Space Left on the Disk or Copy to /tmp directory failed](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1670738964983%2Fi8179iTdh.webp&w=3840&q=75)
No comments yet. Be the first to comment.
Here's the TLDR. Create a file to where all the methods will be present. // s3.js import * as AWS from '@aws-sdk/client-s3'; const bucket = process.env.AWS_BUCKET_NAME; const region = process.env.AWS_REGION; const endpoint = process.env.AWS_ENDPOIN...
Back in my previous company, we ran into issues where our MongoDB server became very slow and affected all our queries. Fortunately, we used Atlas and Profiler was available to us to analyse what was going on. Here are some things we looked at. High...

Uploading file to google drive requires the following steps: Authenticate with google drive Uploading a file to a specific folder by the name of the folder If the folder does not exist, we need to create the folder first Finally, upload the file....
While naming variables, functions and classes is one of the hardest things to do as a programmer, writing comments is also hard. It’s easier to express our logic in code vs English. Let’s look at the best ways to write comments in code. YAGNI — You a...

With an increasing number of users using google sheets to maintain data, it has become essential to access google sheets in your development environment. You have a few options: Use API from services like sheetsu, sheety, etc Use Official Google sh...

It was a reglular day of the our product release and I was hoping everything would go as planned, but you know, production releases could go wrong even when everything was in place.
Jenkins is extremely reliable, however it can fail too, and that’s what happened to me. My production build failed with an error without much information. It said (in generic terms)…

Not able to Copy the files to the /tmp directory.
I started feeling the heat since the frontend production release was successful and things could start breaking for the users (though it was the time when the application is not used). I tried again.. Same errror. I tried it for the third time before I started debugging the instance, and now it said, “No Space Left on the Disk”, Finally some context.
Immediately I found my /tmp directory was filling up. I deleted the folder manually to get my build to succeed. It was a sign of relief when it did.
Now was the time to make sure this does not happen again. When I thought of it I realised the same problem happened 15 days ago but I did not get time to figure out what went wrong and since I use beanstalk my instance just restarted.
Anyway so after a bit of digging I found that we can configure each job to “discard old builds” this would ensure that the artifacts and the workspace is deleted for the previous builds.
The steps are below.. (For Freestyle Project)

Click the job that you want to configure.
Click Configure
In General, Click Checkbox for “Discard Old Build”
Configure as per your needs.
Make sure you save the settings.
Repeat it for all the jobs.
In case its not working for you, please leave a comment, I will try to help out! :)