[JIRA] (JENKINS-18834) Initial git fetch ignore prune settings
Title: Message Title Everett Toews commented on JENKINS-18834 Re: Initial git fetch ignore prune settings Mark Waite Thanks a lot for taking the time to confirm the bug and write a test. I should also have mentioned my current versions. They are: Jenkins: 2.176.2 Git: 3.10.0 Git client: 2.7.7 Unfortunately, specifying any Additional Behaviours on a pipeline doesn't work for us. We're using Jenkins with OpenShift and it automatically overwrites any such config changes. I see JGit referenced in a lot of issues relating to pruning. Is a possible workaround simply using the JGit plugin? Add Comment This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.150184.1374212631000.7823.1572815640263%40Atlassian.JIRA.
[JIRA] (JENKINS-18834) prune should be before fetch
Title: Message Title Everett Toews commented on JENKINS-18834 Re: prune should be before fetch Can confirm this is still an issue. If the git remote prune was performed before the fetch, this wouldn't be a problem. Following the same steps as packadal, I get this error in the console. OpenShift Build my-project/deploy-my-service-1786 from ssh://g...@bitbucket.example.com:7999/ui/my-service.git Checking out git ssh://g...@bitbucket.example.com:7999/ui/my-service.git into /var/lib/jenkins/jobs/my-project/jobs/my-project-deploy-my-service/workspace@script to read Jenkinsfile using credential my-project-bitbucket-jenkins-user > git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url ssh://g...@bitbucket.example.com:7999/ui/my-service.git # timeout=10 Fetching upstream changes from ssh://g...@bitbucket.example.com:7999/ui/my-service.git > git --version # timeout=10 using GIT_SSH to set credentials my-project-bitbucket-jenkins-user > git fetch --tags --progress ssh://g...@bitbucket.example.com:7999/ui/my-service.git +refs/heads/*:refs/remotes/origin/* ERROR: Error fetching remote repo 'origin' hudson.plugins.git.GitException: Failed to fetch from ssh://g...@bitbucket.example.com:7999/ui/my-service.git at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:894) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1161) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1192) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:120) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:144) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:293) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress ssh://g...@bitbucket.example.com:7999/ui/my-service.git +refs/heads/*:refs/remotes/origin/*" returned status code 1: stdout: stderr: From ssh://bitbucket.example.com:7999/ui/my-service * [new branch] automation/testpi-9 -> origin/automation/testpi-9 error: 'refs/remotes/origin/feature/foo' exists; cannot create 'refs/remotes/origin/feature/foo/bar' ! [new branch] feature/foo/bar -> origin/feature/foo/bar (unable to update local ref) error: some local refs could not be updated; try running 'git remote prune ssh://g...@bitbucket.example.com:7999/ui/my-service.git' to remove any old, conflicting branches at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2042) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1761) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$400(CliGitAPIImpl.java:72) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:442) at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:892) ... 8 more ERROR: Error fetching remote repo 'origin' ERROR: Maximum checkout retry attempts reached, aborting Finished: FAILURE
[JIRA] (JENKINS-18834) prune should be before fetch
Title: Message Title Everett Toews edited a comment on JENKINS-18834 Re: prune should be before fetch Can confirm this is still an issue. If the git remote prune was performed before the fetch, this wouldn't be a problem.Following the same steps as [~packadal], I get this error in the console.{code:java}OpenShift Build my-project/deploy-my-service-1786 from ssh://g...@bitbucket.example.com:7999/ui/my-service.gitChecking out git ssh://g...@bitbucket.example.com:7999/ui/my-service.git into /var/lib/jenkins/jobs/my-project/jobs/my-project-deploy-my-service/workspace@script to read Jenkinsfileusing credential my-project-bitbucket-jenkins-user > git rev-parse --is-inside-work-tree # timeout=10Fetching changes from the remote Git repository > git config remote.origin.url ssh://g...@bitbucket.example.com:7999/ui/my-service.git # timeout=10Fetching upstream changes from ssh://g...@bitbucket.example.com:7999/ui/my-service.git > git --version # timeout=10using GIT_SSH to set credentials my-project-bitbucket-jenkins-user > git fetch --tags --progress ssh://g...@bitbucket.example.com:7999/ui/my-service.git +refs/heads/*:refs/remotes/origin/*ERROR: Error fetching remote repo 'origin'hudson.plugins.git.GitException: Failed to fetch from ssh://g...@bitbucket.example.com:7999/ui/my-service.git at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:894) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1161) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1192) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:120) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:144) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:293) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429)Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress ssh://g...@bitbucket.example.com:7999/ui/my-service.git +refs/heads/*:refs/remotes/origin/*" returned status code 1:stdout: stderr: From ssh://bitbucket.example.com:7999/ui/my-service * [new branch] automation/testpi-9 -> origin/automation/testpi-9error: 'refs/remotes/origin/feature/foo' exists; cannot create 'refs/remotes/origin/feature/foo/bar' ! [new branch] feature/foo/bar -> origin/feature/foo/bar (unable to update local ref)error: some local refs could not be updated; try running 'git remote prune ssh://g...@bitbucket.example.com:7999/ui/my-service.git' to remove any old, conflicting branches at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2042) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1761) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$400(CliGitAPIImpl.java:72) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:442) at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:892) ... 8 moreERROR: Error fetching remote repo 'origin'ERROR: Maximum checkout retry attempts reached, abortingFinished: FAILURE{code}