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 |
| 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.
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.
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