-
Notifications
You must be signed in to change notification settings - Fork 37
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
JavaServer ping() always fails? ("did not respond with any information") #850
Comments
After poking in Wireshark, I can't find a discrepancy. The Python is sending the handshake and ping packet correctly. The server is closing the connection without sending any bytes, and the Python is handling that closure. |
can reproduce |
Is a status packet required before ping? Wiki.vg says no, but performing a status first in the connection seems to fix it. I don't know if this caused by the protocol or a socket bug in mcstatus. |
Apparently, we already saw this bug in #491. worth looking for why it wasn't already fixed on the server implementations side Not closing this, because we should probably add a note to docs about this. |
I see, would it be a good idea to implement ping in using status, then? Maybe ping can automatically fallback to status. I imagine this is what the vast majority of users would prefer. For ping purposes, you could abort the connection after reading the status response ID to avoid deserialising the whole response. |
Closing as a duplicate of #491 |
I don't see a point in clinging onto a function that works on only a fraction of active servers? Regardless of technical correctness, this is a disaster for the user experience, and at the very least needs an easily discoverable warning. |
I do agree that we can add a note/warning to the Making an additional status request before ping is very wasteful from our side and using status packet instead of ping for the ping method makes no sense, at that point, just use We already manually count the time it took for the server to respond when you're using We could also consider deprecating |
I'd support implementing ping() entirely in terms of a status packet. I don't see a need to remove ping(), introducing a breaking change and pushing this task onto every user of the library. With an implementation as Finally, there is a rare possibility, mentioned in #491 (comment), where a server might support ping but not status. It would be useful to keep the real ping accessible for such cases (either through a flag or different method name). Personally, I think performing an automatic fallback (try ping, then status) would be best. This would allow you to print an informative warning if the first ping fails, so users know to file an issue with the server software. I don't feel strongly about fallback vs only using status, however. |
Reopening this, since discussion is not over and we definitely have to add a note/warning to docs about this. Anyway, I agree with ItsDrike, it's server implementations who don't follow the spec, and appropriate bug report should be opened at their repos. |
You could even re-raise the OSError with more informative/friendly error text which would put the information somewhere users will definitely see. |
Yeah, that is even better solution. If I won't forget, I will create a PR for this |
I also agree it would be wasteful to request full status from the server and not use it, hence ping should be separate and standalone. Adding the documentation tag for this, but I have concern that this particular OSError is indistinguishable from legitimate cases where the server crashes or a firewall drops the response. |
Sure, you could report to the user "if |
You can check against error message |
ping
doesn't seem to work for any servers I've tested, most of which return:For example:
Note, this was tested through the CLI but I can't see why it would be CLI specific.
The text was updated successfully, but these errors were encountered: