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

NewProvider() returns unexpected EOF from time to time #437

Open
ameliadong97 opened this issue Oct 9, 2024 · 2 comments
Open

NewProvider() returns unexpected EOF from time to time #437

ameliadong97 opened this issue Oct 9, 2024 · 2 comments

Comments

@ameliadong97
Copy link

Hey team,

We're using go-oidc lib to create new providers for authentication (via this method) and we noticed the GET request frequently returns "unexpected EOF" error. However, whenever we curl the same endpoint, it always succeeded.

Do you happen to know why this error would happen? Some browsing on the internet suggests adding req.Close = true but I'm not sure if that's the problem. Could you please help us out? Really appreciated!!

@ericchiang
Copy link
Collaborator

ericchiang commented Oct 10, 2024

Is there a specific provider your dealing with? Are you using HTTP/2 or another protocol? Is that during io.ReadAll or somewhere else?

I believe req.Close is used to disable keep alives, so it shouldn't be enabled everywhere.

https://pkg.go.dev/net/http#Request

Have you considered using https://pkg.go.dev/net/http/httptrace to debug?

@ameliadong97
Copy link
Author

Hi @ericchiang, we have control on our provider domain but this shouldn't be provider specific. And we do use https. Based on the errors unexpected EOF, I don't think it's from io.ReadAll, otherwise we should be seeing error starting with unable to read response body right? That being said, I have no idea which call failed exactly in NewProvider().

Regarding httptrace, we don't have context on that but we could give it a try. Meanwhile if you can provide any insight for us to understand the error better, we will really appreciate it!

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

No branches or pull requests

2 participants