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

Could not send notifications com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 404

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • Jenkins 2.479.2
      Bitbucket Branch Source 933.v7119e94e8f56
      Bitbucket Server v6.10.1

      In version 933.v7119e94e8f56 of the Bitbucket Branch Source plugin, the API commit status path has been modified, causing compatibility issues. Specifically, in the class com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient, the constant API_COMMIT_STATUS_PATH was changed from:

       private static final String API_COMMIT_STATUS_PATH = "/rest/build-status/1.0/commits{/hash}";

      to

       private static final String API_COMMIT_STATUS_PATH = API_BASE_PATH + "/projects/{owner}/repos/{repo}/commits/{hash}/builds";

      Reference Commit: 7ac886d4c364ae33e2c7e66a0c091777a92bdb8c

      Impact: After this change, Bitbucket Server returns a 404 Not Found error when attempting to send build status notifications using the updated URL. The previous API endpoint (/rest/build-status/1.0/commits) worked correctly. It appears that the fix referenced in JENKINS-47213 only works with newer versions of Bitbucket Server.

      Workaround: As a temporary solution, I’ve added a rewrite rule at the Nginx level to map requests from the new plugin URL back to the old one:
       

      location ~ ^/rest/api/1.0/projects/PROJECT_SHORT_NAME/repos/REPOSITORY_NAME/commits/([^/]+)/builds$ {
              # Rewrite the old URL to the new build-status API path
              rewrite ^/rest/api/1.0/projects/PROJECT_SHORT_NAME/repos/REPOSITORY_NAME/commits/([^/]+)/builds$ /rest/build-status/1.0/commits/$1 last;
          }

      Request: Please review and address the backward compatibility issue introduced by the new commit status path. Ensuring that the plugin supports older Bitbucket Server versions without requiring a manual rewrite rule would greatly improve usability and reduce maintenance overhead.

            nfalco Nikolas Falco
            vkonchin Valerii
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: