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

PR builds stopped working

XMLWordPrintable

      After upgrading the Bitbucket Server Integration plugin from 4.0.0 to 4.1.4, pull requests started to fail on Multibranch Pipeline jobs.

      The error indicates that Jenkins cannot find the corresponding commit:

      13:31:06  ERROR: Checkout failed
      13:31:06  hudson.plugins.git.GitException: Command "git checkout -f b47595c059dfdd52e85ed638914892c06a9a425e" returned status code 128:
      13:31:06  stdout: 
      13:31:06  stderr: fatal: reference is not a tree: b47595c059dfdd52e85ed638914892c06a9a425e 

      Reverting to Bitbucket Server Integration 4.0.0 resolves the problem.

      I compared build logs from both versions of the plugin. When the older version (4.0.0) is used, the PR refspec gets added to the fetch command:

      git fetch --no-tags --force --progress – REDACTED.git +refs/heads/:refs/remotes/origin/ +refs/pull-requests/39/from:refs/remotes/origin/PR-39 

      However, this is not present with the newer version of the plugin:

      git fetch --no-tags --force --progress – REDACTED.git +refs/heads/:refs/remotes/origin/ 

      So the subsequent checkout cannot find the reference.

            Unassigned Unassigned
            jakub_krauz Jakub
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: