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

Bitbucket Plugin unable to parse Bitbucket webhook response json

    • 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");

          [JENKINS-28877] Bitbucket Plugin unable to parse Bitbucket webhook response json

          Charles DuBose created issue -
          Tony Lopez made changes -
          Summary Original: bitbucket can send webhook without user specified New: Bitbucket Plugin unable to parse Bitbucket webhook response json
          Félix Belzunce Arcos made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 163741 ] New: JNJira + In-Review [ 208877 ]
          Frieder Rick made changes -
          Resolution Original: Fixed [ 1 ]
          Status Original: Closed [ 6 ] New: Reopened [ 4 ]
          Justen Britain made changes -
          Environment Original: jenkins 1.617, bitbucket-plugin 1.1.0 New: Jenkins 1.617, bitbucket-plugin 1.1.0
          Jenkins 2.25, bitbucket-plugin 1.1.5
          Justen Britain made changes -
          Comment [ I don't see a 1.5, do you mean 1.1.5? I can confirm the bug replicates in that version as well. ]
          Justen Britain made changes -
          Attachment New: bb-server-4.9.1_payload.txt [ 34349 ]
          Frieder Rick made changes -
          Attachment New: bitbucket.hpi [ 36186 ]
          Jennifer Hofmeister made changes -
          Assignee New: Jennifer Hofmeister [ hjen ]
          Jennifer Hofmeister made changes -
          Assignee Original: Jennifer Hofmeister [ hjen ]

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

              Created:
              Updated:
              Resolved: