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: test page returns 500 #47761

Closed
fgm opened this issue Aug 17, 2021 · 3 comments
Closed

x/website: test page returns 500 #47761

fgm opened this issue Aug 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

@fgm
Copy link

fgm commented Aug 17, 2021

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

$ go version
go version go1.17 darwin/amd64

(not applicable, this is a website issue)

Does this issue reproduce with the latest release?

Yes, this is a website issue

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/fgm/Library/Caches/go-build"
GOENV="/Users/fgm/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/fgm/src/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/fgm/src/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org|direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.17"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/fgm/src/go/src/github.com/golang/website/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/0g/p780bc554njc4qj110_8rmbr0000gn/T/go-build4101997795=/tmp/go-build -gno-record-gcc-switches -fno-common"

(irrelevant, this is a website issue)

What did you do?

Navigate to https://golang.org/test/

What did you expect to see?

A normal page

What did you see instead?

A 500 page with that content:

Error
template execution: template: site.tmpl:81:18: executing "site.tmpl" at <breadcrumb .URL>: error calling breadcrumb: template: site.tmpl:68:16: executing "breadcrumb" at <slice $elems 0 (sub (len $elems) 2)>: error calling slice: index out of range: -1
@gopherbot gopherbot added this to the Unreleased milestone Aug 17, 2021
@fgm
Copy link
Author

fgm commented Aug 17, 2021

Bug apparently introduced when https://go-review.googlesource.com/c/website/+/339403 added use of {{breadcrum .URL}} in site.tmpl while moving it around.

@mknyszek mknyszek added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 18, 2021
@mknyszek
Copy link
Contributor

CC @dmitshur

@dmitshur
Copy link
Contributor

Thanks for reporting and bisecting @fgm.

CC @rsc as the author of CL 339403.

@golang golang locked and limited conversation to collaborators Aug 18, 2022
passionSeven added a commit to passionSeven/website that referenced this issue Oct 18, 2022
Since we now use strings.Trim on the URL, there should be no need to check for suffix.
This change also adds a trailing / to the breadcrumb URL.
This shouldn't have much effect on the site, however for local development
non-trailing-slash paths redirected to the actual site,
which was sometimes confusing to encounter when testing changes.

Fixes golang/go#47761

Change-Id: I25718b2c2facf460db64f5f2ef09d78dc1233857
GitHub-Last-Rev: 27ef7578b8402f67b2c27d828bf10e33217c972a
GitHub-Pull-Request: golang/website#80
Reviewed-on: https://go-review.googlesource.com/c/website/+/343050
Reviewed-by: Russ Cox <rsc@golang.org>
Trust: Dmitri Shuralyov <dmitshur@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

Successfully merging a pull request may close this issue.

4 participants