-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: clarify error for invalid proxy responses #38680
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
Comments
I couldn't reproduce this. Tried a few different things: When offline, with default
When offline, with
Online, with
@homelchenko Could you post your The string |
Right, I specifically cut off GOPROXY settings as it contains a reference to 'private' goproxy based on athens, and I'd rather not post it on public issue tracker :sorry: To add to my setup: there's this Athens instance, which is on internal network, and my GOPROXY points to it via some subdomain. When I am not on VPN these days, I get the error I described above. However, now that I pinged the proxy, it looks like it is reachable, it might be I get some 'other' response from athens while not on VPN |
Okay, having done a few more experiments, I seem to understand more why i can see that 'e' letter in the error. So, under those circumstances when I am not on vpn, what server responds to '< proxy >/rsc.io/quote/@v/list/ is not html containing list of available versions, but with some dummy text starting with 'e'. Looks like the root cause |
Ok cool, I've changed the issue title to indicate we should clarify these error messages. Out of curiosity, could you post the proxy response containing the dummy text? |
|
I'll take a look at this issue. |
I was able to reproduce it on my machine with:
server: package main
import (
"fmt"
"net/http"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "x")
})
err := http.ListenAndServe("localhost:8000", nil)
if err != nil {
panic(err)
}
} For the record, returning status code 0 as mentioned in #38680 (comment) triggers other error:
I'll work now on improving error messages. |
Change https://golang.org/cl/233437 mentions this issue: |
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?
Originally, tried to install tools in VS Code, but later narrowed it down to installing this package
go get rsc.io/quote
(in module, not on GOPATH)
I do have GOPROXY pointing at 'private' server, and I get the error when that server is not reachable due to networking. Go commands start working again as expected when connectivity is restored
What did you expect to see?
Some error hinting at problems with proxy accessibility
What did you see instead?
go get rsc.io/quote: module rsc.io/quote: invalid character 'e' looking for beginning of value
The text was updated successfully, but these errors were encountered: