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

Error message for incorrect endpoint does not provide enough information to debug #2064

Closed
zombiezen opened this issue May 11, 2018 · 4 comments
Assignees
Labels
P2 Type: Feature New features or improvements in behavior

Comments

@zombiezen
Copy link

I recently experienced a rather long debug session where I had misconfigured the endpoint of a gRPC connection to a Google Cloud API. I ultimately ended up having to monkey-patch instrumentation into gRPC to figure out what was going on.

The header-handling code bails at the first error instead of trying to get a larger picture of what's going on.

for _, hf := range frame.Fields {
if err := d.processHeaderField(hf); err != nil {
return err
}
}

What version of gRPC are you using?

v1.11.3

What version of Go are you using (go version)?

go version go1.10.2 linux/amd64

What operating system (Linux, Windows, …) and version?

Linux

What did you do?

Dial a gRPC connection to a non-gRPC endpoint by accident.

What did you expect to see?

The following information would have been helpful in the error:

  • HTTP response status code. This helps distinguish an ACL issue from a typo'd endpoint, for instance.
  • The requested URL. Without this, I had to trace back through my code to see how the connection was being initialized to see whether this was the issue. If I had this information in the error message, I could have simply seen the problem by a quick inspection of the error message.
  • The problematic header's error message (already included).

What did you see instead?

rpc error: code = Internal desc = transport: received the unexpected content-type "text/html; charset=UTF-8"
@menghanl menghanl added P2 Type: Feature New features or improvements in behavior labels May 17, 2018
@utrack
Copy link

utrack commented Aug 7, 2018

Also, some (configurable) way to print the body we've received would be cool.

@ayenter
Copy link

ayenter commented Nov 8, 2018

Bump

@dfawley
Copy link
Member

dfawley commented Dec 4, 2018

Note per the linked issue that the status code here is supposed to be Unimplemented instead of Internal.

EDIT: for future reference, this can be easily tested via:

$ go run interop/client/client.go --server_host=dsldksd.googleapis.com --server_host_override=dsldksd.googleapis.com --server_port=443 --use_tls=true
FATAL: 2018/12/05 16:33:19 /TestService/UnaryCall RPC failed: rpc error: code = Internal desc = transport: received the unexpected content-type "text/html; charset=UTF-8"
exit status 1

@menghanl
Copy link
Contributor

menghanl commented Jun 5, 2019

This should be fixed by #2599.

Closing. Please comment if it is still a problem.

@menghanl menghanl closed this as completed Jun 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P2 Type: Feature New features or improvements in behavior
Projects
None yet
Development

No branches or pull requests

6 participants