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

x/website: "seeker can't seek" error when serving particular files #46809

Closed
rhysh opened this issue Jun 17, 2021 · 3 comments
Closed

x/website: "seeker can't seek" error when serving particular files #46809

rhysh opened this issue Jun 17, 2021 · 3 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@rhysh
Copy link
Contributor

rhysh commented Jun 17, 2021

What version of Go are you using (go version)?

It looks like golang.org is running go1.16.5 (per https://golang.org/VERSION).

Does this issue reproduce with the latest release?

The problem is present on golang.org, and does not seem to be present on tip.golang.org.

What operating system and processor architecture are you using (go env)?

N/A

What did you do?

I followed a link from https://blog.golang.org/cgo to https://golang.org/misc/cgo/ and tried to browse some of the files in that set of directories.

What did you expect to see?

I expected to see the same set of banners and styling that are on most other golang.org pages, and a grey box showing the contents of the file I selected.

What did you see instead?

I see an unstyled "seeker can't seek" response.

In https://golang.org/misc/cgo/stdio/testdata/, the following files do not work:

https://golang.org/misc/cgo/stdio/testdata/chain.go (listed as 938 bytes)
https://golang.org/misc/cgo/stdio/testdata/chain.out (listed as 115 bytes)
https://golang.org/misc/cgo/stdio/testdata/fib.go (listed as 989 bytes)
https://golang.org/misc/cgo/stdio/testdata/fib.out (listed as (962 bytes)
https://golang.org/misc/cgo/stdio/testdata/hello.go (listed as 309 bytes)

The following files work:
https://golang.org/misc/cgo/stdio/testdata/hello.out (listed as 13 bytes)
https://golang.org/misc/cgo/stdio/testdata/run.out (listed as 1112 bytes)

All of those links work after changing "golang.org" to "tip.golang.org".

Anecdotally, the files that work seem to be either "large" (more than 1kiB), tiny (a few bytes), or have particular extensions (https://golang.org/misc/cgo/test/issue20910.c is 459 bytes and displays, but displays as unstyled text).

Broken on golang.org:

$ curl -D - -s https://golang.org/misc/go.mod | head -n 20
HTTP/2 500 
content-type: text/plain; charset=utf-8
last-modified: Thu, 03 Jun 2021 17:14:44 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload
x-content-type-options: nosniff
x-cloud-trace-context: cf64b959d14fc8ba45a31914e51b4b9c
date: Thu, 17 Jun 2021 18:33:30 GMT
server: Google Frontend
content-length: 18
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"

seeker can't seek

Working (for this file at least) on tip.golang.org:

$ curl -D - -s https://tip.golang.org/misc/go.mod | head -n 20
HTTP/2 200 
content-type: text/html; charset=utf-8
date: Thu, 17 Jun 2021 18:33:34 GMT
strict-transport-security: max-age=31536000; includeSubDomains; preload

<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<meta name="description" content="Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#00ADD8">

  <title>misc/go.mod - The Go Programming Language</title>

<link href="https://fonts.googleapis.com/css?family=Work+Sans:600|Roboto:400,700" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Product+Sans&text=Supported%20by%20Google&display=swap" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="/lib/godoc/style.css">
<script>window.initFuncs = [];</script>

<script src="/lib/godoc/jquery.js" defer></script>
@gopherbot gopherbot added this to the Unreleased milestone Jun 17, 2021
@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 17, 2021
@dmitshur
Copy link
Contributor

Thanks for the report. Russ and I have been landing changes in x/website, and this is quite likely related to that. We're going to look.

@rsc
Copy link
Contributor

rsc commented Jun 17, 2021

I know what's wrong. Will fix.

@gopherbot
Copy link

Change https://golang.org/cl/329249 mentions this issue: cmd/golangorg: make zip contents seekable

@golang golang locked and limited conversation to collaborators Jun 26, 2022
passionSeven added a commit to passionSeven/website that referenced this issue Oct 18, 2022
https://golang.org/misc/cgo/stdio/testdata/fib.go fails right now
because the http.FileServer wants to use Seek to find out the file size.
Make that work by introducing an FS wrapper that enables seeking
in an in-memory copy of the file content.

Fixes golang/go#46809.

Change-Id: I353905310dc74594e54e0181dc821a97992b8da7
Reviewed-on: https://go-review.googlesource.com/c/website/+/329249
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Russ Cox <rsc@golang.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants