-
Notifications
You must be signed in to change notification settings - Fork 36
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
IndexError: bytearray index out of range #511
Comments
Interesting... Do you know the server owner? If so, what is server's software and version? Also, https://mcstatus.io and https://mcsrvstat.us can't get the status too |
Nope, my minecraft server scanner just throws an error each time it pings it |
I got |
Seems to be offline right now. I get those errors occasionly when scanning the internet I will update you if I find another server that is currently online |
Alright it just happened with 45.159.6.50:26062 |
Whatever it is, I'm sure that we should look at what server answers (it's an error in low-level server answer parsing system). Try to get this error with traceback-with-variables installed. If it will not display any useful info, I will try to build special debug version. |
Running it now. After my last reply it happened two more times, again, the server seems to be offline. |
Have you catched it with traceback-with-variables installed? If so, can you provide the traceback please? |
Sadly I am running it on screen, and for some reason it doesn‘t allow me to scroll up (even though I have it enabled on screen). I only get partial variables because of this. I am currently trying to log it into a file. |
Got it!
|
Okay, we need to do more for debugging this. Currently it doesn't show anything important, because of hiding object attributes while printing it. I will try to find a way to save some dump for later debug (so you can transfer it to us). I guess it's named memory dumps. |
So, it's ready. I added some more information to the class instance, so we will see what a server answered. It might be quite slower, but it should be negligible. Just do pip install git+https://github.com/PerchunPak/mcstatus.git@debug (keep your |
Throws an error about every second ping :/
|
Welp seems like debug doesn't have a favicon anymore |
Oh nvm that's a new version thing |
Running debug now, wondering why JSR.favicon got removed in the new version though |
That was done as a part of #306, this rename along with a lot of other changes are not yet released, but that's what the next version of mcstatus will use (there's a pre-release already though) However there probably should've been a deprecated fallback, you shouldn't be seeing a hard exception there, just a warning; CC @PerchunPak |
Got the error!
|
I got it. You were right, the server doesn't send the full answer, but only a part. |
Can you also try to catch the error with code from #512?
|
Nothing changed, still got the old error
|
Yes, because this is a debug version. I pushed a new branch, use
|
Worked!
|
Nevermind, reopen this |
Do you have any logs with errors? If so, it'd be really nice to create some kind of graph of what errors were raised (this also could help us with #307). You can also just send it in raw format. |
Anyway, I reproduced it. The traceback is Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2022.1.4\plugins\python\helpers\pydev\pydevconsole.py", line 364, in runcode
coro = func()
^^^^^^
File "<input>", line 2, in <module>
File "C:\Users\perch\Desktop\programming\mcstatus\mcstatus\server.py", line 164, in status
return self._retry_status(connection, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\perch\Desktop\programming\mcstatus\mcstatus\utils.py", line 53, in sync_wrapper
raise last_exc # type: ignore # (This won't actually be unbound)
^^^^^^^^^^^^^^
File "C:\Users\perch\Desktop\programming\mcstatus\mcstatus\utils.py", line 49, in sync_wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\perch\Desktop\programming\mcstatus\mcstatus\server.py", line 170, in _retry_status
result = pinger.read_status()
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\perch\Desktop\programming\mcstatus\mcstatus\pinger.py", line 67, in read_status
response = self.connection.read_buffer()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\perch\Desktop\programming\mcstatus\mcstatus\protocol\connection.py", line 140, in read_buffer
length = self.read_varint()
^^^^^^^^^^^^^^^^^^
File "C:\Users\perch\Desktop\programming\mcstatus\mcstatus\protocol\connection.py", line 68, in read_varint
part = self.read(1)[0]
^^^^^^^^^^^^
File "C:\Users\perch\Desktop\programming\mcstatus\mcstatus\protocol\connection.py", line 220, in read
raise IOError("Server did not respond with any information!")
OSError: Server did not respond with any information! I also found that this error is on v11 but not on v10, so I ran Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2022.1.4\plugins\python\helpers\pydev\pydevconsole.py", line 364, in runcode
coro = func()
^^^^^^
File "<input>", line 2, in <module>
File "C:\Users\perch\Desktop\programming\mcstatus\mcstatus\server.py", line 164, in status
return self._retry_status(connection, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\perch\Desktop\programming\mcstatus\mcstatus\server.py", line 170, in _retry_status
result = pinger.read_status()
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\perch\Desktop\programming\mcstatus\mcstatus\pinger.py", line 75, in read_status
return JavaServerResponse.build(raw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\perch\Desktop\programming\mcstatus\mcstatus\status_response.py", line 124, in build
_validate_data(raw, "status", [("players", dict), ("version", dict), ("description", str)])
File "C:\Users\perch\Desktop\programming\mcstatus\mcstatus\status_response.py", line 62, in _validate_data
raise TypeError(
TypeError: Invalid status object (expected 'description' to be <class 'str'>, was <class 'dict'>) Which shows the problem, that we looked for: Our extraneous validation is incorrect. I will count as a fix, removing it entirely. P.S. DB with most raised errors would really help us with #307, so we will appreciate if you will send us it even if the bug is resolved. If you are not willing to write such a collector, please DM me. |
@DAMcraft would be great if you will try the patch
|
Reopening this, as #515 should be merged too before closing. |
This happens for example using JavaServer.lookup() with the following ip: 135.148.100.83:25572
Traceback:
The text was updated successfully, but these errors were encountered: