2

I'm getting Bad credentials for bucket trying to mount a GCS bucket using gcsfuse. What I've done:

  • Created a bucket "mac-gcs-fuse"
  • Created a service account in the same project with all storage permissions
  • Run the following command
gcsfuse --key-file=/Users/tiagogouvea/Keys/gcp-Storage-Pessoal-mac-gcs-fuse-service-account.json  mac-gcs-fuse ~/mac-gcs-fuse 

And I got:

Using mount point: /Users/tiagogouvea/mac-gcs-fuse
Opening GCS connection...
Opening bucket...
daemonize.Run: readFromProcess: sub-process: mountWithArgs: mountWithConn: setUpBucket: OpenBucket: Bad credentials for bucket "mac-gcs-fuse". Check the bucket name and your credentials. 

I try export GOOGLE_APPLICATION_CREDENTIALS too but with same error.

What I'm missing? I appreciate any help.

1 Answers1

2

You can try to run by Google Compute Engine instance with scope storage-full configured, then Cloud Storage FUSE can use the Compute Engine built-in service account.

Have you tried with the primitive privileges of the bucket?

Are you sure that your .json file is accessible form the context that you are requesting them?

Mario
  • 121
  • 2
  • Thanks @mario for replying! 1) I'm planning to use FUSE on my personal computer, to access some storage over a mounted point. I'm not planning to use on an Instance at this time. 3) The file is accessible, I even set a 777 to ensure that. :) I really appreciate your help. – Tiago Gouvêa Aug 13 '19 at 10:24
  • 2) How about the "primitive privileges"? I don't know about this. I'm already logged on terminal with my gcloud account, that has access to the bucket, but when I call the gcsfuse without the --key-file I got the same error "Bad credentials for bucket mac-gcs-fuse". I exported the GOOGLE_APPLICATION_CREDENTIALS on my terminal and it is there when I call "echo $GOOGLE_APPLICATION_CREDENTIALS". – Tiago Gouvêa Aug 13 '19 at 10:24
  • I replicate your issue in Cloud Shell and everything works fine, due to implicit Service Account login. Did you find any special instruction for OS X? – Mario Aug 13 '19 at 18:46
  • The primitive roles are the basic roles for the bucket, like Write Read... Maybe you can try to isolate the problem and review if its a system issue , or a authorization issue. Im continue reading about the OS X specifications. – Mario Aug 13 '19 at 18:49
  • I created a new service account, allowing just read and write storage objects, downloaded the json file and tested again, and got the same error: Bad credentials for bucket "mac-gcs-fuse". About the OSX, I already have a AWS storage using FUSE and works like expected. I don't know what to try now.. :( – Tiago Gouvêa Aug 15 '19 at 13:21
  • Try to assign the account as project owner, and re download the json file, in order to know if is a privileges issue. – Mario Aug 15 '19 at 18:44
  • Something really strange here. I created a new service-account, with read/write on storage, but, beeing the project owner, and, got the same error again: Bad credentials for bucket "mac-gcs-fuse". Check the bucket name and your credentials. – Tiago Gouvêa Aug 15 '19 at 19:22
  • Sorry for the misunderstood, assign the role of project owner to the service account please. – Mario Aug 15 '19 at 19:38
  • I did it. Just created a new account, with read/write on storage, and owner on project. – Tiago Gouvêa Aug 16 '19 at 14:31