Skip to content

x/pkgsite/cmd/pkgsite: search not working in -cache mode #73877

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

Open
katiehockman opened this issue May 27, 2025 · 2 comments
Open

x/pkgsite/cmd/pkgsite: search not working in -cache mode #73877

katiehockman opened this issue May 27, 2025 · 2 comments
Labels
BugReport Issues describing a possible bug in the Go implementation. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@katiehockman
Copy link
Contributor

Go version

go version go1.24.0 darwin/arm64

Output of go env in your module/workspace:

AR='ar'
CC='clang'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='clang++'
GCCGO='gccgo'
GO111MODULE=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/Users/kmh/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/kmh/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/vf/f7sq853n33lbw99s6ltplw_00000gp/T/go-build1093759142=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/dev/null'
GOMODCACHE='/Users/kmh/go/pkg/mod'
GONOPROXY='github.com/kouzoh,github.com/kouzoh-mercoin'
GONOSUMDB='github.com/kouzoh,github.com/kouzoh-mercoin'
GOOS='darwin'
GOPATH='/Users/kmh/go'
GOPRIVATE='github.com/kouzoh,github.com/kouzoh-mercoin'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/kmh/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.24.0'
GOWORK=''

What did you do?

I have a Dockerfile that looks like this:

FROM golang:1.24-alpine

ENV GOPRIVATE=github.com/<my-org>
ENV GOMODCACHE=/go/pkg/mod

# Set working directory inside the container
WORKDIR /app

# Copy host files to the container
COPY . /app

# Install tools
RUN apk add --no-cache git
RUN go install golang.org/x/pkgsite/cmd/pkgsite@latest

# Download modules to the Go module cache
RUN go mod download github.com/<my-org>/<my-private-repo>@v0.67.2

# Expose the port that pkgsite will use
EXPOSE 8080

# Run pkgsite in cache mode
CMD ["pkgsite", "-http", "0.0.0.0:8080", "-cache"]

What did you see happen?

When running binary, it can load the homepage and I can see that the module did in fact get downloaded if I manually type it into the URL. However, the search doesn't work (nothing appears) and when clicking around I sometimes see errors like this:

2025/05/27 08:04:34 Error: goTagForVersion(""): TagForVersion(""): invalid argument: requested version is not a valid semantic version: "" 

What did you expect to see?

The search should work similar to pkg.go.dev today when running in "cache" mode.

Does there need to be another binary within golang.org/x/pkgsite/cmd in order for this to work, or is just the pkgsite binary with the -cache flag sufficient?

Thanks so much ❤

@gopherbot gopherbot added this to the Unreleased milestone May 27, 2025
@gabyhelp gabyhelp added the BugReport Issues describing a possible bug in the Go implementation. label May 27, 2025
@mknyszek
Copy link
Contributor

CC @golang/pkgsite

@mknyszek mknyszek added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugReport Issues describing a possible bug in the Go implementation. 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