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

Bitbucket branch source doesn't trigger when webhook URL doesn't match config

XMLWordPrintable

      Due to a slightly odd environment, our Bitbucket server reports its own URL in a non-fully qualified manner ('tools/bitbucket' rather than 'tools.local.net/bitbucket'). Our Jenkins runs in a different domain ('.local2.net'), so must refer to Bitbucket by its fully qualified name.

      Up to version 2.0.2 Bitbucket branch source functioned as expected when webhooks were triggered in Bitbucket. As of 2.2.0 webhooks no longer trigger builds. I suspect that this is due to a mis-match in the URL configured in Jenkins and the value set in the data the webhook POSTs to Jenkins:

      POSTed webhook data
      {
          <snip> 
          "repository": {
              "fullName": "TEST/webhook-test",
              "links": {
                  "self": [
                      {
                          "href": "https://tools/bitbucket/projects/TEST/repos/webhook-test/browse"
                      }
                  ]
              },
              <snip>
          }
      }
      

      I can't test this behaviour on the 2.1.* releases due to JENKINS-42190, and the same behaviour occurs in the most recent release (2.2.7).

      So far as I can see no log messages are generated by the plugin when it drops the hook (no messages were found by a logger for 'com.cloudbees.jenkins.plugins.bitbucket' at log level ALL, and no entries in the main Jenkins log appear to be related).

      This can be worked-around by adding an entry for 'tools' in the /etc/hosts file on the master.

       

            Unassigned Unassigned
            wmacauley William Macauley
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: