Closed EnderInvader closed 5 years ago
The server says Query running on 0.0.0.0:25565
If the server runs on 0.0.0.0:25565
that only means the server will respond on all network addresses the machine he's running on has assigned to itself. If you entered that as server address you need to change that to a real network address pointing to that server. 127.0.0.1
( localhost
) e.g. if it's on the same machine.
The server address is set to my public ip, but the query is set to 0.0.0.0 and I don't know why. I think that is why query() isn't working.
Do I need the change the server-ip= in the server.properties file?
I guess you're not setting your mcstatus up correctly.
Take a look at this (from the readMe):
# If you know the host and port, you may skip this and use MinecraftServer("example.org", 1234)
server = MinecraftServer.lookup("example.org:1234")
example.org
needs to be your domain/address in your case.
Whatever you edit in the server.properties
does only change to what address the MC server answers to not that you don't provide the correct address to mcstatus.
I have my address correctly in place the status() and ping() work just fine, the query() is the only one that doesn't work.
Did you also make sure that server querying is enabled in your server.properties?
You should search for enable-query=
My server is also no longer responding to query. Ping and status work as expected, query does not though.
minecraft@anmc7 [~]# mcstatus localhost ping 1.167ms minecraft@anmc7 [~]# mcstatus localhost status version: v1.12.1 (protocol 338) description: "{u'text': u'1.12 Polly want a block? SQUAWK'}" players: 1/20 ['me (e9xxxxd6-xxxx-xxxx-xxxx-f7dcxxxxea7b)'] minecraft@anmc7 [~]# mcstatus localhost query Traceback (most recent call last): File "/bin/mcstatus", line 9, inload_entry_point('mcstatus==2.2', 'console_scripts', 'mcstatus')() File "/usr/lib64/python2.7/site-packages/click/core.py", line 722, in __call__ return self.main(*args, **kwargs) File "/usr/lib64/python2.7/site-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/usr/lib64/python2.7/site-packages/click/core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/lib64/python2.7/site-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/lib64/python2.7/site-packages/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "/usr/lib/python2.7/site-packages/mcstatus/scripts/mcstatus.py", line 79, in query response = server.query() File "/usr/lib/python2.7/site-packages/mcstatus/server.py", line 82, in query raise exception socket.timeout: timed out
I say no longer because something changed and I haven't narrowed it down yet. I was good until 9:50pm tonight. I use zabbix to graph and log the data. https://www.dropbox.com/s/4y3hkxd3k3xzxy3/Screenshot%202017-08-26%2022.59.07.png?raw=1
CentOS7, enable-query=true
, query.port=25565
Mine is resolved now. In my case "localhost" quit working. I was able to set it to my actual external hostname and now it resolves fine. Not sure why localhost quit working for query only though.
Did you set a bind address in the server.properties?
server-ip is blank. I'm behind a firewall with port forwarding.
Hmm... that's weird but if using the fully qualified domain resolves that I guess it's not that big of a deal.
Right. I'm really frustrated that I didn't notice it until after I had done a number of updates and changes on the MC server so I have no way to pinpoint the change made that caused it to no longer work with just "localhost".
For the record I'll add that it now works with localhost again. I have no idea what changed or why it now works with localhost again.
# mcstatus localhost query host: 192.168.x.x:25565 software: v1.12.1 vanilla plugins: [] motd: "witty motd" players: 0/20 []
If I'm reading this correctly, the issue appears resolved.
I can't get the query() to work. I have enable-query set to true. I am just running the example code on the front page.
Traceback (most recent call last): File "C:/Users/User/Desktop/server_status.py", line 17, in <module> query = server.query() File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\mcstatus\server.py", line 82, in query raise exception File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\mcstatus\server.py", line 77, in query querier.handshake() File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\mcstatus\querier.py", line 32, in handshake packet = self._read_packet() File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\mcstatus\querier.py", line 25, in _read_packet packet.receive(self.connection.read(self.connection.remaining())) File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\mcstatus\protocol\connection.py", line 175, in read result.extend(self.socket.recvfrom(self.remaining())[0]) socket.timeout: timed out