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

An inner error is swallowed

XMLWordPrintable

    • False
    • False
    • NEW
    • OBSDA-7 - Adopting Loki as an alternative to Elasticsearch to support more lightweight, easier to manage/operate storage scenarios
    • VERIFIED
    • Logging (LogExp) - Sprint 214

      I was following `Hacking on Loki Operator on OpenShift`
      https://github.com/grafana/loki/blob/main/operator/docs/hack_loki_operator.md#hacking-on-loki-operator-on-openshift

      and accidentally applied `hack/lokistack_dev.yaml` rather than `hack/lokistack_gateway_dev.yaml`.

      I saw the following errors in the operator's log:

      {"_ts":"2022-02-13T09:33:52.200433142Z","_level":"0","_component":"loki-operator","_message":"begin building manifests","event":"createOrUpdate","lokistack":{"Namespace":"openshift-logging","Name":"lokistack-dev"}}
      {"_ts":"2022-02-13T09:33:52.20103425Z","_level":"0","_component":"loki-operator","_message":"failed to build manifests","_error":{"cause":{"Name":"gateway-rbac.yaml","Err":{}},"msg":"failed to create loki gateway rbac configuration"},"event":"createOrUpdate","lokistack":{"Namespace":"openshift-logging","Name":"lokistack-dev"}}
      {"_ts":"2022-02-13T09:33:52.201098648Z","_level":"0","_component":"loki-operator_controller-runtime_manager_controller_lokistack","_message":"Reconciler error","_error":{"cause":{"Name":"gateway-rbac.yaml","Err":{}},"msg":"failed to create loki gateway rbac configuration"},"name":"lokistack-dev","namespace":"openshift-logging"}

      and the inner error cause is empty:

       

       

      {"cause":{"Name":"gateway-rbac.yaml","Err":{}}

       

       

      When I debugged the operator in GoLand, the actual error is revealed:

      template: gateway-rbac.yaml:1:16: executing "gateway-rbac.yaml" at <.Stack.Tenants.Mode>: nil pointer evaluating *v1beta1.TenantsSpec.Mode

      https://github.com/grafana/loki/blob/e19c5863eaaeb96d4de20a5a2e93061ec7e74c6f/operator/internal/manifests/internal/gateway/build.go#L56

       

              sasagarw@redhat.com Sashank Agarwal (Inactive)
              rschaffe@redhat.com Ronen Schaffer (Inactive)
              Kabir Bharti Kabir Bharti
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: