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

[Vector] Configuration error ‘error=redefinition of table’ when forwarding logs from different namespaces.

XMLWordPrintable

    • Logging (Core) - Sprint 215

      Logging 5.5 preview

      Description of problem:
      When a ClusterLogForwarder instance is created to forward logs from same log type and  forwarding from different namespaces to multiple log stores, the collector pods fail with Vector configuration error.

      Feb 21 09:26:18.244  INFO vector::app: Log level is enabled. level="info"
      Feb 21 09:26:18.244  INFO vector::sources::host_metrics: PROCFS_ROOT is unset. Using default '/proc' for procfs root.
      Feb 21 09:26:18.245  INFO vector::sources::host_metrics: SYSFS_ROOT is unset. Using default '/sys' for sysfs root.
      Feb 21 09:26:18.245  INFO vector::app: Loading configs. path=[("/etc/vector/vector.toml", Some(Toml))]
      Feb 21 09:26:18.248 ERROR vector::cli: Configuration error. error=redefinition of table `transforms.route_application_logs` for key `transforms.route_application_logs` at line 54 column 1
       

      How reproducible:

      Always

      Steps to reproduce the issue:
      1 Install the Cluster Logging and Elasticsearch 5.5 preview operator.
      2 Create a Cluster Logging instance with Vector as collector.
      3 Create a ClusterLogForwarder instance to forward logs from same log type and from multiple projects to different log stores.

      apiVersion: logging.openshift.io/v1
      kind: ClusterLogForwarder
      metadata:
        name: instance
        namespace: openshift-logging
      spec:
        outputs:
        - name: loki-server
          type: loki
          url: http://loki-server.loki-aosqe.svc:3100
        - name: kafka-server
          type: kafka
          url: tls://my-cluster-kafka-bootstrap.amq-aosqe.svc:9092/topic-logging-app
        inputs:
        - name: input-kafka
          application:
            namespaces:
            - project-kafka
        - name: input-loki
          application:
            namespaces:
            - project-loki
        - name: input-es
          application:
            namespaces:
            - project-es
        pipelines:
        - name: to-kafka
          inputRefs:
          - input-kafka
          outputRefs:
          - kafka-server
        - name: to-loki
          inputRefs:
          - input-loki
          outputRefs:
          - loki-server
        - name: to-es
          inputRefs:
          - input-es
          outputRefs:
          - default 

      4 Check the status and logs of the collector pods.

      NAME                                            READY   STATUS             RESTARTS        AGE
      collector-6rfws                                 1/2     CrashLoopBackOff   8 (2m28s ago)   18m
      
      oc logs collector-vplt2 -c collector
      Feb 21 09:36:38.297  INFO vector::app: Log level is enabled. level="info"
      Feb 21 09:36:38.298  INFO vector::sources::host_metrics: PROCFS_ROOT is unset. Using default '/proc' for procfs root.
      Feb 21 09:36:38.298  INFO vector::sources::host_metrics: SYSFS_ROOT is unset. Using default '/sys' for sysfs root.
      Feb 21 09:36:38.298  INFO vector::app: Loading configs. path=[("/etc/vector/vector.toml", Some(Toml))]
      Feb 21 09:36:38.302 ERROR vector::cli: Configuration error. error=redefinition of table `transforms.route_application_logs` for key `transforms.route_application_logs` at line 54 column 1

      5 Extract and check the Vector config.

      oc extract secret/collector-config --confirm
      
      From the generated Vector config:
      [transforms.route_application_logs]
      type = "route"
      inputs = ["application"]
      route.input-kafka = '(.kubernetes.pod_namespace == "project-kafka")'
      [transforms.route_application_logs]
      type = "route"
      inputs = ["application"]
      route.input-loki = '(.kubernetes.pod_namespace == "project-loki")'
      [transforms.route_application_logs]
      type = "route"
      inputs = ["application"]
      route.input-es = '(.kubernetes.pod_namespace == "project-es")'

              vimalkum@redhat.com Vimal Kumar
              rhn-support-ikanse Ishwar Kanse
              Ishwar Kanse Ishwar Kanse
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: