hudson.plugins.git.GitException: Command "git -c core.askpass=true fetch --tags --progress git@github.com:jenkinsci/jenkins.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

Jenkins JIRA | James Nord | 1 year ago
  1. 0

    If you specify an scm to use a specific credential in workflow if that credential can not be found I expect a error saying so - not a generic error from git. h2. Steps to reproduce 1. create a global credential "{color:#654982}SSH Username with private key{color}" in Jenkins configured for "{color:#654982}Global Access{color}" and provide it an id of "{color:#654982}github{color}" (and set up this key on github) 2. create a workflow with the following syntax {noformat} node() { deleteDir() // ensure workspace is fully clean checkout([$class: 'GitSCM', userRemoteConfigs: [[credentialsId: 'github', url: 'git@github.com:jenkinsci/jenkins.git']], branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanBeforeCheckout'], [$class: 'RelativeTargetDirectory', relativeTargetDir: 'jenkins']], submoduleCfg: []]) echo "hello there" } } {noformat} 3. run the workflow and verify it can clone correctly 4. change the credential from "{color:#654982}Global Access{color}" to "{color:#654982}System Access{color}" h2. expected results the workflow should fail saying can not locate credential with id "{color:#654982}githib{color}" h2. Actual Results workflow fails with the following: {noformat} Cloning the remote Git repository Cloning repository git@github.com:jenkinsci/jenkins.git > git init /home/jenkins/slave/workspace/automated_release/jenkinsci/jenkins # timeout=10 Fetching upstream changes from git@github.com:jenkinsci/jenkins.git > git --version # timeout=10 > git -c core.askpass=true fetch --tags --progress git@github.com:jenkinsci/jenkins.git +refs/heads/*:refs/remotes/origin/* ERROR: Error cloning remote repo 'origin' hudson.plugins.git.GitException: Command "git -c core.askpass=true fetch --tags --progress git@github.com:jenkinsci/jenkins.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1640) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1388) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:62) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:313) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:505) at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152) at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145) at hudson.remoting.UserRequest.perform(UserRequest.java:121) at hudson.remoting.UserRequest.perform(UserRequest.java:49) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) at ......remote call to linnux-slave(Native Method) at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1413) at hudson.remoting.UserResponse.retrieve(UserRequest.java:221) at hudson.remoting.Channel.call(Channel.java:778) at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:145) at sun.reflect.GeneratedMethodAccessor376.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:131) at com.sun.proxy.$Proxy70.execute(Unknown Source) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1003) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1043) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:83) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:73) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:49) at hudson.security.ACL.impersonate(ACL.java:213) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:47) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) {noformat} This error message does not actually tell you what is wrong.

    Jenkins JIRA | 1 year ago | James Nord
    hudson.plugins.git.GitException: Command "git -c core.askpass=true fetch --tags --progress git@github.com:jenkinsci/jenkins.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
  2. 0

    If you specify an scm to use a specific credential in workflow if that credential can not be found I expect a error saying so - not a generic error from git. h2. Steps to reproduce 1. create a global credential "{color:#654982}SSH Username with private key{color}" in Jenkins configured for "{color:#654982}Global Access{color}" and provide it an id of "{color:#654982}github{color}" (and set up this key on github) 2. create a workflow with the following syntax {noformat} node() { deleteDir() // ensure workspace is fully clean checkout([$class: 'GitSCM', userRemoteConfigs: [[credentialsId: 'github', url: 'git@github.com:jenkinsci/jenkins.git']], branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanBeforeCheckout'], [$class: 'RelativeTargetDirectory', relativeTargetDir: 'jenkins']], submoduleCfg: []]) echo "hello there" } } {noformat} 3. run the workflow and verify it can clone correctly 4. change the credential from "{color:#654982}Global Access{color}" to "{color:#654982}System Access{color}" h2. expected results the workflow should fail saying can not locate credential with id "{color:#654982}githib{color}" h2. Actual Results workflow fails with the following: {noformat} Cloning the remote Git repository Cloning repository git@github.com:jenkinsci/jenkins.git > git init /home/jenkins/slave/workspace/automated_release/jenkinsci/jenkins # timeout=10 Fetching upstream changes from git@github.com:jenkinsci/jenkins.git > git --version # timeout=10 > git -c core.askpass=true fetch --tags --progress git@github.com:jenkinsci/jenkins.git +refs/heads/*:refs/remotes/origin/* ERROR: Error cloning remote repo 'origin' hudson.plugins.git.GitException: Command "git -c core.askpass=true fetch --tags --progress git@github.com:jenkinsci/jenkins.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1640) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1388) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:62) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:313) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:505) at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152) at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145) at hudson.remoting.UserRequest.perform(UserRequest.java:121) at hudson.remoting.UserRequest.perform(UserRequest.java:49) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) at ......remote call to linnux-slave(Native Method) at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1413) at hudson.remoting.UserResponse.retrieve(UserRequest.java:221) at hudson.remoting.Channel.call(Channel.java:778) at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:145) at sun.reflect.GeneratedMethodAccessor376.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:131) at com.sun.proxy.$Proxy70.execute(Unknown Source) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1003) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1043) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:83) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:73) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:49) at hudson.security.ACL.impersonate(ACL.java:213) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:47) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) {noformat} This error message does not actually tell you what is wrong.

    Jenkins JIRA | 1 year ago | James Nord
    hudson.plugins.git.GitException: Command "git -c core.askpass=true fetch --tags --progress git@github.com:jenkinsci/jenkins.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
  3. 0

    in queue build will fail if the merge request is merged.

    GitHub | 2 years ago | young40
    hudson.plugins.git.GitException: Could not checkout null with start point 6172429b584b6c9604accce41aad674e91c9bbf4
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    I am not able to setup build using slave. It works fine when i run the same build on master

    Stack Overflow | 2 years ago
    hudson.plugins.git.GitException: Command "git -c core.askpass=true fetch --tags --progress <url> +refs/heads/*:refs/remotes/origin/*" returned status code 128: fatal: The remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed
  6. 0

    Git merge checking out impossible commits

    Google Groups | 2 years ago | Johannes Wienke
    hudson.plugins.git.GitException: Could not checkout master with start point 5af79d528388216aa25a24c27f0a16d8dc55bdb6

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. hudson.plugins.git.GitException

      Command "git -c core.askpass=true fetch --tags --progress git@github.com:jenkinsci/jenkins.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn()
    2. org.jenkinsci.plugins
      RemoteGitImpl$CommandInvocationHandler$1.call
      1. org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1640)
      2. org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1388)
      3. org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:62)
      4. org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:313)
      5. org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:505)
      6. org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152)
      7. org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145)
      7 frames
    3. Hudson :: Remoting Layer
      InterceptingExecutorService$1.call
      1. hudson.remoting.UserRequest.perform(UserRequest.java:121)
      2. hudson.remoting.UserRequest.perform(UserRequest.java:49)
      3. hudson.remoting.Request$2.run(Request.java:326)
      4. hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      4 frames
    4. Java RT
      Thread.run
      1. java.util.concurrent.FutureTask.run(FutureTask.java:266)
      2. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      3. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      4. java.lang.Thread.run(Thread.java:745)
      4 frames