简体   繁体   中英

Jenkins cannot access git

After a crash of the Jenkins server, I cannot start my projects builds.

I get this weird message. Any clues?

hudson.plugins.git.GitException: Command "git fetch --tags --progress origin +refs/heads/master:refs/remotes/origin/master --prune" returned status code 128:
stdout: 
stderr: error: object file .git/objects/10/f103eb6e4590be766e67ca961e65f5c4e6836c is empty
error: object file .git/objects/10/f103eb6e4590be766e67ca961e65f5c4e6836c is empty
fatal: loose object 10f103eb6e4590be766e67ca961e65f5c4e6836c (stored in .git/objects/10/f103eb6e4590be766e67ca961e65f5c4e6836c) is corrupt
fatal: The remote end hung up unexpectedly

Had the same a few times.

Sometimes the answer of @"Mukesh M" may help - that is a decent approach. In other cases, the following approach helped me a few times.

First visit the /var/jenkins_home/caches folder. Delete the git-hashes. The next start of the job will retrieve everything from git again so the job will run smooth again. So omitting the git cache.

In my case I did following

Select Workspace and click on Wipe Out Current Workspace. This will delete your workspace.

Now just start new build and it will work.

詹金斯擦掉当前的工作区

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM