Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-72766

Declarative Pipeline implicit checkout fails with GitHub app credentials

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • git-client-plugin
    • None
    • All latest version as of writing. Controller runs on truenas scale.

      I uploaded the log that shows that I configured the github app as mentioned in the docs but the declarative checkout doesn't work, all other features work. I got it working by manually configuring GitSCM but it's a bad experience after doing so much setup work for the Github app. 

      How I fixed it: 
      options

      { skipDefaultCheckout true }

      stages {
      stage('Checkout') {
      steps

      { checkout([ $class: 'GitSCM', branches: [[name: '*/main']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[ credentialsId: 'ssh-github', url: 'git@github.com:rootitnow/rootstrap.git' ]] ]) }

      }

          [JENKINS-72766] Declarative Pipeline implicit checkout fails with GitHub app credentials

          Tanguille created issue -
          Tanguille made changes -
          Environment Original: All latest version as of writing. Controller runs on truenas scale. Unfortunately the description field doesn't work for me so I uploaded the log that shows that I configured the github app as mentioned in the docs but the declarative checkout doesn't work, all other features work. New: All latest version as of writing. Controller runs on truenas scale.
          Tanguille made changes -
          Description New: I uploaded the log that shows that I configured the github app as mentioned in the docs but the declarative checkout doesn't work, all other features work. I got it working by manually configuring GitSCM but it's a bad experience after doing so much setup work for the Github app. 

          How I fixed it: 
          options {
          skipDefaultCheckout true
          }

          stages {
          stage('Checkout') {
          steps {
          checkout([
          $class: 'GitSCM',
          branches: [[name: '*/main']],
          doGenerateSubmoduleConfigurations: false,
          extensions: [],
          submoduleCfg: [],
          userRemoteConfigs: [[
          credentialsId: 'ssh-github',
          url: 'git@github.com:rootitnow/rootstrap.git'
          ]]
          ])
          }
          }
          Mark Waite made changes -
          Component/s New: git-client-plugin [ 17423 ]
          Component/s Original: github-plugin [ 15896 ]
          Mark Waite made changes -
          Assignee Original: Kirill Merkushev [ lanwen ]

          Jordan added a comment - - edited

          I'm experiencing the same issue.  

           
          15:32:53 Started by user
          XXXX
          15:32:53 hudson.plugins.git.GitException: Command "git config remote.origin.url
          http://url
          " returned status code 128:15:32:53 stdout: 15:32:53 stderr: fatal: not in a git directory*15:32:53* 15:32:53 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2842)15:32:53 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2762)15:32:53 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2757)15:32:53 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:2051)15:32:53 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:2063)15:32:53 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.setRemoteUrl(CliGitAPIImpl.java:1662)15:32:53 at hudson.plugins.git.GitAPI.setRemoteUrl(GitAPI.java:180)15:32:53 at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:393)15:32:53 at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:219)15:32:53 at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:124)15:32:53 at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:71)15:32:53 at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:311)15:32:53 at hudson.model.ResourceController.execute(ResourceController.java:101)15:32:53 at hudson.model.Executor.run(Executor.java:442)15:32:53 [withMaven] downstreamPipelineTriggerRunListener - Failure to introspect build steps: java.io.IOException: RDH/TDExtract #935 did not yet start*15:32:53* [withMaven] downstreamPipelineTriggerRunListener - Failure to introspect build steps: java.io.IOException: RDH/TDExtract #935 did not yet start*15:32:53* Finished: FAILURE

           

           

          It seems as if i can't specify the repo from where to pull the jenkinsfile in the pipeline script

          Jordan added a comment - - edited I'm experiencing the same issue.     15:32:53 Started by user XXXX 15:32:53 hudson.plugins.git.GitException: Command "git config remote.origin.url http://url " returned status code 128: 15:32:53 stdout: 15:32:53 stderr: fatal: not in a git directory*15:32:53* 15:32:53 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2842) 15:32:53 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2762) 15:32:53 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2757) 15:32:53 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:2051) 15:32:53 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:2063) 15:32:53 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.setRemoteUrl(CliGitAPIImpl.java:1662) 15:32:53 at hudson.plugins.git.GitAPI.setRemoteUrl(GitAPI.java:180) 15:32:53 at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:393) 15:32:53 at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:219) 15:32:53 at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:124) 15:32:53 at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:71) 15:32:53 at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:311) 15:32:53 at hudson.model.ResourceController.execute(ResourceController.java:101) 15:32:53 at hudson.model.Executor.run(Executor.java:442) 15:32:53 [withMaven] downstreamPipelineTriggerRunListener - Failure to introspect build steps: java.io.IOException: RDH/TDExtract #935 did not yet start*15:32:53* [withMaven] downstreamPipelineTriggerRunListener - Failure to introspect build steps: java.io.IOException: RDH/TDExtract #935 did not yet start*15:32:53* Finished: FAILURE     It seems as if i can't specify the repo from where to pull the jenkinsfile in the pipeline script
          Jordan made changes -
          Priority Original: Minor [ 4 ] New: Major [ 3 ]
          Mark Waite made changes -
          Summary Original: Checkout returns returned status code 128 New: Declarative Pipeline implicit checkout fails with GitHub app credentials

          Mark Waite added a comment -

          jjitzchaki are you sure that you are using a GitHub App credential in your failure case? Are you sure that you're using an implicit checkout with a declarative Pipeline? Your failure message seems to be in a different location.

          Mark Waite added a comment - jjitzchaki are you sure that you are using a GitHub App credential in your failure case? Are you sure that you're using an implicit checkout with a declarative Pipeline? Your failure message seems to be in a different location.

          Jordan added a comment -

          I'm connecting to local Bitbucket actually.  But it turned out that I needed to uncheck light weight check out.  I'd liek to know why it was an issue but otherwise it works for me now.  Apologies for misunderstanding this issue.

          Jordan added a comment - I'm connecting to local Bitbucket actually.  But it turned out that I needed to uncheck light weight check out.  I'd liek to know why it was an issue but otherwise it works for me now.  Apologies for misunderstanding this issue.

            Unassigned Unassigned
            tanguille Tanguille
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: