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

cmd/go: get transport failure unhelpful unless -v is used #12810

Closed
binarycrusader opened this issue Oct 1, 2015 · 6 comments
Closed

cmd/go: get transport failure unhelpful unless -v is used #12810

binarycrusader opened this issue Oct 1, 2015 · 6 comments
Milestone

Comments

@binarycrusader
Copy link
Contributor

Today, if you execute go get on a package and it fails due to a connection timeout, the resulting error is too literal.

Recently, I was helping another developer who encountered this failure and was somewhat mystified as to the result:

$ go get golang.org/x/net
package golang.org/x/net: unrecognized import path "golang.org/x/net"

They could reach other websites, etc. just fine so assumed that somehow Go itself must be broken or they typed the wrong path. However, when they talked to me, it was clear they were using the correct import path.

On a whim, I decided to use '-v' instead to see if that would be more helpful, and of course it became obvious what the likely failure was:

$ go get -v golang.org/x/net
Fetching https://golang.org/x/net?go-get=1
https fetch failed.
import "golang.org/x/net": https fetch: Get https://golang.org/x/net?go-get=1: dial tcp [2607:f8b0:4003:c08::8d]:443: i/o timeout
package golang.org/x/net: unrecognized import path "golang.org/x/net”

In this particular case, the issue was a misbehaving proxy that for some reason has problems with the forwarding in place, and once they used a different proxy, 'go get' succeeded.

I would like to suggest that if 'go get' fails due to a transport issue that the related transport errors should be printed; it's less likely to lead to failures that mystify users and generate unnecessary angst. I don't think it's fair to expect users to intuit that they should run again with '-v' for failures to get the actual errors. The current failure message, at the very least, can be misleading.

@rakyll rakyll added this to the Go1.6 milestone Oct 1, 2015
@rakyll rakyll self-assigned this Oct 1, 2015
@orvado
Copy link

orvado commented Oct 6, 2015

I received the same issue here with the error listed below. Go get is not using the proxy settings on my system which is behind an authenticating Windows proxy. If the software would just use the same proxy settings as IE (which is just one line of code in .NET), it would solve the problem. Obviously, you don't have that luxury here.

F:\Documents\Go>go get -v golang.org/x/net/context
Fetching https://golang.org/x/net/context?go-get=1
https fetch failed.
import "golang.org/x/net/context": https fetch: Get https://golang.org/x/net/context?go-get=1: dial tcp 74.125.25.141:44
3: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, o
r established connection failed because connected host has failed to respond.
package golang.org/x/net/context: unrecognized import path "golang.org/x/net/context"

@adg
Copy link
Contributor

adg commented Oct 6, 2015

I also experienced the same issue recently. We need better error reporting.

@rakyll rakyll removed their assignment Oct 7, 2015
@rakyll
Copy link
Contributor

rakyll commented Oct 7, 2015

It has a trivial fix but not a priority in my list. Removing my assignment and would be happy to see it's fixed by someone else. I am often coming across this issue.

@gopherbot
Copy link

CL https://golang.org/cl/15756 mentions this issue.

@rakyll rakyll self-assigned this Oct 12, 2015
@rakyll rakyll closed this as completed in 29aaf67 Oct 12, 2015
@msepehr
Copy link

msepehr commented Jul 13, 2016

Hi, I have exactly the same issue : go get -v golang.org/x/net/context
Any idea?

@bradfitz
Copy link
Contributor

@msepehr, you don't describe your problem enough. Also, this is a closed issue. Please file a new bug.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants