mcstatus: IndexError: bytearray index out of range
This happens for example using JavaServer.lookup() with the following ip: 135.148.100.83:25572
Traceback:
Traceback (most recent call last):
File "/root/ServerSeeker/scan.py", line 42, in scan_chunk
status = JavaServer.lookup(f"{ip}:{port}").status()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/mcstatus/server.py", line 128, in status
return self._retry_status(connection, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/mcstatus/utils.py", line 66, in sync_wrapper
raise last_exc # type: ignore # (This won't actually be unbound)
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/mcstatus/utils.py", line 62, in sync_wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/mcstatus/server.py", line 134, in _retry_status
result = pinger.read_status()
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/mcstatus/pinger.py", line 116, in read_status
if response.read_varint() != 0:
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/mcstatus/protocol/connection.py", line 254, in read_varint
part = self.read(1)[0]
~~~~~~~~~~~~^^^
IndexError: bytearray index out of range
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 28 (28 by maintainers)
Commits related to this issue
- Try to debug #511 — committed to PerchunPak/mcstatus by PerchunPak a year ago
Worked!
Can you also try to catch the error with code from #512?