0

I have created Google Cloud Storage Bucket and mounted it to my VM using:
gcsfuse my-bucket /path/to/mount/point
When I type df -H its listed as mounted filesystem.
I have the following issue:

If I upload file to the bucket using the GCP web console I can see it from the VM. If I try to create a directory however from the VM to the mounted file system mkdir /path/to/mount/point/test it says:

mkdir: cannot create directory ‘/path/to/mount/point/test’: Input/output error
user51
  • 8,843
  • 21
  • 79
  • 158
John
  • 329
  • 1
  • 20
  • I think it permission problem , see https://serverfault.com/questions/750640/permission-errors-using-gcsfuse-as-nonroot-user-on-google-compute-instance – howie Mar 28 '19 at 06:10
  • In the post they get "Permission denied" while I get Input/output error. I also think it might be because of permissions, but cannot figure out why. I mount it with "gcsfuse -o allow_other -file-mode=777 -dir-mode=777 XXX /var/data" and when I "stat /var/data" it seems to be 777 indeed. The bucket permissions in the GCP console are set to "object-level and bucket-level permissions" as by default and I have given user project-XXX@storage-transfer-service.iam.gserviceaccount.com Storage Owner permissions. Still, I can list, but I cannot write data to the mounted filesystem. – John Mar 28 '19 at 12:07
  • try to add --debug_gcs --debug_fuse after gcsfuse to get more information – howie Mar 28 '19 at 12:37

2 Answers2

1

I found the cause. I enabled the debug options as others suggested. Thank you. Unfortunately the logs did not tell me much. Fortunately I had one more VM and I tested there and it worked fine (mount + read/write to bucket). I understood its not the permissions on the bucket side. The VM was created with "Allow default access" which gives readonly to "Storage". I granted read/write to store. One can specify also "Allow full access to all Cloud APIs" although its better not to grant all permissions if you do not need them.

John
  • 329
  • 1
  • 20
0

Try to use following command,and it will show more information.

gcsfuse --foreground --debug_gcs --debug_http \
        --debug_fuse --debug_invariants \
        --key-file=/src/gcloud_service_account.json \
        my-bucket /path/to/mount/point

You might see such error message

"code": 403, "message": "Access Not Configured. The API (Cloud Storage JSON API) is not enabled for your project. Please use the Google Developers Console to update your configuration."

If so , you need to enable this API for this instance.

howie
  • 2,587
  • 3
  • 27
  • 43