Fix stderr: error: object file .git/objects/ad/… is empty error using JENKINS

Tiempo de lectura: < 1 minuto

Reading time: < 1 minute

Today, I’m going to show you how to fix the error when synchronizing a GIT project with Jenkins, which returns:

stderr: error: object file .git/objects/ad/.... is empty
error: object file .git/objects/ad/.... is empty

This occurs because there is a corrupt file in the Jenkins Git. To fix it, we need to delete the caches it stores using this command:

Local installation:

cd /var/jenkins_home/caches
sudo rm -rf ./*

Installation with Jenkins Docker container:

  • Access the bash of the running Jenkins container:
docker exec -it jenkins bash
  • Use the following command to access the cache and delete it:
cd /var/jenkins_home/caches
rm -rf ./*

Leave a Comment