Uploaded image for project: 'Red Hat 3scale API Management'
  1. Red Hat 3scale API Management
  2. THREESCALE-10087

Response body was given for HEAD request, but should be empty

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • System
    • None
    • False
    • None
    • False
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started

      In staging logs one can occasionally see:

      app error: Response body was given for HEAD request, but should be empty (Rack::Lint::LintError)

      It lacks from Bugsnag and I couldn't get a proper backtrace but looking at other nearby log lines from the same pod, I assume it is related to trying to respond with 404 to a HEAD request to a non-existing swagger docs.

      {
        "_index": "stg-saas-ocp.pods.system-app.20230825",
        "_type": "_doc",
        "_id": "MjkzMjIyMjItNGU4ZC00ZWQxLThhYjAtY2Y3ODVlOWU5N2I5",
        "_version": 1,
        "_score": null,
        "_source": {
          "@timestamp": "2023-08-25T09:00:57.370971330+00:00",
          "kubernetes": {
            "container_name": "system-app",
            "namespace_name": "3scale-saas",
            "pod_name": "system-app-6c55fb8888-q5qqf",
            "container_image": "REDACTED/3scale-amp2-system-rhel7:1.17.0-268",
            "container_image_id": "REDACTED/3scale-amp2-system-rhel7@sha256:cf99e474b335b4e7dced5aeca11abafb3a57e5279d1a6d9da81d675a8489113b",
            "pod_ip": "REDACTED",
            "host": "REDACTED"
          },
          "system_app": {
            "rails_id": "e5d0eb95-fa6f-4017-baee-523099871f34",
            "host": "REDACTED",
            "remote_addr": "REDACTED",
            "message": "ActionController::RoutingError (No route matches [HEAD] \"/swagger/spec.json\"):",
            "log_type": "rails"
          }
        },
        "fields": {
          "@timestamp": [
            "2023-08-25T09:00:57.370Z"
          ]
        },
        "sort": [
          1692954057370,
          117368
        ]
      }
      
      {
        "_index": "stg-saas-ocp.pods.system-app.20230825",
        "_type": "_doc",
        "_id": "MDQyODg5N2YtOTgwNy00ZTk5LTk0NzctMDU5NzUzZGFlOTFj",
        "_version": 1,
        "_score": null,
        "_source": {
          "@timestamp": "2023-08-25T09:00:57.372014999+00:00",
          "kubernetes": {
            "container_name": "system-app",
            "namespace_name": "3scale-saas",
            "pod_name": "system-app-6c55fb8888-q5qqf",
            "container_image": "REDACTED/3scale-amp2-system-rhel7:1.17.0-268",
            "container_image_id": "REDACTED/3scale-amp2-system-rhel7@sha256:cf99e474b335b4e7dced5aeca11abafb3a57e5279d1a6d9da81d675a8489113b",
            "pod_ip": "REDACTED",
            "host": "REDACTED"
          },
          "system_app": {
            "remote_addr": "REDACTED",
            "timestamp": "25/Aug/2023:09:00:57 +0000",
            "request": "HEAD /404 HTTP/1.1",
            "status_code": "404",
            "bytes": "34",
            "request_time": "0.0053",
            "log_type": "access"
          }
        },
        "fields": {
          "@timestamp": [
            "2023-08-25T09:00:57.372Z"
          ]
        },
        "sort": [
          1692954057372,
          117371
        ]
      }
      

      This doesn't seem to affect any normal use cases. My guess would be that cause is some outdated test cases or something. But is good to fix I assume so that 404 without payload is returned to HEAD requests.

              Unassigned Unassigned
              akostadi1@redhat.com Aleksandar Kostadinov
              Daria Mayorova
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: