9

trying to use gcsfuse, but when I run

gcsfuse <bucket> /target/dir

I keep getting this error

daemonize.Run: readFromProcess: sub-process: mountWithArgs: mountWithConn: Mount: mount: fusermount: exit status 1

I'm doing this from a GCE instance with full API access permissions to Google Cloud services

The folder exists and I'm in the fuse group.

I tried running with all the debug switches, but they reveal nothing helpful

> gcsfuse --uid "33" --gid "33" --debug_fuse --debug_gcs --debug_http --debug_invariants bucket-name /target/dir
Using mount point: /target/dir
Opening GCS connection...
Opening bucket...
Mounting file system...
daemonize.Run: readFromProcess: sub-process: mountWithArgs: mountWithConn: Mount: mount: fusermount: exit status 1

version info: gcsfuse version 0.15.0 (Go version go1.5.2)

Peter Li
  • 410
  • 1
  • 3
  • 13

5 Answers5

12

my /target/dir was owned by www-data:fuse, but the group didn't have write permission on the directory before mounting.

Peter Li
  • 410
  • 1
  • 3
  • 13
  • 1
    Great to hear that you’ve solved your issue! Can you please [accept your own answer](http://blog.stackoverflow.com/2009/01/accept-your-own-answers/) so that this question is marked as closed? Thanks! – Misha Brukman Jan 12 '16 at 22:59
  • 1
    I am getting the same error from datalab. i chmod a+w target/dir and still getting the same error. any idea how to avoid that error when mounting a bucket to datalab. Thanks – eilalan Jan 23 '18 at 16:24
  • 2
    It'd sure help if gcsfuse printed an error message that helped with problem solving. Are you up for filling this as an issue on GitHub? – Jerry101 Jun 25 '19 at 16:52
  • 1
    How to change the group write permissions? – Max FH Apr 14 '21 at 14:06
10

I had the same issue, as I was trying to mount a folder on a docker container. However, there it turned out to be that the container needs to run in privileged mode in order for gcsfuse to work.

docker --privileged docker-image-name

The above command works fine. Alternatively, if anyone is using kubernetes, the security context needs to be specified as follows:

  containers:
  - name: application-name
    securityContext:
      privileged: true
dbakiu
  • 238
  • 4
  • 8
  • 1
    If using docker compose, add `privileged: true` in your definition of that particular container [link](https://docs.docker.com/compose/compose-file/compose-file-v3/#domainname-hostname-ipc-mac_address-privileged-read_only-shm_size-stdin_open-tty-user-working_dir) – Luigolas Dec 07 '22 at 10:10
3

I got very same error message but solution was rather different. The principal ServiceAccount was missing permission to this bucket

BUT

I was able to find it out when running following debug flags in command

gcsfuse --foreground --debug_fuse --debug_fs --debug_gcs --debug_http -o nonempty  bucket_name /local/mount/folder

gcsfuse version 0.41.6 (Go version go1.18.4) | Centos7

mati kepa
  • 2,543
  • 19
  • 24
0

In my case I found that although the mount folder has read/write permission both for user and group, some subfolders didn't have write permission for the group. This happened because these folder were mounted in a docker container.

For this case just add group permission with

sudo chmod g+w /mnt/folder/mysubfolder

However, sometimes you cannot mount the bucket as it's just that you need to be root user; this happens if you switch off a VM. In this case just access as root and mount the bucket:

sudo -sH
sudo gcsfuse --uid $(id -u) --gid $(id -g) --dir-mode 775 --file-mode 775 -o allow_other mybucket /mnt/myfolder
Galuoises
  • 2,630
  • 24
  • 30
-1

Hey Please clear the mount folder inside that directory file should be not visible otherwise it won't work

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 11 '22 at 21:07