Uploaded image for project: 'OpenShift Logging'
  1. OpenShift Logging
  2. LOG-8581

Duplicate case-variant 'Accept' and 'accept' headers in CLF lead to "media_type_header_exception" in Elasticsearch output

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • Logging 6.4.2
    • Log Collection
    • Incidents & Support
    • False
    • Hide

      None

      Show
      None
    • False
    • NEW
    • NEW
    • Bug Fix
    • Moderate

      Description of problem:

      Create CLF to forward logs to elasticsearch with custom headers:

        apiVersion: "observability.openshift.io/v1"
        kind: ClusterLogForwarder
        metadata:
          name: clf-eck-es
        spec:
          managementState: Managed
          outputs:
          - name: eck-es
            type: elasticsearch
            elasticsearch:
              authentication:
                password:
                  key: password
                  secretName: es-https
                username:
                  key: username
                  secretName: es-https
              headers:
                test: logging
                Accept: application/json
                accept: application/json
              index: "{.log_type||\"none\"}"
              url: https://elasticsearch-sample-es-http.elasticsearch-operator.svc:9200
              version: 8
            tls:
              ca:
                key: ca-bundle.crt
                secretName: es-https
          pipelines:
          - name: forward-to-external-es
            inputRefs:
            - infrastructure
            - audit
            outputRefs:
            - eck-es
          serviceAccount:
            name: logcollector 

      the collector pods raise below error:

      2026-01-20T02:32:07.774923Z ERROR vector::topology::builder: msg="Healthcheck failed." error=Unexpected status: 400 Bad Request component_kind="sink" component_type="elasticsearch" component_id=output_eck_es
      2026-01-20T02:32:08.054456Z ERROR sink{component_kind="sink" component_id=output_eck_es component_type=elasticsearch}: vector::sinks::elasticsearch::service: Response contained errors. error_code="http_response_400" response=Response { status: 400, version: HTTP/1.1, headers: {"x-elastic-product": "Elasticsearch", "content-type": "application/json", "content-length": "349"}, body: b"{\"error\":{\"root_cause\":[{\"type\":\"media_type_header_exception\",\"reason\":\"Invalid media-type value on headers [Accept]\"}],\"type\":\"media_type_header_exception\",\"reason\":\"Invalid media-type value on headers [Accept]\",\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"Incorrect header [Accept]. Only one value should be provided\"}},\"status\":400}" }
      2026-01-20T02:32:08.054588Z ERROR sink{component_kind="sink" component_id=output_eck_es component_type=elasticsearch}: vector::sinks::util::retries: Not retriable; dropping the request. reason="client-side error, 400 Bad Request: {\"error\":{\"root_cause\":[{\"type\":\"media_type_header_exception\",\"reason\":\"Invalid media-type value on headers [Accept]\"}],\"type\":\"media_type_header_exception\",\"reason\":\"Invalid media-type value on headers [Accept]\",\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"Incorrect header [Accept]. Only one value should be provided\"}},\"status\":400}" internal_log_rate_limit=true 

      In vector.toml:

      [sinks.output_eck_es.request]
      headers = {"Accept"="application/json","accept"="application/json","test"="logging"} 

      Version-Release number of selected component (if applicable):

      cluster-logging.v6.4.2

      How reproducible:

      Always

      Steps to Reproduce:

      Actual results:

      Collector pods keep reporting the errors and can't forward logs to ES.

      Expected results:

      No error in collector pods.

      Additional info:

              Unassigned Unassigned
              qitang@redhat.com Qiaoling Tang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: