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

Bitbucket Plugin unable to parse Bitbucket webhook response json

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Component/s: bitbucket-plugin
    • Labels:
    • Environment:
      Jenkins 1.617, bitbucket-plugin 1.1.0
      Jenkins 2.25, bitbucket-plugin 1.1.5
    • Similar Issues:

      Description

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

        Attachments

          Activity

          kayakyakr Charles DuBose created issue -
          tonylopez1013 Tony Lopez made changes -
          Field Original Value New Value
          Summary bitbucket can send webhook without user specified Bitbucket Plugin unable to parse Bitbucket webhook response json
          fbelzunc Félix Belzunce Arcos made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 163741 ] JNJira + In-Review [ 208877 ]
          entfrickler Frieder Rick made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          bobthemagicman Justen Britain made changes -
          Environment jenkins 1.617, bitbucket-plugin 1.1.0 Jenkins 1.617, bitbucket-plugin 1.1.0
          Jenkins 2.25, bitbucket-plugin 1.1.5
          bobthemagicman 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. ]
          bobthemagicman Justen Britain made changes -
          Attachment bb-server-4.9.1_payload.txt [ 34349 ]
          entfrickler Frieder Rick made changes -
          Attachment bitbucket.hpi [ 36186 ]
          hjen Jennifer Hofmeister made changes -
          Assignee Jennifer Hofmeister [ hjen ]
          hjen Jennifer Hofmeister made changes -
          Assignee Jennifer Hofmeister [ hjen ]
          baizar Alvaro Arbaizar made changes -
          Attachment error.html [ 40476 ]
          fbelzunc Félix Belzunce Arcos made changes -
          Assignee Félix Belzunce Arcos [ fbelzunc ]
          fbelzunc Félix Belzunce Arcos made changes -
          heatzone87 Pim Jansen made changes -
          Comment [ [~fbelzunc] but same happens on Bitbucket Cloud right? So the issue is more on the receiving plugin side i believe? ]
          fbelzunc Félix Belzunce Arcos made changes -
          fbelzunc Félix Belzunce Arcos made changes -
          fbelzunc Félix Belzunce Arcos made changes -
          scm_issue_link SCM/JIRA link daemon made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          entfrickler Frieder Rick made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          scm_issue_link SCM/JIRA link daemon made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          asavanchuk Alaiksei Savanchuk made changes -
          Comment [ The same problem 
          net.sf.json.JSONException: JSONObject["user"] not found.
          Jenkins ver. 2.60.3

          Bitbucket Plugin 1.1.8

           

            ]

            People

            • Assignee:
              fbelzunc Félix Belzunce Arcos
              Reporter:
              kayakyakr Charles DuBose
            • Votes:
              24 Vote for this issue
              Watchers:
              43 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: