Peter Li
Peter Li

Reputation: 440

gcsfuse mount exits with status 1

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)

Upvotes: 11

Views: 17087

Answers (5)

Galuoises
Galuoises

Reputation: 3283

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

Upvotes: 0

mati kepa
mati kepa

Reputation: 3201

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

Upvotes: 6

pra-cloud
pra-cloud

Reputation: 1

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

Upvotes: -1

dbakiu
dbakiu

Reputation: 266

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

Upvotes: 13

Peter Li
Peter Li

Reputation: 440

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

Upvotes: 13

Related Questions