jenkinsci / jenkinsci/workflow-multibranch-plugin
[JENKINS-46648] first build of a pull request fails with stderr: fatal: Couldn't find remote ref
- Dominant language
- Java
- Stars
- 87
- Forks
- 131
- PR merge metrics
- No merged PRs in 30d
Description
We configured the workflow multibranch plugin with the option to "Discover pull requests from origin". We've set this at both "current pull request revision" and "both". When a pull request is created in Bitbucket, Jenkins creates the folder and view for the pull request, but the first build always fails. It then works when manually triggered to build again.
Here is an example error message:
> git fetch --no-tags --progress https://bitbucket.athenahealth.com/scm/ANML/prediction-service-api.git +refs/pull-requests/12/from:refs/remotes/origin/PR-12
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git fetch --no-tags --progress https://bitbucket.athenahealth.com/scm/ANML/prediction-service-api.git +refs/pull-requests/12/from:refs/remotes/origin/PR-12" returned status code 128:
stdout:
stderr: fatal: Couldn't find remote ref refs/pull-requests/12/fromat org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1924)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1643)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:71)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:352)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:559)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1075)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1115)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:130)
at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:120)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:263)
at hudson.model.ResourceController.execute(ResourceController.java:97)
# at hudson.model.Executor.run(Executor.java:405)
---
Originally reported by rmyung, imported from: first build of a pull request fails with stderr: fatal: Couldn't find remote ref
Raw content of original issue
We configured the workflow multibranch plugin with the option to "Discover pull requests from origin". We've set this at both "current pull request revision" and "both". When a pull request is created in Bitbucket, Jenkins creates the folder and view for the pull request, but the first build always fails. It then works when manually triggered to build again.
Here is an example error message:
> git fetch --no-tags --progress https://bitbucket.athenahealth.com/scm/ANML/prediction-service-api.git +refs/pull-requests/12/from:refs/remotes/origin/PR-12
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git fetch --no-tags --progress https://bitbucket.athenahealth.com/scm/ANML/prediction-service-api.git +refs/pull-requests/12/from:refs/remotes/origin/PR-12" returned status code 128:
stdout:
stderr: fatal: Couldn't find remote ref refs/pull-requests/12/fromat org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1924)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1643)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:71)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:352)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:559)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1075)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1115)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:130)
at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:120)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:263)
at hudson.model.ResourceController.execute(ResourceController.java:97)
# at hudson.model.Executor.run(Executor.java:405)
- environment:
Bitbucket
Contributor guide
Assessment
This issue has not been assessed yet.