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

InvalidBucketName error when logs are sent to multiple buckets on STS flow

XMLWordPrintable

    • Log Storage - Sprint 249, Log Storage - Sprint 250

      Description:

      InvalidBucketName error when sending logs to multiple s3 buckets for AWS STS cluster. The S3 url generated in the config is incorrect.

      Logs:

      level=info ts=2024-02-13T10:33:00.115440855Z caller=flush.go:167 msg="flushing stream" user=infrastructure fp=7206bea581393703 immediate=true num_chunks=1 labels="{kubernetes_container_name=\"marketplace-operator\", kubernetes_host=\"<hidden>.us-east-2.compute.internal\", kubernetes_namespace_name=\"openshift-marketplace\", kubernetes_pod_name=\"marketplace-operator-5f9ccc4889-k4bxm\", log_type=\"infrastructure\"}"
      level=error ts=2024-02-13T10:33:00.164985624Z caller=flush.go:143 org_id=infrastructure msg="failed to flush" err="failed to flush chunks: store put chunk: InvalidBucketName: The specified bucket is not valid.\n\tstatus code: 400, request id: 5TF6RSPD1EZNJEP5, host id: <hidden>=, num_chunks: 1, labels: {kubernetes_container_name=\"marketplace-operator\", kubernetes_host=\"<hidden>.us-east-2.compute.internal\", kubernetes_namespace_name=\"openshift-marketplace\", kubernetes_pod_name=\"marketplace-operator-5f9ccc4889-k4bxm\", log_type=\"infrastructure\"}"
      

      config:

      ...
      common:
        storage:
          s3:
            s3: "s3://us-east-1/kbharti-sts1,kbharti-sts2" (Incorrect URL)
            s3forcepathstyle: false
        compactor_grpc_address: logging-loki-compactor-grpc.openshift-logging.svc.cluster.local:9095
      ....

      Version: loki-operator.v5.9.0 

      How reproducible: Always

      Steps to Reproduce:
      a) Deploy Loki in STS mode with role_arn
      b) Create bucket secret with multiple s3 buckets.

      oc -n openshift-logging create secret generic "logging-loki-storage-secret" \
        --from-literal=bucketnames="<bucket1>,<bucket2>" \
        --from-literal=region="$(aws configure get region)"

      c) Create LokiStack using secret created on Step 2
      d) Send logs to Loki

      Actual results: InvalidBucketName error on Loki index gateway and ingester components.

      Expected results: Logs to be sent successfully and no error on Loki components.

      Additional Info:
      Marking the LokiStack as Unmanaged and changing the configuration as below works as expected.

      ...
      common:
        storage:
          s3:
            s3: "s3://us-east-1/"
            bucketnames: "kbharti-sts1,kbharti-sts2""
            s3forcepathstyle: false
      ....

            rojacob@redhat.com Robert Jacob
            rhn-support-kbharti Kabir Bharti
            Kabir Bharti Kabir Bharti
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: