Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCS service account credential doesn't format correctly when using ENV var #9649

Closed
zakris-s opened this issue Oct 16, 2024 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@zakris-s
Copy link

Describe the bug

When using an environment variable for the GCS service account key JSON data Mimir pods that depend on that credential won't start with the error code err="invalid character 't' looking for beginning of value failed to create credentials from JSON.

To Reproduce

Steps to reproduce the behavior:

  1. Specify an ENV var contained GCS service account JSON data like this:
common:
  storage:
     backend: gcs
      gcs:
        service_account: |
          ${GCS_SA_VAR_NAME}
  1. Install Mimir via the helm chart

Expected behavior

Mimir will start normally and use the above VAR as the GCS credentials to access the bucket

Environment

  • Infrastructure: Kubernetes GKE
  • Deployment tool: Helm

Additional Context

Note: If I copy the ENV var from one of the pods and paste it in to the above config it works as expected.

@narqo narqo added helm and removed helm labels Oct 18, 2024
@narqo
Copy link
Contributor

narqo commented Oct 18, 2024

This looks similar to one outlined in #8704. Could you check if changing the config to one below fixes it?

common:
  storage:
    backend: gcs
      gcs:
        service_account: >-
          ${GCS_SA_VAR_NAME}

(note the >- to fold the new lines from the property's value).

@zakris-s
Copy link
Author

Yeah that is the issue I actually came from, and that solution does not work. Using '|' or '|-' to fold the lines also does not work for me.

@narqo narqo added the bug Something isn't working label Oct 22, 2024
@armandgrillet
Copy link
Contributor

Can you try

service_account: ${GCS_SA_VAR_NAME}

instead?

@zakris-s
Copy link
Author

Oddly enough when I deployed the HELM chart using argoCD the error went away. Although its important to note it only works if I provide the env var like this: (Note the '|' character is used for folding instead of ">-".

common:
  storage:
    backend: gcs
      gcs:
        service_account: |
          ${GCS_SA_VAR_NAME}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants