-
Notifications
You must be signed in to change notification settings - Fork 20.2k
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
Add logging for missing --rpcvhosts on server #16498
Conversation
Thank you for your contribution! Your commits seem to not adhere to the repository coding standards
Please check the contribution guidelines for more details. This message was auto-generated by https://gitcop.com |
@@ -96,6 +99,8 @@ func (c *Client) sendHTTP(ctx context.Context, op *requestOp, msg interface{}) e | |||
defer respBody.Close() | |||
var respmsg jsonrpcMessage | |||
if err := json.NewDecoder(respBody).Decode(&respmsg); err != nil { | |||
err := fmt.Errorf("Error creating HTTP connection to RPC socket. Did you set --rpcvhosts on the server? Actual error is \"%s\"", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are reassigning the err
here. What should happen is that the server should respond with a json-rpc error, saying that the host header was wrong, and we should just bubble that up. So if that's not happening, it would be better to try to discover why that is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed, I don't know why that is and don't know how to determine the source. I have debugging notes in the referenced issue.
Ah, I see. So the reponse is not
Thus we get
The client should not assume it's |
For some reason, |
oic, this totally makes sense now. I wasn't looking at the headers because they were getting thrown out. I'll try and add a content-type to the client headers. |
Did you see my alternate PR #16500 ? |
ha! I did now. thanks. this is my first PR in this project. I appreciate the help. |
#16457
I couldn't figure out where the error output in the referenced issue originated so I added some extra strings to the debug output when it bails.
This happens when any DNS name is used with
geth attach ...
and the server has not specified that same DNS name via--rpcvhosts