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

GOOGLE_APPLICATION_CREDENTIALS doesn't work #177

Closed
molerus opened this issue Jul 7, 2016 · 4 comments
Closed

GOOGLE_APPLICATION_CREDENTIALS doesn't work #177

molerus opened this issue Jul 7, 2016 · 4 comments
Assignees

Comments

@molerus
Copy link

molerus commented Jul 7, 2016

It looks like process demonisation strips all env variables except for PATH and hence the child process cannot find it.

@JustDevNull
Copy link

Try to add to your script the following env variables and see if in that way it runs without problems, in my case I had problems with gsutil in crontab because it was unable to find the credentials, but with this it worked :

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/share/google/google-cloud-sdk/bin/
HOME=/root
BOTO_CONFIG="/root/.config/gcloud/legacy_credentials/your_service_account/.boto"

Take in mind that in the PATH env I have "/usr/local/share/google/google-cloud-sdk/bin/" because of my installation config, and you can find the ".boto" with a simple :

find / -name ".boto"

I hope I did not misinterpreted what you wanted to say.

@molerus
Copy link
Author

molerus commented Jul 8, 2016

I think your workflow follows different path of credential locations. You may look it up at

if filename := os.Getenv(envVar); filename != "" {

I was following the instructions found on https://cloud.google.com/storage/docs/gcs-fuse and set the environment variable GOOGLE_APPLICATION_CREDENTIALS, which for aforementioned reasons doesn't work. AFAICT GCSFuse used to do the mounting in the main process and required separate demonisation. This is how it worked on e.g. version 0.11.0 which obeys the variable. The recent versions do the mounting in the background by demonising the process but by doing so they strip out the variable in question so the advertised way of passing credentials doesn't work.

@jacobsa
Copy link
Contributor

jacobsa commented Jul 11, 2016

Your diagnosis makes sense to me, thanks. Will attempt to reproduce with an integration test and then fix.

@jacobsa jacobsa self-assigned this Jul 11, 2016
jacobsa added a commit that referenced this issue Jul 13, 2016
It was broken when gcsfuse was made to daemonize itself.

For #177.
@jacobsa
Copy link
Contributor

jacobsa commented Jul 13, 2016

This should be fixed in gcsfuse 0.18.3, which has just been released.

@jacobsa jacobsa closed this as completed Jul 13, 2016
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

3 participants