0

I recreated a job to be a Multibranch pipeline, so I could better isolate the changes being tested from the prod build. However, directly after changing it, with no changes to the Jenkinsfile, I'm getting the below error

hudson.plugins.git.GitException: Command "git checkout -f 33975bbbdaeb7c6f0461f3100f6d092fa955c4de" returned status code 128

If I go back and run it in the old job, it runs without an issue, it is just in the multibranch version of the job. Doesn't matter what branch I run it against either.

The code in question that's failing is a second checkout (the Jenkinsfile is stored in another repo from this bit).

checkout([
  $class: 'GitSCM',
  branches: [[name: '*/master']],
  extensions: scm.extensions + [
  [
    $class: 'RelativeTargetDirectory', 
    relativeTargetDir: 'sw'
  ],
  [
    $class: 'CloneOption', 
    depth: 1, 
    noTags: false, 
    reference: '', 
    shallow: true, 
    timeout: 30
  ] 
  ], 
  userRemoteConfigs: [[
    credentialsId: "someCred", 
    url: 'ssh://git@some.git/repo/foo'
  ]]
])

It's a declarative pipeline

Alistair Hardy
  • 397
  • 1
  • 4
  • 16
  • Please provide more information about your multibranch pipeline and the Jenkinsfile. – Matthias Dec 16 '20 at 20:24
  • Updated main body @Matthias – Alistair Hardy Dec 17 '20 at 11:19
  • 1
    In multi-branch pipelines, you don't state your branch explicitly. This would defy the purpose. Try simply `checkout scm`. – MaratC Dec 17 '20 at 11:43
  • @MaratC this is pulling in another repo that is separate from where the jenkinsfile is. It's this repo that's being edited. When it's not running on the master branch, it pulls in from a pre-prod instance of BitBucket that is used for testing updates etc. So explicitly calling in the master branch in this case is fine. – Alistair Hardy Dec 17 '20 at 15:24
  • Please provide the exception stacktrace. Also check the build log and the Scan Multibranch Pipeline Log. There might be another hint about the cause. – Matthias Dec 17 '20 at 16:41

0 Answers0