Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-25039

Parse error should be reported as Bad Request

    XMLWordPrintableJSON

Details

    Description

      Any JSON errors encountered while parsing Add Service request should be reported as HTTP 400 Bad Request. Currently such errors result in HTTP 500 Server Error.

      <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
      <title>Error 500 Server Error</title>
      </head>
      <body><h2>HTTP ERROR 500</h2>
      <p>Problem accessing /api/v1/clusters/TEST/services. Reason:
      <pre>    Server Error</pre></p><h3>Caused by:</h3><pre>java.io.UncheckedIOException: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.util.HashSet` out of VALUE_STRING token
       at [Source: (String)&quot;{  &quot;operation_type&quot;: &quot;ADD_SERVICE&quot;,  &quot;components&quot;: &quot;asdf&quot;}&quot;; line: 1, column: 52] (through reference chain: org.apache.ambari.server.controller.AddServiceRequest[&quot;components&quot;])
      

      Attachments

        Issue Links

          Activity

            People

              adoroszlai Attila Doroszlai
              adoroszlai Attila Doroszlai
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h