0

I created a gcs bucket on https://console.cloud.google.com/storage/
and successfully mounted on an instance with gcsfuse, however, when I try to write to the mounted directory, it shows an Input/output error.

fuse_debug: Op 0x00000003        connection.go:395] <- LookUpInode (parent 1, name "test")
gcs: Req              0x1: <- StatObject("test/")
gcs: Req              0x2: <- StatObject("test")
gcs: Req              0x1: -> StatObject("test/") (31.355698ms): gcs.NotFoundError: googleapi: Error 404: Not Found, notFound
gcs: Req              0x2: -> StatObject("test") (51.589538ms): gcs.NotFoundError: googleapi: Error 404: Not Found, notFound
fuse_debug: Op 0x00000003        connection.go:476] -> Error: "no such file or directory"
fuse_debug: Op 0x00000004        connection.go:395] <- MkDir (parent 1, name "test")
gcs: Req              0x3: <- CreateObject("test/")
gcs: Req              0x3: -> CreateObject("test/") (13.513239ms): googleapi: Error 403: Insufficient Permission, insufficientPermissions
fuse_debug: Op 0x00000004        connection.go:476] -> Error: "CreateChildDir: googleapi: Error 403: Insufficient Permission, insufficientPermissions"
fuse: 2016/06/09 02:12:40.128885 *fuseops.MkDirOp error: CreateChildDir: googleapi: Error 403: Insufficient Permission, insufficientPermissions
V Y
  • 685
  • 10
  • 21

2 Answers2

1

Please run gcsfuse with --foreground (and perhaps --debug_fuse) to get some indication of what the error is when it happens.

jacobsa
  • 5,719
  • 1
  • 28
  • 60
  • I used these two options, there was no error on output of gcsfuse, Input/output error only happens when I wrote to the new mounted directory – V Y Jun 08 '16 at 00:19
  • 1
    Are you sure? `--debug_fuse` shows the response to each request from the kernel, and should indicate what operation failed along with an error message. (You should see all the successful operations too.) – jacobsa Jun 08 '16 at 12:25
  • I attached all command lines, there were no other error messages. – V Y Jun 08 '16 at 16:33
  • 1
    You forgot `--foreground`. Without that, stderr goes to `/dev/null`. – jacobsa Jun 09 '16 at 00:48
  • Yes, you are right ! with --foreground, when trying to make a directory 'test' I can see there are two errors, 404 and 403, but I don't know how to solve – V Y Jun 09 '16 at 02:28
1

It appears from the --foreground --debug_fuse output that you're using credentials that aren't allowed to write to the bucket. They are probably read-only (StatObject didn't return a 403, and gcsfuse checks at startup that it can list the bucket).

Try giving the docs about credentials a careful read. In particular, if you're getting credentials automatically on a Google Compute Engine VM, you probably forgot to create it with the storage-full scope.

jacobsa
  • 5,719
  • 1
  • 28
  • 60