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

Thanos Store unable to use GCS auth settings in newer versions #1629

Closed
analogpixel opened this issue Oct 11, 2019 · 2 comments
Closed

Thanos Store unable to use GCS auth settings in newer versions #1629

analogpixel opened this issue Oct 11, 2019 · 2 comments

Comments

@analogpixel
Copy link

analogpixel commented Oct 11, 2019

Google Cloud Storage

In older versions of thanos/store (v0.3.2) I was able to use my google json auth file to authenticate to the google bucket. In version v0.6.0, I now get the error message:

level=error ts=2019-10-11T01:02:46.003731179Z caller=main.go:184 err="store command failed: create bucket client: create GCS client: failed to create credentials from JSON: invalid character '/' looking for beginning of value"

relevant kubernetes config

      image: improbable/thanos:v0.6.0
      ...

        args:
        - store
        - --log.level=debug
        - --data-dir=/data
        - --index-cache-size=500MB
        - --chunk-pool-size=500MB
        - --objstore.config-file=/etc/thanos-bucket/bucket-config.yaml

/etc/thanos-bucket/bucket-config.yaml

type: GCS
config:
  bucket: "my-thanos-bucket"
  service_account: "/etc/thanos-bucket/thanos-user.json"

The only thing that I change the causes it to break is the thanos version.

@squat
Copy link
Member

squat commented Oct 11, 2019

Hi @analogpixel,
The service_account field expects the user to provide an inline service account, e.g.

...
service_account: |-
{...}

See [0] for more details.

If you want to provide a file name rather than inline the file in the configuration, then you only need to specify the bucket field and provide the GOOGLE_APPLICATION_CREDENTIALS environment variable to Thanos. See [1] for more details.

Note: this functionality was added in 0.4.0 [2] in PR #963.

[0] https://github.com/thanos-io/thanos/blob/master/docs/storage.md#using-inline-a-service-account
[1] https://github.com/thanos-io/thanos/blob/master/docs/storage.md#using-google_application_credentials
[2] https://github.com/thanos-io/thanos/blob/master/CHANGELOG.md#v040---2019053

@analogpixel
Copy link
Author

Thanks, I just inlined the file and it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants