ghprb-plugin: Unable to fetch origin - Workspace corruption?
Hello, I’ve been trying to use this plugin to run jenkins on new pull requests, and initially I was successful. However, after a short period of time (fifteenish minutes), it would being crashing on new requests with this error:
Building in workspace /var/lib/jenkins/jobs/Libras Pull Requests/workspace
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url git@github.com:71lbs/libras.git # timeout=10
Fetching upstream changes from git@github.com:71lbs/libras.git
> git --version # timeout=10
using GIT_SSH to set credentials
> git fetch --tags --progress git@github.com:71lbs/libras.git refs/pull/*:refs/remotes/origin/pr/*
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from git@github.com:71lbs/libras.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:803)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1063)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1094)
at hudson.scm.SCM.checkout(SCM.java:495)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1278)
and etc...
The only way I was able to get it working again is by deleting the job’s workspace, and have it pull down a fresh clone. Is there any settings that I can use to get to always pull down a fresh clone, or is this some sort of error with the plugin?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 19 (2 by maintainers)
@MasterSlowPoke
I had exactly the same stack trace with this error message: “ERROR: Error fetching remote repo ‘origin’” I was getting it as soon as my repository in GitHub was set to private. Everything was configured correctly in Jenkins and Github.
I searched for days and surprisingly, this worked, no Jenkins restart is even required: https://stackoverflow.com/a/37753202/5484068
#I was on Windows Server 2012 R2, open a CMD in your Jenkins installation as an Admin, and run this:
git config --global --unset credential.helper
git config --system --unset credential.helper
Was having the exact same problem and the above did not work.
Solution for me was to clear the workspace dir @
/var/lib/jenkins/workspace/*
i have encountered the same error, i have tried both solution proposed above but still could not resolve the problem. Anyone could give any further suggestion?
Cloning the remote Git repository Cloning repository git@github.com:XXXXX/yyyyyyyy
Please make sure you have the correct access rights and the repository exists.
=================
@myu8tbgl Same. I’ve purged the workspaces, purged the project, re-installed Git on the slave, upgraded Jenkins from ~1.6 to 2.118, purged jenkins on the slave (as far as I know at least) and re-installed it, deleted the node and re-created it. From the shell on my slave (both cmd and WSL) I’m able to ssh to my git server (
ssh git@mygitserver
) without issue, etc…And yet my projects’ console output still report the git permission issues.
This all started around the time I upgraded from ~1.7 to 2.17 on my slave. After 2 days, I downgraded to the now deprecated version, and it seems to have fixed the problem. 😞