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: unclear error on private GitHub repo: "410 Gone" #43205

Closed
arp242 opened this issue Dec 16, 2020 · 7 comments
Closed

x/pkgsite: unclear error on private GitHub repo: "410 Gone" #43205

arp242 opened this issue Dec 16, 2020 · 7 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite

Comments

@arp242
Copy link

arp242 commented Dec 16, 2020

I did git commit --amend and git push --force and now pkg.go.dev doesn't seem to like the entire package.

I forgot I had already pushed this a few months ago, and undoing --amend is rather painful, and since no one is using this package anyway I just forced pushed the lot which shouldn't cause any issues except for, well, this 😅

Anyway, I made a new commit, and that didn't solve it: I get errors on the new commit as well. I also waited for a few hours, as I remember reading about some caching before, but that doesn't seem to do anything either. I also ran go clean -modcache and tried the "Request zgo.at/zcert" button. GONOPROXY=* GONOSUMDB=* go get zgo.at/zcert works as expected.

Package: https://pkg.go.dev/zgo.at/zcert

[~gc](zcert)% go version
go version go1.15.5 linux/amd64

[~gc](zcert)% go get -v -x zgo.at/zcert@e696fc5
# get https://proxy.golang.org/zgo.at/zcert/@v/e696fc5.info
# get https://proxy.golang.org/zgo.at/@v/e696fc5.info
# get https://proxy.golang.org/zgo.at/zcert/@v/e696fc5.info: 410 Gone (0.138s)
# get https://proxy.golang.org/zgo.at/@v/e696fc5.info: 410 Gone (0.138s)
# get https://zgo.at/?go-get=1
# get https://zgo.at/zcert?go-get=1
# get https://zgo.at/zcert?go-get=1: 200 OK (0.138s)
get "zgo.at/zcert": found meta tag get.metaImport{Prefix:"zgo.at/zcert", VCS:"git", RepoRoot:"https://github.com/zgoat/zcert.git"} at //zgo.at/zcert?go-get=1
mkdir -p /home/martin/.cache/go-mod/cache/vcs # git3 https://github.com/zgoat/zcert.git
# lock /home/martin/.cache/go-mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f.lock# /home/martin/.cache/go-mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f for git3 https://github.com/zgoat/zcert.git
cd /home/martin/.cache/go-mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' e696fc5 --
# get https://zgo.at/?go-get=1: 200 OK (0.140s)
0.004s # cd /home/martin/.cache/go-mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' e696fc5 --
cd /home/martin/.cache/go-mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' e696fc55ce45ecc43352207e32bf6d4a5dc47026 --
0.003s # cd /home/martin/.cache/go-mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' e696fc55ce45ecc43352207e32bf6d4a5dc47026 --
cd /home/martin/.cache/go-mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f; git cat-file blob e696fc55ce45ecc43352207e32bf6d4a5dc47026:go.mod
0.002s # cd /home/martin/.cache/go-mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f; git cat-file blob e696fc55ce45ecc43352207e32bf6d4a5dc47026:go.mod
cd /home/martin/.cache/go-mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f; git for-each-ref --format %(refname) refs/tags --merged e696fc55ce45ecc43352207e32bf6d4a5dc47026
0.002s # cd /home/martin/.cache/go-mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f; git for-each-ref --format %(refname) refs/tags --merged e696fc55ce45ecc43352207e32bf6d4a5dc47026
cd /home/martin/.cache/go-mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f; git ls-remote -q origin
3.344s # cd /home/martin/.cache/go-mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f; git ls-remote -q origin
cd /home/martin/.cache/go-mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f; git for-each-ref --format %(refname) refs/tags --merged e696fc55ce45ecc43352207e32bf6d4a5dc47026
0.002s # cd /home/martin/.cache/go-mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f; git for-each-ref --format %(refname) refs/tags --merged e696fc55ce45ecc43352207e32bf6d4a5dc47026
cd /home/martin/.cache/go-mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' e696fc55ce45 --
0.003s # cd /home/martin/.cache/go-mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' e696fc55ce45 --
cd /home/martin/.cache/go-mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f; git cat-file blob e696fc55ce45ecc43352207e32bf6d4a5dc47026:go.mod
0.002s # cd /home/martin/.cache/go-mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f; git cat-file blob e696fc55ce45ecc43352207e32bf6d4a5dc47026:go.mod
go: downloading zgo.at/zcert v0.0.0-20201215115053-e696fc55ce45
# get https://proxy.golang.org/zgo.at/zcert/@v/v0.0.0-20201215115053-e696fc55ce45.zip
# get https://proxy.golang.org/zgo.at/zcert/@v/v0.0.0-20201215115053-e696fc55ce45.zip: 410 Gone (0.022s)
cd /home/martin/.cache/go-mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f; git cat-file blob e696fc55ce45ecc43352207e32bf6d4a5dc47026:go.mod
0.003s # cd /home/martin/.cache/go-mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f; git cat-file blob e696fc55ce45ecc43352207e32bf6d4a5dc47026:go.mod
cd /home/martin/.cache/go-mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f; git cat-file blob e696fc55ce45ecc43352207e32bf6d4a5dc47026:go.mod
0.002s # cd /home/martin/.cache/go-mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f; git cat-file blob e696fc55ce45ecc43352207e32bf6d4a5dc47026:go.mod
cd /home/martin/.cache/go-mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f; git -c core.autocrlf=input -c core.eol=lf archive --format=zip --prefix=prefix/ e696fc55ce45ecc43352207e32bf6d4a5dc47026
0.005s # cd /home/martin/.cache/go-mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f; git -c core.autocrlf=input -c core.eol=lf archive --format=zip --prefix=prefix/ e696fc55ce45ecc43352207e32bf6d4a5dc47026
# get https://proxy.golang.org/sumdb/sum.golang.org/supported
# get https://proxy.golang.org/sumdb/sum.golang.org/supported: 410 Gone (0.022s)
# get https://sum.golang.org/lookup/zgo.at/zcert@v0.0.0-20201215115053-e696fc55ce45
# get https://sum.golang.org/lookup/zgo.at/zcert@v0.0.0-20201215115053-e696fc55ce45: 410 Gone (0.109s)
go get zgo.at/zcert@e696fc5: zgo.at/zcert@v0.0.0-20201215115053-e696fc55ce45: verifying module: zgo.at/zcert@v0.0.0-20201215115053-e696fc55ce45: reading https://sum.golang.org/lookup/zgo.at/zcert@v0.0.0-20201215115053-e696fc55ce45: 410 Gone
	server response:
	not found: zgo.at/zcert@v0.0.0-20201215115053-e696fc55ce45: invalid version: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /tmp/gopath/pkg/mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f: exit status 128:
		fatal: could not read Username for 'https://github.com': terminal prompts disabled

