-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
cmd/go: improve error message when a module is successfully fetched but not in the sum db #32291
Comments
CC @jayconrod @rsc |
I'm on the fence about this one, but suggested that @tbpg file an issue regardless. We don't want to train users to add A missing sumdb entry seems much more likely to result from a private repo than from a genuine MITM attack, so |
At the very least there needs to be a speed bump, like having to click on a link to the wiki. We don't want "here's some error about something checksum, here's the line to get on with your day". For example:
|
Makes sense to me! Thanks. Next steps are to figure out the right location for that documentation, write it, then update this error message to link to it. No ETA yet. |
We should definitely detect the 404/410 and print a nicer error. |
This is going to make it very hard to use with any private repo (internal git.company.local, or just private repo on github/gitlab). I do not, and should not need to maintain an env var that is a comma separated lists of private repos just to be able to build my golang project, and setting |
Just to make sure you are aware of options, you can choose to do something akin to:
...which persists that configuration information so that you don't need to set an actual environment variable. From the doc:
Some more details here: https://tip.golang.org/cmd/go/#hdr-Module_configuration_for_non_public_modules |
sure, for my local box, but in build systems I need the env var, and I need to document this in the readme or some such and maintain it since this is not maintained in the source of truth on the modules Maybe add something to to the go.mod to maintain this
|
For what is worth, I just spent a better part of the evening and the morning trying to find a solution to the problem of "401 gone" for the module in my private GitHub repo. I believe this could be better documented, and also believe that an environment variable is a very blunt tool to use for this purpose. It would be better to have a control from go.mod. Perhaps it would be cleaner if there was a separate section from the require. Something along these lines:
|
Using the go.mod is being discussed in #33985. This issue is about the error message. |
Probably the error message should direct users to some (stable) documentation link. Figuring out the stable links for module documentation is #33637. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
I'm not sure we should make this change (might not want to make it obvious, for some sense of the word, how to disable the sum db).
The solution, in this case, is to add
GONOSUMDB=github.com/tbpg
. Could we mentionGONOSUMDB
in the error message?What did you see instead?
410 Gone
cc @FiloSottile @bcmills
Related to #32184, which would have prevented this error.
The text was updated successfully, but these errors were encountered: