Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot read compressed file #165

Closed
joshk0 opened this issue Mar 10, 2016 · 1 comment
Closed

cannot read compressed file #165

joshk0 opened this issue Mar 10, 2016 · 1 comment

Comments

@joshk0
Copy link

joshk0 commented Mar 10, 2016

Version: gcsfuse 0.17.0 with --debug_gcs, --debug_fuse, --debug_invariants

Steps to reproduce:

  1. Create a file 'data' of any size (I used 5MB of /dev/urandom.) Copy it to a bucket using 'gsutil cp -Z data gs://somebucket/compressed'
  2. For comparison, copy it as uncompressed: 'gsutil cp data gs://somebucket/not_compressed'
  3. Start gcsfuse rooted at somebucket.
  4. Attempt to open/cat not_compressed from the mounted filesystem. Observe that the data is retrieved
  5. Attempt to open/cat compressed from the mounted filesystem. Observe that this occurs:
gcsfuse: fuse_debug: Op 0x00000067        connection.go:474] -> OK
gcsfuse: fuse_debug: Op 0x00000068        connection.go:395] <- LookUpInode (parent 2, name "toodles")
gcsfuse: fuse_debug: Op 0x00000068        connection.go:474] -> OK
gcsfuse: fuse_debug: Op 0x00000069        connection.go:395] <- LookUpInode (parent 2, name "toodles")
gcsfuse: fuse_debug: Op 0x0000006a        connection.go:395] <- ForgetInode (inode 11)
gcsfuse: fuse_debug: Op 0x0000006b        connection.go:395] <- ForgetInode (inode 6)
gcsfuse: fuse_debug: Op 0x0000006b        connection.go:474] -> OK
gcsfuse: fuse_debug: Op 0x00000069        connection.go:474] -> OK
gcsfuse: fuse_debug: Op 0x0000006a        connection.go:474] -> OK
gcsfuse: fuse_debug: Op 0x0000006c        connection.go:395] <- ReadDir (inode 2)
gcsfuse: fuse_debug: Op 0x0000006c        connection.go:474] -> OK
gcsfuse: fuse_debug: Op 0x0000006d        connection.go:395] <- ReadDir (inode 2)
gcsfuse: fuse_debug: Op 0x0000006d        connection.go:474] -> OK
internal-sftp[286]: closedir "/files"
gcsfuse: fuse_debug: Op 0x0000006e        connection.go:395] <- ReleaseDirHandle
gcsfuse: fuse_debug: Op 0x0000006e        connection.go:474] -> OK
gcsfuse: fuse_debug: Op 0x0000006f        connection.go:395] <- GetInodeAttributes (inode 2)
gcsfuse: fuse_debug: Op 0x0000006f        connection.go:474] -> OK
gcsfuse: fuse_debug: Op 0x00000070        connection.go:395] <- LookUpInode (parent 2, name "toodles")
gcsfuse: fuse_debug: Op 0x00000070        connection.go:474] -> OK
gcsfuse: fuse_debug: Op 0x00000071        connection.go:395] <- LookUpInode (parent 2, name "toodles")
gcsfuse: fuse_debug: Op 0x00000071        connection.go:474] -> OK
internal-sftp[286]: open "/files/toodles" flags READ mode 0666
gcsfuse: fuse_debug: Op 0x00000072        connection.go:395] <- LookUpInode (parent 2, name "toodles")
gcsfuse: fuse_debug: Op 0x00000072        connection.go:474] -> OK
gcsfuse: fuse_debug: Op 0x00000073        connection.go:395] <- OpenFile (inode 11)
gcsfuse: fuse_debug: Op 0x00000073        connection.go:474] -> OK
gcsfuse: fuse_debug: Op 0x00000074        connection.go:395] <- ReadFile (inode 11, handle 11, offset 0, 4096 bytes)
gcsfuse: gcs: Req             0x23: <- Read("testuser/toodles", [0, 74))
gcsfuse: gcs: Req             0x23: -> Read("testuser/toodles", [0, 74)) (100.702991ms): Received unexpected status code 200 instead of HTTP 206
gcsfuse: fuse_debug: Op 0x00000074        connection.go:476] -> Error: "fh.reader.ReadAt: startRead: NewReader: Received unexpected status code 200 instead of HTTP 206"
gcsfuse: fuse: 2016/03/10 18:23:29.109327 *fuseops.ReadFileOp error: fh.reader.ReadAt: startRead: NewReader: Received unexpected status code 200 instead of HTTP 206
gcsfuse: fuse_debug: Op 0x00000075        connection.go:395] <- ReadFile (inode 11, handle 11, offset 0, 4096 bytes)
gcsfuse: gcs: Req             0x24: <- Read("testuser/toodles", [0, 74))
gcsfuse: gcs: Req             0x24: -> Read("testuser/toodles", [0, 74)) (179.038661ms): Received unexpected status code 200 instead of HTTP 206
gcsfuse: fuse_debug: Op 0x00000075        connection.go:476] -> Error: "fh.reader.ReadAt: startRead: NewReader: Received unexpected status code 200 instead of HTTP 206"
gcsfuse: fuse: 2016/03/10 18:23:29.288840 *fuseops.ReadFileOp error: fh.reader.ReadAt: startRead: NewReader: Received unexpected status code 200 instead of HTTP 206
internal-sftp[286]: sent status Failure
internal-sftp[286]: close "/files/toodles" bytes read 0 written 0
gcsfuse: fuse_debug: Op 0x00000076        connection.go:395] <- FlushFile (inode 11)
gcsfuse: fuse_debug: Op 0x00000076        connection.go:474] -> OK
gcsfuse: fuse_debug: Op 0x00000077        connection.go:395] <- ReleaseFileHandle
gcsfuse: fuse_debug: Op 0x00000077        connection.go:474] -> OK
internal-sftp[286]: session closed for local user testuser from [172.17.0.1]

Expectation: I should be able to cat files that were uploaded with compression to GCS, and the original format should be output.

Note: gsutil cat is buggy also; it manages to cat the file, but doesn't decompress it, so I get gzip binaray data as output. Is there some sort of GCS design decision I'm missing here?

@jacobsa
Copy link
Contributor

jacobsa commented Mar 10, 2016

Support for content-encoding in GCS is a mess; see my write-up here. gcsfuse explicitly disclaims support for this.

Closing this bug without thinking further about it because there is a bit of emotional pain for me here. :-) If it turns out something in that write-up has changed, please feel free to let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants