gcsfuse mount exits with status 1
Asked Answered
R

5

11

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)

Ribband answered 9/1, 2016 at 23:57 Comment(0)
R
13

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

Ribband answered 10/1, 2016 at 20:8 Comment(4)
Great to hear that you’ve solved your issue! Can you please accept your own answer so that this question is marked as closed? Thanks!Luster
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. ThanksPlagiarize
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?Shipload
How to change the group write permissions?Aoudad
L
11

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
Lederer answered 1/8, 2019 at 14:52 Comment(1)
If using docker compose, add privileged: true in your definition of that particular container linkMalang
T
6

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

Touslesmois answered 26/8, 2022 at 11:18 Comment(0)
T
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
Tamra answered 1/11, 2022 at 14:34 Comment(0)
S
-1

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

Sharynshashlik answered 11/4, 2022 at 18:57 Comment(1)
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.Hummingbird

© 2022 - 2025 — McMap. All rights reserved.