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

proxy.golang.org: long cache TTL causes confusing UX for 'go get <module>@<branchname>' #38065

Open
emily33901 opened this issue Mar 25, 2020 · 7 comments
Labels
modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. proxy.golang.org
Milestone

Comments

@emily33901
Copy link

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

$ go version
go version go1.14.1 windows/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\josh\AppData\Local\go-build
set GOENV=C:\Users\josh\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=E:\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=E:\src\rainway-metapod\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\josh\AppData\Local\Temp\go-build763362010=/
tmp/go-build -gno-record-gcc-switches

What did you do?

go get github.com/RainwayApp/metapod@modulize and then attempt to import and use metapod in a program

package main

import "github.com/RainwayApp/metapod"

func main() {
	metapod.Create()
}

What did you expect to see?

No errors! woo!

What did you see instead?

module github.com/RainwayApp/metapod@latest found (v0.0.0-20190515153323-337878358c65), but does not contain package github.com/RainwayApp/metapod

Whats interesting is that the downloaded module is devoid of go files which I dont really get (this is even after trying to go get the module again after deleting it from here).

I got around this by creating a new branch (modulize2) which has all the files - however im not sure how its possible for it to end up in this state in the first place so just thought id bring it up...

@seankhliao
Copy link
Member

The code is in gitgub.com/RainwayApp/MetaPod/src/metapod

@bcmills

This comment has been minimized.

@bcmills bcmills marked this as a duplicate of #31866 Mar 25, 2020
@bcmills bcmills closed this as completed Mar 25, 2020
@bcmills bcmills marked this as not a duplicate of #31866 Mar 25, 2020
@bcmills
Copy link
Contributor

bcmills commented Mar 25, 2020

Note that commit 337878358c65 of that repository indeed does not contain any Go source files at the module root.

@bcmills bcmills reopened this Mar 25, 2020
@bcmills bcmills changed the title Go module downloaded with no go files proxy.golang.org: github.com/RainwayApp/metapod@modulize cached to an older-than-expected commit Mar 25, 2020
@bcmills
Copy link
Contributor

bcmills commented Mar 25, 2020

github.com/RainwayApp/metapod@modulize probably resolved to an older-than-expected commit due to caching in proxy.golang.org. This is a known and intentional behavior of the proxy, but it can certainly be confusing.

(I'm trying to find the right issue to mark this as a duplicate.)

@bcmills bcmills added modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Mar 25, 2020
@bcmills bcmills added this to the Unplanned milestone Mar 25, 2020
@emily33901
Copy link
Author

I sort of expected that to be the case - just didnt know where in the chain that happened. Is there any reason why the commit hash in the error message is different to the one in the module cache path (337878358c65 vs 6a6...)?

@emily33901
Copy link
Author

Yeah and the error message that i copied in i think is wrong it should be for @modulize not @latest becuase latest definitely doesnt have any at the root folder

@bcmills bcmills changed the title proxy.golang.org: github.com/RainwayApp/metapod@modulize cached to an older-than-expected commit proxy.golang.org: long cache TTL causes confusing UX for 'go get <module>@<branchname>' Nov 13, 2020
@icholy
Copy link

icholy commented Mar 22, 2021

Perhaps pkg.go.dev could have a "check for newer version" button. The TTL could be communicated by greying that button out with a "try again in X minutes" message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. proxy.golang.org
Projects
None yet
Development

No branches or pull requests

5 participants