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/pkgsite/cmd/pkgsite: Unable to fetch std@Latest Pkgsite documentation for Local Main go Repo : https://go.googlesource.com/go #63744

Open
raghvenders opened this issue Oct 25, 2023 · 7 comments
Assignees
Labels
pkgsite/cmd Issues related to x/pkgsite/cmd/pkgsite pkgsite

Comments

@raghvenders
Copy link
Contributor

raghvenders commented Oct 25, 2023

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

$ go version
go1.21.3

Does this issue reproduce with the latest release?

Yes. But the ultimate intention is to run pkgsite for main go repository - std@latest against master(1.22) branch.

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

go env Output
$ go env
Windows, amd64, gcc

What did you do?

1. git clone https://go.googlesource.com/go/
2. git checkout go1.21.3
3. git switch -c go1.21.3
4. C:\Users\R\golang\go\src> all.bat
------------------------------------
GOARCH: amd64
GOOS: windows
OS Version: 10.0.22621

ALL TESTS PASSED


Installed Go for windows/amd64 in C:\Users\R\golang\go
Installed commands in C:\Users\R\golang\go\bin
*** You need to add C:\Users\R\golang\go\bin to your PATH.

-------------------------------------
5. go install golang.org/x/pkgsite/cmd/pkgsite@latest
6. C:\Users\R\golang\go\src>pkgsite .

C:\Users\R\golang\go\src>pkgsite .
2023/10/25 16:29:15 Info: go/packages.Load(["all"]) loaded 277 packages from . in 655.6654ms
2023/10/25 16:29:15 Info: go/packages.Load(std) loaded 0 packages from C:\Program Files\Go in 9.2327ms
2023/10/25 16:29:15 Error: loading packages from stdlib: err: fork/exec C:\Users\R\golang\go\bin\go.exe: The parameter is incorrect.: stderr:
2023/10/25 16:29:15 Info: Listening on addr http://localhost:8080
2023/10/25 16:29:51 Info: FetchDataSource: fetching std@latest
2023/10/25 16:34:10 Error: serveUnitPage(ctx, w, r, ds, &{std std latest}): FetchDataSource.GetUnitMeta("std", "std", "latest"): FetchDataSource.findModule("std", "std", "latest"): FetchDataSource.getModule("std", "latest"): FetchModule("std", "latest"): stdlib.ContentDir("latest"): remoteGoRepo.clone("v1.21.3"): running git fetch: exit status 128: fatal: refusing to fetch into branch 'refs/heads/main' checked out at 'C:/Users/R/AppData/Local/Temp/1087088232'

What did you expect to see?

I was hoping to see the documentation website like pkg.go.dev and std libs listed and to look at their documentation.

What did you see instead?

Screenshot 2023-10-25 165655

@bcmills bcmills changed the title affected/package: Unable to fetch std@Latest Pkgsite documentation for Local Main go Repo : https://go.googlesource.com/go x/pkgsite/cmd/pkgsite: Unable to fetch std@Latest Pkgsite documentation for Local Main go Repo : https://go.googlesource.com/go Oct 26, 2023
@gopherbot gopherbot added this to the Unreleased milestone Oct 26, 2023
@bcmills bcmills added the pkgsite/cmd Issues related to x/pkgsite/cmd/pkgsite label Oct 26, 2023
@raghvenders
Copy link
Contributor Author

When I try pkgsite with proxy I get below error

pkgsite -proxy (GOPROXY - https://proxy.golang.org,direct)

BYPASSING LICENSE CHECKING: MAY DISPLAY NON-REDISTRIBUTABLE INFORMATION 2023/10/28 17:24:30 Info: go/packages.Load(std) loaded 0 packages from C:\Program Files\Go in 22.9285ms 2023/10/28 17:24:30 Error: loading packages from stdlib: err: fork/exec C:\Program Files\Go\bin\go.exe: The parameter is incorrect.: stderr: 2023/10/28 17:24:30 Info: Listening on addr http://localhost:8080 2023/10/28 17:25:09 Info: FetchDataSource: fetching std@latest 2023/10/28 17:25:09 Info: FetchDataSource: fetched std@latest using *fetch.proxyModuleGetter in 5.7355ms with error FetchModule("std", "latest"): proxy.Client.Info("std", "latest"): Client.readBody("std", "latest", "info"): Client.escapedURL("std", "latest", "info"): path: malformed module path "std": missing dot in first path element: invalid argument 2023/10/28 17:25:09 Error: serveUnitPage(ctx, w, r, ds, &{std std latest}): FetchDataSource.GetUnitMeta("std", "std", "latest"): FetchDataSource.findModule("std", "std", "latest"): FetchDataSource.getModule("std", "latest"): FetchModule("std", "latest"): proxy.Client.Info("std", "latest"): Client.readBody("std", "latest", "info"): Client.escapedURL("std", "latest", "info"): path: malformed module path "std": missing dot in first path element: invalid argument

Note: However, when I tried local packages(Cloned from repo to local), they are working , screenshots attached.

Screenshot 2023-10-28 170017

@raghvenders
Copy link
Contributor Author

raghvenders commented Oct 29, 2023

@bcmills - I have my local devel golang - set GOVERSION=devel go1.22-b5f87b5407 Tue Oct 24 20:28:25 2023 +0000 and GOROOT and tools are all local development directory. It is not able to show pkgsite and has shown above errors.

However when I point my GOROOT to my base golang installation "C:\Program Files\go" (go1.21.3) and respective set GOTOOLDIR, I am able to see the local stdlib code changes reflecting in the documentation. Looks like I am using different toolchain here to render local development stdlib documentation on pkgsite? Is this an issue to be reported?

@findleyr
Copy link
Contributor

findleyr commented Nov 2, 2023

CC @matloob @jba

Michael, could this be related to recent cmd/pkgsite changes?

@matloob
Copy link
Contributor

matloob commented Nov 2, 2023

@findleyr yes, I think it is related to the recent cmd/pkgsite changes.

@findleyr
Copy link
Contributor

findleyr commented Nov 3, 2023

@matloob thanks, tentatively assigned to you to investigate further.

@gopherbot
Copy link

Change https://go.dev/cl/540635 mentions this issue: internal/stdlib: pass -f to git fetch in remoteGoRepo.clone

@matloob
Copy link
Contributor

matloob commented Nov 7, 2023

I was able to reproduce the Error: loading packages from stdlib: err: fork/exec $GOROOT\bin\go.exe: The parameter is incorrect.: stderr: error on Windows. Seems like it's only happening there.

The refusing to fetch into branch 'refs/heads/main' may be the same as issue #63254

gopherbot pushed a commit to golang/pkgsite that referenced this issue Nov 8, 2023
remoteGoRepo.clone inits a repo and then tries to fetch into the
"main" branch of the repo. But if the user's settings are for the
default branch to be called main, main will already exist and the
fetch command will fail. The -f flag will cause the command to do the
fetch even though the branch already exists.

For golang/go#63254
For golang/go#63744

Change-Id: I33f414654088a67eae4bfa70424d0dc6c34903f0
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/540635
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
kokoro-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Michael Matloob <matloob@golang.org>
@suzmue suzmue modified the milestones: Unreleased, pkgsite/backlog Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkgsite/cmd Issues related to x/pkgsite/cmd/pkgsite pkgsite
Projects
None yet
Development

No branches or pull requests

6 participants