gcsfuse reporting strange permission errors

98 views Asked by At

I'm trying to use a Google Cloud storage bucket as a mount in Ubuntu 23.04 on Google Cloud.

The command I'm running is:

/usr/bin/gcsfuse -o rw --uid 0 --gid 33 --dir-mode 770  --file-mode 770 {NAME OF BUCKET} /var/www/storage-bucket

0 is root. 33 is www-data. I'm just hard coding that for now. I could use --uid $(id -u www-data) --gid $(id -g www-data)

It mounts the bucket. But as root, I cannot make a folder. I get a permission denied.

It's permissions in bash look fine: drwxrwx--- 1 root www-data 0 Dec 13 23:00 storage-bucket/

If I change -o rw to -o allow_other I can "touch" a file. But then I get an error that I can't close the file. If I try to edit the file in nano or something, it will not save. I get a permission denied.

I didn't see anything in syslog other than it starting successfully.

Any ideas?

1

There are 1 answers

0
Chanpols On BEST ANSWER

Posting this as a community for the benefits of others.


As mentioned by @John Hanley:

By default, new Compute Engine instances are assigned read-only permission to Google Cloud Storage. Access Scopes 1) Check the VM Access Scopes in the Google Cloud web GUI. 2) Check that the assigned service account has the correct IAM role to write Cloud Storage.