And also:

[~c/zcert](master)% git reflog
e696fc5 (HEAD -> master, origin/master) HEAD@{0}: commit: No stable API, so no releases yet    ← Normal commit.
08ec643 HEAD@{1}: commit (amend): Hello    ← Force-pushed over the single pushed commit.
60b7479 HEAD@{2}: commit (amend): Hello    ← Initial pushed commit a few months ago (the others are all local).
9efbb70 HEAD@{3}: commit (amend): Hello
01db258 HEAD@{4}: commit (amend): Hello
0bf0bd0 HEAD@{5}: commit (amend): Hello
240a8dc HEAD@{6}: commit (amend): Hello
65d10a3 HEAD@{7}: commit (initial): Hello
@gopherbot gopherbot added this to the Unreleased milestone Dec 16, 2020
@jba
Copy link
Contributor

jba commented Dec 16, 2020

pkg.go.dev gets its information from the Go module proxy. This is what the proxy says:

> curl https://proxy.golang.org/zgo.at/zcert/@v/list
not found: module zgo.at/zcert: git ls-remote -q origin in /tmp/gopath/pkg/mod/cache/vcs/a7dec0032fe457c85de35892c7cf41338e8fa46202fb9b26982a5f58a6e3387f: exit status 128:
        fatal: could not read Username for 'https://github.com': terminal prompts disabled
Confirm the import path was entered correctly.
If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.

That error message is coming either from the proxy or your git server (my machine has no path beginning /tmp/gopath).
@heschik, any thoughts?

@jba jba modified the milestones: Unreleased, pkgsite/unplanned Dec 16, 2020
@jba jba added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 16, 2020
@hyangah
Copy link
Contributor

hyangah commented Dec 16, 2020

@arp242 The error message is from the git command invoked by go while accessing github.com/zgoat/zcert. proxy.golang.org (so pkg.go.dev) cannot retrieve private modules.

@arp242
Copy link
Author

arp242 commented Dec 16, 2020

Ah sjeez, I didn't notice that it's a private repo 🙃 And my local machine has my ssh key, so it worked for that.

The message is gives back you to you is super-confusing though; it kind of seems to work except it doesn't. In hindsight, the fatal: could not read Username for 'https://github.com': terminal prompts disabled is a clue that authorisation is denied, but it's not exactly what I would call very obvious.

Disabling the credentials with GIT_ASKPASS or core.askPass would give a clearer message:

$ GIT_ASKPASS=/bin/true git clone https://github.com/zgoat/priv
Cloning into 'priv'...
remote: Repository not found.
fatal: Authentication failed for 'https://github.com/zgoat/priv/'

Or set the user and password to _, or something along those lines. I'd assume this also works for git fetch.

I'll keep this issue open (with edited title), as it seems to me that there's some room for improvement here.

@arp242 arp242 changed the title x/pkgsite: module unavailable with "410 Gone" after force push x/pkgsite: unclear error on private GitHub repo: "410 Gone" Dec 16, 2020
@hyangah
Copy link
Contributor

hyangah commented Dec 16, 2020

The error message is from the go command (go list -m -json --versions -x -v <private_or_nonexistent_module>).

cc @bcmills @jayconrod @matloob to see if the go command can improve the error message.

@jba Do you have any other plan to enhance the instruction https://go.dev/about#adding-a-package or show more beautified error messages on top of what go command offers when users click the 'request' button? If not, this doesn't look like x/pkgsite issue any more to me.

@jba
Copy link
Contributor

jba commented Dec 16, 2020

@hyangah @dmitshur is there a better label for this than pkgsite?

@bcmills
Copy link
Contributor

bcmills commented Dec 16, 2020

@hyangah, the cmd/go error message is #25982, I think.

@jba
Copy link
Contributor

jba commented Dec 16, 2020

@hyangah we don't have any such plan.

I think #25982 is the right place to follow up, so closing this.

@jba jba closed this as completed Dec 16, 2020
@golang golang locked and limited conversation to collaborators Dec 16, 2021
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. pkgsite
Projects
None yet
Development

No branches or pull requests

5 participants