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

Bitbucket Plugin unable to parse Bitbucket webhook response json

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • bitbucket-plugin
    • Jenkins 1.617, bitbucket-plugin 1.1.0
      Jenkins 2.25, bitbucket-plugin 1.1.5

      Trying to use the bitbucket hook and so far as I can tell, I guess that it is sending a JSON body without specifying a user. I wasn't able to retrieve the JSON that it was sending, but it seems like that field is not a guaranteed field.

      Error while serving http://104.236.89.214/bitbucket-hook/
      java.lang.reflect.InvocationTargetException
      ...
      Caused by: net.sf.json.JSONException: JSONObject["user"] not found.
      at net.sf.json.JSONObject.getString(JSONObject.java:2040)
      at com.cloudbees.jenkins.plugins.BitbucketHookReceiver.processPayload(BitbucketHookReceiver.java:104)
      at com.cloudbees.jenkins.plugins.BitbucketHookReceiver.doIndex(BitbucketHookReceiver.java:59)

      The offending line:
      String user = payload.getString("user");

        1. bb-server-4.9.1_payload.txt
          2 kB
          Justen Britain
        2. bitbucket.hpi
          233 kB
          Frieder Rick
        3. error.html
          16 kB
          Alvaro Arbaizar
        4. Screen Shot 2017-12-04 at 12.50.59.png
          283 kB
          Félix Belzunce Arcos
        5. Screen Shot 2017-12-05 at 15.14.27.png
          308 kB
          Félix Belzunce Arcos
        6. Screen Shot 2017-12-05 at 15.14.27.png
          308 kB
          Félix Belzunce Arcos
        7. Screen Shot 2017-12-05 at 15.15.17.png
          369 kB
          Félix Belzunce Arcos

            fbelzunc Félix Belzunce Arcos
            kayakyakr Charles DuBose
            Votes:
            24 Vote for this issue
            Watchers:
            44 Start watching this issue

              Created:
              Updated:
              Resolved: