SpockBotMC / SpockBot

High level Python framework for building Minecraft clients and bots.
MIT License
198 stars 47 forks source link

Error -5 while decompressing data #210

Open DefinitlyEvil opened 8 years ago

DefinitlyEvil commented 8 years ago

When I try to join ArkhamNetwork, this happened:

[INFO]: > :
Traceback (most recent call last):
  File "example.py", line 84, in <module>
    client.start(SERVER, 25565)
  File "D:\Programs\Python35\lib\site-packages\spockbot-0.1.3-py3.5.egg\spockbot\plugins\helpers\start.py", line 34, in start
  File "D:\Programs\Python35\lib\site-packages\spockbot-0.1.3-py3.5.egg\spockbot\plugins\core\event.py", line 25, in event_loop
  File "D:\Programs\Python35\lib\site-packages\spockbot-0.1.3-py3.5.egg\spockbot\plugins\core\event.py", line 34, in run_continuous
  File "D:\Programs\Python35\lib\site-packages\spockbot-0.1.3-py3.5.egg\spockbot\plugins\core\event.py", line 62, in emit
  File "D:\Programs\Python35\lib\site-packages\spockbot-0.1.3-py3.5.egg\spockbot\plugins\core\net.py", line 192, in tick
  File "D:\Programs\Python35\lib\site-packages\spockbot-0.1.3-py3.5.egg\spockbot\plugins\core\event.py", line 62, in emit
  File "D:\Programs\Python35\lib\site-packages\spockbot-0.1.3-py3.5.egg\spockbot\plugins\core\net.py", line 208, in handle_recv
  File "D:\Programs\Python35\lib\site-packages\spockbot-0.1.3-py3.5.egg\spockbot\plugins\core\net.py", line 132, in read_packet
  File "D:\Programs\Python35\lib\site-packages\spockbot-0.1.3-py3.5.egg\spockbot\mcp\mcpacket.py", line 56, in decode
zlib.error: Error -5 while decompressing data: incomplete or truncated stream
nickelpro commented 8 years ago

I have literally never seen this error, I'll check it out when I get home

DefinitlyEvil commented 8 years ago

@nickelpro Maybe because I am using Windows. xD

nickelpro commented 8 years ago

I can't reproduce this unfortunately, which means it's hard for me to debug. The only thing that can really cause this problem is the packet stream desync but that should cause problems outside of just decompression failing. So I'll leave this open in hopes that more data on the exact circumstances that cause it appear

DefinitlyEvil commented 8 years ago

@nickelpro Will network lag cause this?

nickelpro commented 8 years ago

No, you have a truncated stream which means we read an incorrect amount of bytes into a packet buffer, which means we read a packet header incorrectly, which means our packet stream desync'd somehow.

That's a long list of things that went wrong and there is a lot of code that is supposed to detect that happening and apparently didn't. No idea what could cause this.

DefinitlyEvil commented 8 years ago

@nickelpro xD Okay.

AlexLamprianidis commented 7 years ago

I am getting a very similiar error

[INFO]: Attempting to authenticate with Mojang session server
[INFO]: Session authentication successful
[INFO]: My position: PlayerPosition(0, 0, 0) pitch: 0.0 yaw: 0.0
[INFO]: Chat message received: [20:52:47] <<< (0x03, 0x02): Chat Message                  {'position': 1, 'json_data': {u'text': u'', u'extra': [{u'color': u'white', u'text': u' '}, {u'color': u'white', u'text': u' '}, {u'color': u'dark_blue', u'text': u' '}, {u'color': u'black', u'text': u' '}, {u'color': u'dark_green', u'text': u' '}, {u'color': u'white', u'text': u' '}, {u'color': u'white', u'text': u' '}, {u'color': u'dark_green', u'text': u' '}, {u'color': u'black', u'text': u' '}, {u'color': u'dark_red', u'text': u' '}, {u'color': u'dark_aqua', u'text': u' '}, {u'color': u'blue', u'text': u' '}, {u'color': u'dark_green', u'text': u' '}, {u'color': u'black', u'text': u' '}, {u'color': u'black', u'text': u' '}, {u'color': u'dark_aqua', u'text': u' '}, {u'color': u'blue', u'text': u' '}, {u'color': u'dark_green', u'text': u' '}, {u'color': u'black', u'text': u' '}, {u'color': u'black', u'text': u' '}, {u'color': u'dark_aqua', u'text': u' '}, {u'color': u'blue', u'text': u' '}, {u'color': u'dark_green', u'text': u' '}, {u'color': u'black', u'text': u' '}, {u'color': u'black', u'text': u' '}, {u'color': u'dark_aqua', u'text': u' '}, {u'color': u'gold', u'text': u' '}, {u'color': u'dark_aqua', u'text': u' '}, {u'color': u'gold', u'text': u' '}, {u'color': u'dark_aqua', u'text': u' '}, {u'color': u'gold', u'text': u' '}, {u'color': u'dark_aqua', u'text': u' '}, {u'color': u'gold', u'text': u' '}, {u'color': u'dark_aqua', u'text': u' '}, {u'color': u'gold', u'text': u' '}, {u'color': u'dark_aqua', u'text': u' '}, {u'color': u'gold', u'text': u' '}]}}
[DEBUG]: EVENTCORE: Exception while emitting select_recv 3
[DEBUG]: EVENTCORE: Exception while emitting event_tick None
Traceback (most recent call last):
  File "example.py", line 52, in <module>
    client.start('play.primemc.org', 25565)
  File "/home/pi/Desktop/SpockBot/spockbot/plugins/helpers/start.py", line 34, in start
    self.event.event_loop()
  File "/home/pi/Desktop/SpockBot/spockbot/plugins/core/event.py", line 29, in event_loop
    self.run_continuous()
  File "/home/pi/Desktop/SpockBot/spockbot/plugins/core/event.py", line 36, in run_continuous
    self.emit('event_tick')
  File "/home/pi/Desktop/SpockBot/spockbot/plugins/core/event.py", line 62, in emit
    if handler(event, d) == EVENT_UNREGISTER:
  File "/home/pi/Desktop/SpockBot/spockbot/plugins/core/net.py", line 160, in tick
    self.net.select.poll()
  File "/home/pi/Desktop/SpockBot/spockbot/plugins/core/select.py", line 70, in poll
    self.event.emit('select_%s' % kind, sock.fileno())
  File "/home/pi/Desktop/SpockBot/spockbot/plugins/core/event.py", line 62, in emit
    if handler(event, d) == EVENT_UNREGISTER:
  File "/home/pi/Desktop/SpockBot/spockbot/plugins/core/net.py", line 176, in handle_recv
    self.net.read_packet(data)
  File "/home/pi/Desktop/SpockBot/spockbot/plugins/core/net.py", line 101, in read_packet
    )).decode(self.rbuff, self.comp_state)
  File "/home/pi/Desktop/SpockBot/spockbot/mcp/mcpacket.py", line 56, in decode
    body_data = zlib.decompress(pbuff.flush(), zlib.MAX_WBITS)
zlib.error: Error -5 while decompressing data: incomplete or truncated stream

I am running it on rasbian btw