Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-20559

ISE when incorrect content-type used for organization creation through API

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False
    • NEW
    • 0
    • Endeavour
    • Low
    • None

      Description of problem:
      When I use an API call to create an organization and I specify an existing, but incorrect content-type (or I don't specify any at all), the call returns 500 Internal Server Error.

      Version-Release number of selected component (if applicable):
      Reproduced on Sat 6.14 snap 9.0, 10.0, but not 8.0.

      How reproducible:
      Deterministic

      Steps to Reproduce:
      1. # curl -uadmin:changeme -H 'Content-Type: application/json' -X POST https://$(hostname)/api/organizations -d '{"organization": {"name": "test1"}}'
      {"select_all_types":[],"description":null,"created_at":"2023-08-03 10:51:04 UTC"
      [...]
      2. # curl -uadmin:changeme -H 'Content-Type: text/html' -X POST https://$(hostname)/api/organizations -d '{"organization": {"name": "test2"}}'
      {
      "error":

      {"message":"Internal Server Error: the server was unable to finish the request. This may be caused by unavailability of some required service, incorrect API call or a server-side bug. There may be more information in the server's logs."}

      }
      3. # curl -uadmin:changeme -H 'Content-Type: text/html' -X POST https://$(hostname)/api/locations -d '{"location": {"name": "test3"}}'
      {
      "error":

      {"message":"Media type in 'Content-Type: text/html' is unsupported in API v2 for POST and PUT requests. Please use 'Content-Type: application/json'."}

      }

      Actual results:
      For correct content-type, the organization is created. For incorrect type on a location endpoint, a location is not created and the error is handled correctly. For incorrect type on an organization endpoint, ISE happens.

      Expected results:
      The same behavior as for locaiton.

      Additional info:
      Traceback attached.

            jira-bugzilla-migration RH Bugzilla Integration
            lhellebr@redhat.com Lukas Hellebrandt
            RH Bugzilla Integration RH Bugzilla Integration
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: