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: unexpected EOF error in proxy fetch path lacks error context #52727

Open
bcmills opened this issue May 5, 2022 · 3 comments
Open

cmd/go: unexpected EOF error in proxy fetch path lacks error context #52727

bcmills opened this issue May 5, 2022 · 3 comments
Assignees
Labels
GoCommand modules NeedsFix
Milestone

Comments

@bcmills
Copy link
Member

@bcmills bcmills commented May 5, 2022

            # get https://proxy.golang.org/golang.org/x/xerrors/@v/v0.0.0-20191011141410-1b5146add898.mod
            # get https://proxy.golang.org/golang.org/x/xerrors/@v/v0.0.0-20191011141410-1b5146add898.mod: 200 OK (0.003s)
            golang.org/x/tools/cmd/goimports imports
            	golang.org/x/sys/execabs: golang.org/x/sys@v0.0.0-20211019181941-9d821ace8654: unexpected EOF
            # get https://proxy.golang.org/golang.org/x/mod/@v/list
            # get https://proxy.golang.org/golang.org/x/xerrors/@v/list
            # get https://proxy.golang.org/golang.org/x/xerrors/@v/list: 200 OK (0.013s)

This may well be a bug in the proxy.golang.org server, but without more detail from the error message we don't have a good way to track it down. Step one is to improve the error message to describe exactly which URL produced the unexpected EOF error.

@bcmills bcmills added help wanted NeedsInvestigation GoCommand modules labels May 5, 2022
@bcmills bcmills added this to the Backlog milestone May 5, 2022
@bcmills bcmills assigned bcmills and unassigned bcmills May 5, 2022
@bcmills
Copy link
Member Author

@bcmills bcmills commented May 6, 2022

Looks like this bug is pretty old. The first occurrence I could find in the logs is from 2019. 😅

greplogs -l -e '.*: [a-zA-Z0-9]+\.[a-zA-Z0-9]+[^@]*@v\d+\.\d+\.\d+[^:]*: unexpected EOF'

2022-05-05T18:48:46-d299b94-025a9c3/linux-amd64-wsl
2022-05-04T15:38:23-c6688b5/linux-386-longtest
2022-04-23T05:38:56-84e58bf-9717e8f/linux-mips64le-mengzhuo
2022-03-25T01:24:44-1e5ae83-8ab42a9/plan9-amd64-0intro
2022-01-24T22:28:27-bbe1937-84eefdc/plan9-amd64-0intro
2021-12-20T22:06:07-6040366-7c94355/plan9-amd64-0intro
2021-12-09T12:49:13-491a49a-65633fe/linux-amd64-wsl
2021-10-05T19:16:08-2dc2755-3100dc1/linux-amd64-wsl
2021-10-04T16:44:53-cedda3a-7d57324/linux-amd64-wsl
2021-10-02T13:15:42-e81a3d9-7bf7bbc/linux-amd64-wsl
2021-10-01T16:17:08-e81a3d9-f19b2d5/linux-amd64-wsl
2021-09-14T13:53:08-0c0215e-b3c6de9/linux-amd64-wsl
2021-09-07T14:53:41-ad29c8a-21de6bc/linux-amd64-wsl
2021-08-20T15:37:55-19b2f83-ec51703/linux-amd64-wsl
2021-08-17T13:57:48-c8c9087-ec51703/linux-amd64-wsl
2021-08-17T02:49:38-e0c9fd4-91a935e/linux-amd64-wsl
2021-08-03T15:01:07-3395cb0-7921829/linux-amd64-wsl
2021-07-30T14:01:30-55fae94-b7a85e0/linux-amd64-wsl
2021-07-17T18:43:54-ea8c25a-aa4e0f5/plan9-amd64-0intro
2021-07-12T15:00:05-a46b181-3d1d066/linux-amd64-wsl
2021-06-21T14:58:02-06fdb77-7a5e704/linux-amd64-wsl
2021-06-10T13:23:58-84b48f8-7677616/linux-amd64-wsl
2021-06-09T14:15:26-9f230b5-aa5540c/linux-amd64-wsl
2021-06-03T11:23:40-99ded55-6b411e9/linux-amd64-wsl
2021-06-02T15:04:26-7271753-e3c9537/linux-amd64-wsl
2021-05-28T13:47:27-333eda0-c92adf4/linux-amd64-wsl
2021-05-27T15:33:46-a3eb095-fca7b8f/linux-amd64-wsl
2021-05-26T13:23:13-fea2f6f-3380b18/linux-amd64-wsl
2021-05-20T14:08:36-0886cdd-04cd717/linux-amd64-wsl
2021-05-19T13:04:45-4163338-658b5e6/linux-amd64-wsl
2021-05-12T16:42:30-9dfac01-04cd717/linux-amd64-wsl
2021-04-27T13:59:22-7b9993c-0b9ca4d/linux-amd64-wsl
2021-04-21T14:15:55-798c215-daee726/linux-amd64-wsl
2021-04-20T14:30:03-d25e304-3ff6ff7/linux-amd64-wsl
2021-03-30T03:28:19-769264c-3394586/linux-amd64-wsl
2021-03-29T05:50:11-0df2b77-ba6bd96/linux-amd64-wsl
2021-03-24T05:16:36-2c4c8ec-dcffdac/linux-amd64-wsl
2021-03-23T05:12:39-0d94d28-f4b9183/linux-amd64-wsl
2021-03-23T05:12:12-d523dce-cd26192/linux-amd64-wsl
2021-03-19T21:57:54-0d94d28-dcffdac/linux-amd64-wsl
2021-03-18T04:17:00-9b614f5-c2d6251/linux-amd64-wsl
2021-03-18T03:52:02-372c93a-42c25e6/linux-amd64-wsl
2021-03-15T23:47:56-34ac3e1-661f3f1/linux-amd64-wsl
2021-03-15T10:23:23-e18ecbb-6ccb5c4/linux-amd64-wsl
2021-03-11T17:08:05-5ea612d-3979fb9/linux-amd64-wsl
2021-03-09T02:20:55-5c1e898-618b66e/linux-amd64-wsl
2021-03-07T15:14:49-5c1e898-3068d55/linux-amd64-wsl
2021-03-05T23:58:34-a95e02b-414fa8c/linux-amd64-wsl
2021-03-02T06:08:56-65c8374-ebb92df/plan9-arm
2021-02-19T00:41:36-4410531-40765ff/linux-amd64-wsl
2020-03-01T02:13:41-0de0cce-33e9832/linux-ppc64-buildlet
2019-11-05T01:01:31-0deb692-376c4ce/freebsd-386-11_2
2019-09-11T03:32:35-c13cbed-904f046/windows-386-2008

@bcmills
Copy link
Member Author

@bcmills bcmills commented May 16, 2022

I think this is coming from the net/http package: a mismatched Content-Length header on the HTTP response seems to provoke an unexpected EOF error without additional detail (https://go.dev/play/p/nJN-O8xOT1W).

That appears to come from here:
https://cs.opensource.google/go/go/+/master:src/net/http/transfer.go;l=862-866;drc=0537a74b76fcab1398da6699c3ff7411fef8fbe7

The error text is not in line with Effective Go's guidance ”to provide detailed error information”, but it almost certainly cannot be changed now, so we need to wrap the error on the caller side.

@bcmills bcmills self-assigned this May 16, 2022
@bcmills bcmills removed this from the Backlog milestone May 16, 2022
@bcmills bcmills added this to the Go1.19 milestone May 16, 2022
@bcmills bcmills added NeedsFix and removed help wanted labels May 16, 2022
@gopherbot gopherbot removed the NeedsInvestigation label May 16, 2022
@gopherbot
Copy link

@gopherbot gopherbot commented May 16, 2022

Change https://go.dev/cl/406675 mentions this issue: cmd/go/internal/modfetch: wrap errors from HTTP response bodies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand modules NeedsFix
Projects
None yet
Development

No branches or pull requests

2 participants