How to fix problem
Problem:
Started by user Yen
Building in workspace /var/lib/jenkins/workspace/{$PROJECT_NAME}
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://bitbucket.org/{$PROJECT_NAME}.git # timeout=10
Fetching upstream changes from https://bitbucket.org/{$PROJECT_NAME}.git
> git --version # timeout=10
using .gitcredentials to set credentials
> git config --local credential.username yen # timeout=10
> git config --local credential.helper store --file=/tmp/git4933538534436228159.credentials # timeout=10
> git -c core.askpass=true fetch --tags --progress https://bitbucket.org/{$PROJECT_NAME}.git +refs/heads/*:refs/remotes/origin/*
> git config --local --remove-section credential # timeout=10
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://bitbucket.org/{$PROJECT_NAME}.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:799)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1055)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1086)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1741)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: hudson.plugins.git.GitException: Command "git -c core.askpass=true fetch --tags --progress https://bitbucket.org/{$PROJECT_NAME}.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: error: object file .git/objects/86/6571c4c3273464f0942f911711517ed82a8caa is empty
error: object file .git/objects/86/6571c4c3273464f0942f911711517ed82a8caa is empty
fatal: loose object 866571c4c3273464f0942f911711517ed82a8caa (stored in .git/objects/86/6571c4c3273464f0942f911711517ed82a8caa) is corrupt
fatal: The remote end hung up unexpectedly
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1740)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1476)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:63)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:314)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:797)
... 11 more
ERROR: null
We can go to our workspace, then just delete whole project to fix this problem.
cd /var/lib/jenkins/workspace/{$PROJECT_NAME}
sudo rm -rf .git