-
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
[Errno 57] Socket is not connected #543
Comments
Can you provide all commands to reproduce? |
Nevermind, just saw that you use query. Is the status okay? Is the async status and async query okay? Try to run this. import asyncio
import mcstatus
server = mcstatus.JavaServer.lookup("mc.sturk.au:25565")
async def test():
try:
server.status()
except Exception as exc:
print(f"Status is not okay: {exc}")
else:
print("Status is okay")
try:
await server.async_status()
except Exception as exc:
print(f"Async status is not okay: {exc}")
else:
print("Async status is okay")
try:
await server.async_query()
except Exception as exc:
print(f"Async query is not okay: {exc}")
else:
print("Async query is okay")
if __name__ == "__main__":
asyncio.run(test()) |
hello i ran that and it returned an error, what do you mean all commands to reproduce? as in the whole error message? File "c:\Users\Sami\Documents\VSCode Projects\python-ssh\main.py", line 4, in |
Oh, my error. Updated the comment, try again.
How do you run the container? |
i ran it now and it says both status and async status is ok however it said async query is not ok. Its just a paper mc server within a docker container, to run i just run a basic .sh file i set up |
Nevermind, I reproduced it with Run |
this is what was put in the log.txt |
i run the staff++ plugin, i dont think this should cause any issues. I also only have the port 22565 open on my router settings. I haven't set a certain query port in the server config properties |
Query must be enabled in server.properties. Additionally, the UDP port for query defaults to 25565, and any firewalls must also allow the UDP traffic. |
Yeah, this is probably just another query isn't enabled or accessible issue, but what surprises me is the error message. I'd expect the error on connection getting established, not on closing. |
Well the error is that the socket was never connected. The exit methods attempt a losing a socket that was never connected. |
Closing this as a duplicate of #489 |
Yes, but I wouldn't even expect it to make it past Line 193 in 0f66b5c
mcstatus/mcstatus/protocol/connection.py Line 548 in 0f66b5c
Although now that I'm thinking of it, UDP connections don't really do any sort of handshake, so I suppose it makes sense. |
Sorry for such delay, just want to mention that I got |
Yeah, the screenshot not being complete makes a lot more sense actually, even though UDP would probably indeed let you get past |
Hello, when I run this piece of code to get the players online, it tells me the number of players online however throws out an error when I query to see which players are online. I have the port forwarding set up correctly and the server is ran on Debian 11 in a docker container.
The text was updated successfully, but these errors were encountered: