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

Propagate error data from services by foreman_rh_cloud request forwarder

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • 6.18.z, 6.19.0
    • None
    • RH Cloud
    • 2
    • False
    • Proton Prioritized Backlog
    • sat-proton
    • None
    • None
    • None
    • Manual

      Description of Problem

      The cloud request forwarder currently re-formats errors (non 200s HTTP responses) into its own construction, double-escaping the error coming from the service. The request forwarder should respond with the same response as the response from the service it forwards the request message to.

      How reproducible

      Always

      Steps to Reproduce

      1. Send a request to a service that returns a non-200 HTTP response, for example: `/insights_cloud/api/vulnerability/v1/systems/00000000-0000-0000-0000-000000000000`

      Actual Behavior

      The response is re-formatted and double-escaped, like the following example:

      {
        "message": "Cloud request failed",
        "error": "{\n  \"errors\": [\n    {\n      \"detail\": \"inventory_id must exist and inventory_id must be visible to user\",\n      \"status\": \"404\"\n    }\n  ]\n}\n",
        "headers": {
      
        },
        "response": "{\n  \"errors\": [\n    {\n      \"detail\": \"inventory_id must exist and inventory_id must be visible to user\",\n      \"status\": \"404\"\n    }\n  ]\n}\n"
      }
      

      Expected Behavior

      The request forwarder should return the response from the service as is.

      Business Impact / Additional info

      Frontend might not be able to properly process the error if doublewrapped.

              Unassigned Unassigned
              vkrizan1@redhat.com Viliam Krizan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: