gcsfs: gcsfs can't access google storage file, switches to anon user
I am trying to read a csv file present in gs bucket directly into dataframe.
I used gcloud auth login to authorize account. But when I try to use gcsfs it thorws:
gcsfs.utils.HttpError: Anonymous caller does not have storage.objects.list access to <my-bucket>
Now I ca list/download my files using gsutil. I can also list these files by passing adc file as token to fs=gcsfs.GCSFileSystem(token='adc.json'). My issue is how do I set it as default. Is there a particular location where I put this file. I couldn’t find anything in docs.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (7 by maintainers)
#255 should fix this issue.
Following code now works just fine:
FYI, to use default GCP authentication fallback mechanism you can use following:
See here for how google.auth tries to read your credentials. Enabling application-default worked for me:
gcloud auth application-default login