gcsfuse does not mount google storage bucket on startup, but does when called manually: GAE, flexible environment, custom runtime

2,611 views
Skip to first unread message

gu...@genotek.ru

unread,
Sep 26, 2017, 9:05:17 AM9/26/17
to Google App Engine
I am running a gcsfuse mount command in a startup script in my custom runtime docker, which fails with 

Mounting file system...
Using mount point: /var/www/html/mount-point
Opening GCS connection...
Opening bucket...
daemonize.Run: readFromProcess: sub-process: mountWithArgs: mountWithConn: Mount: mount: running fusermount: exit status 1
stderr:
fusermount: failed to open /dev/fuse: Operation not permitted

however, ssh-ing into instance and executing the same script manually works. Manual startup is not acceptable since the instances are brought up and down by google at will.

Has anybody solved this problem?



This is my script:

export GOOGLE_APPLICATION_CREDENTIALS=/etc/gcloud/service-account.json
while :do FILE="" DIR="/var/www/html/mount-point"# init# look for empty dirif [ "$(ls -A $DIR)" ]; then echo "$DIR is mounted. Exit." breakelse echo "$DIR is not mounted. Trying to mount" gcsfuse -o rw -o allow_other --implicit-dirs --dir-mode 777 --file-mode 777 bucket_id /var/www/html/mount-pointweb/imgfi sleep 10 echo "Press [CTRL+C] to stop.."done Thanks.

Yannick (Cloud Platform Support)

unread,
Sep 26, 2017, 12:32:17 PM9/26/17
to Google App Engine
I believe that the docker image needs to be run at a higher level of privilege to allow for that mounting, which is not possible using App Engine Flex.

Is there a specific reason you want to mount a GCS bucket onto an App Engine instance? You should have no trouble accessing it using the client libraries.

gu...@genotek.ru

unread,
Sep 26, 2017, 1:00:59 PM9/26/17
to Google App Engine
1. I can run gcsfuse manually, without --privileged mode.
2. I am moving an existing application, which has a lot of disk access in various places. Moreover, it uses a number of third party modules that have their own disk io. Re-writing all that with client libraries is not feasible.

Yannick (Cloud Platform Support)

unread,
Sep 27, 2017, 3:55:42 PM9/27/17
to Google App Engine
Cloud Storage FUSE being an open source solution, I believe you might have better luck receiving advice and support on Serverfault as explained in the connector's Github page.
Reply all
Reply to author
Forward
0 new messages