Triggering a build using the Queue API can cause deserialize error

XMLWordPrintable

    • Type: Suggestion
    • Resolution: Unresolved
    • None
    • Component/s: Triggers
    • None
    • 2
    • 3

      Issue Summary

      When triggering a build using the Queue API, if the body contains any unexpected JSON the system will attempt to deserialize it into an java.util.ArrayList and fail.

      This results in the build not executing. The body content is not required to trigger the build, so unexpected valid JSON should not cause the command to stop.

      Example: Using the Bitbucket server webhook to trigger builds without change detection.

      Steps to Reproduce

      1. POST to the Queue API with a valid JSON payload.

      Expected Results

      The server begins building the plan.

      Actual Results

      The server returns an error 400 with the following:

      {"message":"Can not deserialize instance of java.util.ArrayList out of VALUE_STRING token\n at [Source: org.apache.catalina.connector.CoyoteInputStream@47331eb5; line: 1, column: 2]","status-code":400}
      

      Nothing is shown in the bamboo log files.

      Workaround

      If you have control over the POST payload, ensure each value is in an array. E.g:

      {
           "bamboo.variable.1": ["somevalue"],
           "bamboo.variable.2": ["somevalue"]
      }
      

              Assignee:
              Unassigned
              Reporter:
              Edward
              Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated: