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

Error connecting to read only bucket #320

Open
kylemcdonald opened this issue Mar 14, 2019 · 0 comments

Comments

@kylemcdonald
Copy link

commented Mar 14, 2019

My personal user account has read-only access to a bucket. When I run gcsfuse -o ro <bucket name> <mount directory> I get this error:

Using mount point: <mount directory>
Opening GCS connection...
Opening bucket...
daemonize.Run: readFromProcess: sub-process: mountWithArgs: mountWithConn: setUpBucket: OpenBucket: Bad credentials for bucket "<bucket name>". Check the bucket name and your credentials.

I'm sure that I am authorized and the bucket name is correct because I can run gsutil ls gs://<bucket name> or gsutil cp gs://<bucket name>/<filename> . and copy a file.

I am running these commands inside a GCE instance that is in a different cloud project than the bucket I am trying to access.

I tried to explicitly set my personal authorized key by adding --key-file ~/.config/gcloud/legacy_credentials/<my email address>/adc.json but the output is a different error:

...
Opening GCS connection...
daemonize.Run: readFromProcess: sub-process: mountWithArgs: getConn: newTokenSourceFromPath: JWTConfigFromJSON: google: read JWT from JSON credentials: 'type' field is "authorized_user" (expected "service_account")

I was able to use gcsfuse to mount a bucket in the same project that I have read/write access to.

I was not able to use gcsfuse to mount a bucket in another project that I have read/write access to. But when I created a read-only service account for that project, and passed that service account json to via --key-file I was able to successfully mount the other bucket.

So it seems the issue here is something about gcsfuse not correctly using my personal account that I authorized via gcloud auth login. gsutil seems to be using it correctly.

If I do something terrible and just modify the adc.json file to say service_account instead of authorized_user then gcsfuse completes but the directory doesn't really work:

$ gcsfuse -o ro --key-file ~/adc-modified.json <bucket name> <folder name>
Using mount point: <folder name>
Opening GCS connection...
Opening bucket...
Mounting file system...
File system has been successfully mounted.
$ ls <folder name>
ls: reading directory '<folder name>': Input/output error

Update: I was able to get a service account for this bucket from the same person who gave me access initially, but it would be better if I could use my personal account in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.