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

Update GCP env var for credential path in Getting started guide #5082

Closed
wants to merge 1 commit into from

Conversation

draconteus
Copy link
Contributor

Hi,

Opening a new PR requested by @megan07. This issue needs further investigation.
TL;DR: Using GOOGLE_CLOUD_KEYFILE_JSON env var is not working for finding credential file

History can be found in: #5021

Cheers :)

@ghost ghost added the size/xs label Dec 5, 2019
@ghost ghost requested review from rileykarson December 5, 2019 15:06
@ghost ghost added the documentation label Dec 5, 2019
@rileykarson rileykarson requested a review from megan07 December 5, 2019 17:10
@megan07
Copy link
Contributor

megan07 commented Dec 5, 2019

Hi @draconteus! Thanks again for opening this new PR, I appreciate it. Are you going through the "Getting Started with the Google Provider" guide? If so, I've gone through those steps after clearing my environment variables. After running export GOOGLE_CLOUD_KEYFILE_JSON=path/to/creds.json, I have not had a problem. I did get the error when GOOGLE_CLOUD_KEYFILE_JSON was not set, so after you run the export command, could you do an echo $GOOGLE_CLOUD_KEYFILE_JSON and make sure it's the same path that you're using when you used GOOGLE_CREDENTIALS?

@draconteus
Copy link
Contributor Author

Yeah, I did that's how I recognised this problem. Also, it was the first thing to check if this env var was set properly. One thing that comes to my mind that I don't gave gsutil installed. I don't any internal working of gsutil or terraform, thus I don't know which tool checks the GOOGLE_CLOUD_KEYFILE_JSON var. But setting neither GOOGLE_CLOUD_KEYFILE_JSON nor GCLOUD_KEYFILE_JSON like it stated in the Docs (https://www.terraform.io/docs/providers/google/guides/provider_reference.html#credentials-1).

@pradeepbhadani
Copy link
Contributor

@megan07 @draconteus As per https://cloud.google.com/docs/authentication/getting-started, GOOGLE_APPLICATION_CREDENTIALS is used to provide the JSON Key for service account.

@draconteus
Copy link
Contributor Author

Ooo, okay, yeah I used service account's credentials. Thanks for finding this @pradeepbhadani!

@megan07
Copy link
Contributor

megan07 commented Dec 6, 2019

@draconteus , interesting. I'm not sure why GOOGLE_CLOUD_KEYFILE_JSON would not work or is throwing an error, since it follows the same codepath as GOOGLE_CREDENTIALS . If the file was in the wrong format it should still throw an error.
However, it looks like the issue is resolved, can we close?

@draconteus
Copy link
Contributor Author

Yeah, sure :)

@megan07
Copy link
Contributor

megan07 commented Dec 9, 2019

Thanks!

@megan07 megan07 closed this Dec 9, 2019
@ghost
Copy link

ghost commented Mar 28, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants