dolfies / discord.py-self

A fork of the popular discord.py for user accounts.
https://discordpy-self.rtfd.io/en/latest/
MIT License
688 stars 160 forks source link

Could not decompress, Error -3 while decompressing data: invalid stored block lengths #565

Closed xabaddonx1 closed 1 year ago

xabaddonx1 commented 1 year ago

Summary

Getting could not decompress error from selfcord randomly

Reproduction Steps

Every once in awhile after selfcord has been connected for awhile, I will get this error. I am running the selfcord named version of discord.py-self

Code

@bot.on("ready")
async def on_ready(time):
  ...

@bot.on("message")
async def on_message(message):
  ...

@bot.run(TOKEN)

Expected Results

I do not see this error.

Actual Results

Every once in awhile after selfcord has been connected for awhile, I will get this error.

Could not decompress. With exception "Error -3 while decompressing data: invalid stored block lengths"

stack: recv_msg, gateway.py:339 start, gateway.py:580 runner, bot.py:93 _run, events.py:80 _run_once, base_events.py:1881 run_forever, base_events.py:595 run_forever, windows_events.py:316 run_until_complete, base_events.py:628 run, runners.py:44 run, bot.py:102

### System Information - Python v3.10.0-final - discord.py v2.3.2-final - aiohttp v3.8.2 - system info: Windows 10 10.0.19045 ### Checklist - [X] I have searched the open issues for duplicates. - [X] I have shared the entire traceback. - [X] I am using a user token (and it isn't visible in the code). ### Additional Information _No response_
Levcqh commented 1 year ago

i have the same issues and i want to fix it

Traceback (most recent call last): File "C:\Users\gamer\Desktop\Transe Tool\selfbot.py", line 56, in bot.run("MY TOKEN") File "C:\Users\gamer\Desktop\Transe Tool\discord.py-self\discord\client.py", line 907, in run asyncio.run(runner()) File "C:\Users\gamer\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "C:\Users\gamer\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gamer\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "C:\Users\gamer\Desktop\Transe Tool\discord.py-self\discord\client.py", line 904, in runner await self.start(*args, **kwargs) File "C:\Users\gamer\Desktop\Transe Tool\discord.py-self\discord\client.py", line 878, in start await self.login(token) File "C:\Users\gamer\Desktop\Transe Tool\discord.py-self\discord\client.py", line 749, in login data = await state.http.static_login(token.strip()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gamer\Desktop\Transe Tool\discord.py-self\discord\http.py", line 726, in static_login await self.startup() File "C:\Users\gamer\Desktop\Transe Tool\discord.py-self\discord\http.py", line 391, in startup self.user_agent, self.browser_version, self.client_build_number = ua, bv, bn = await utils._get_info(session) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gamer\Desktop\Transe Tool\discord.py-self\discord\utils.py", line 1351, in _get_info bn = await _get_build_number(session) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gamer\Desktop\Transe Tool\discord.py-self\discord\utils.py", line 1360, in _get_build_number login_page = await login_page_request.text() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gamer\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\client_reqrep.py", line 1076, in text await self.read() File "C:\Users\gamer\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\client_reqrep.py", line 1032, in read self._body = await self.content.read() ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gamer\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\streams.py", line 370, in read block = await self.readany() ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gamer\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\streams.py", line 392, in readany await self._wait("readany") File "C:\Users\gamer\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\streams.py", line 306, in _wait await waiter aiohttp.client_exceptions.ClientPayloadError: 400, message='Can not decode content-encoding: br'

xabaddonx1 commented 1 year ago

Btw, after i get this error, although the program is still running it looks like I am not receiving any more discord messages.

dolfies commented 1 year ago

i have the same issues and i want to fix it

Traceback (most recent call last): File "C:\Users\gamer\Desktop\Transe Tool\selfbot.py", line 56, in bot.run("MY TOKEN") File "C:\Users\gamer\Desktop\Transe Tool\discord.py-self\discord\client.py", line 907, in run asyncio.run(runner()) File "C:\Users\gamer\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "C:\Users\gamer\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gamer\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "C:\Users\gamer\Desktop\Transe Tool\discord.py-self\discord\client.py", line 904, in runner await self.start(*args, **kwargs) File "C:\Users\gamer\Desktop\Transe Tool\discord.py-self\discord\client.py", line 878, in start await self.login(token) File "C:\Users\gamer\Desktop\Transe Tool\discord.py-self\discord\client.py", line 749, in login data = await state.http.static_login(token.strip()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gamer\Desktop\Transe Tool\discord.py-self\discord\http.py", line 726, in static_login await self.startup() File "C:\Users\gamer\Desktop\Transe Tool\discord.py-self\discord\http.py", line 391, in startup self.user_agent, self.browser_version, self.client_build_number = ua, bv, bn = await utils._get_info(session) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gamer\Desktop\Transe Tool\discord.py-self\discord\utils.py", line 1351, in _get_info bn = await _get_build_number(session) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gamer\Desktop\Transe Tool\discord.py-self\discord\utils.py", line 1360, in _get_build_number login_page = await login_page_request.text() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gamer\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\client_reqrep.py", line 1076, in text await self.read() File "C:\Users\gamer\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\client_reqrep.py", line 1032, in read self._body = await self.content.read() ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gamer\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\streams.py", line 370, in read block = await self.readany() ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gamer\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\streams.py", line 392, in readany await self._wait("readany") File "C:\Users\gamer\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\streams.py", line 306, in _wait await waiter aiohttp.client_exceptions.ClientPayloadError: 400, message='Can not decode content-encoding: br'

This is a completely different error; upgrade aiohttp or install brotli.

TheKidThatCodes commented 1 year ago

564

the code looks like its from the other one on pypi

dolfies commented 1 year ago

@TheKidThatCodes I cannot reproduce this. Can you send a complete traceback so I can look into this further?

TheKidThatCodes commented 1 year ago

?

dolfies commented 1 year ago

Sorry, mentioned the wrong person :) Meant to mention @xabaddonx1

xabaddonx1 commented 1 year ago

Sorry I posted the stack above but I don't know how to get a complete traceback if that is not complete.

I hit another one here where it showed a different exception beforehand (I have seen this "ConnectionClosedOk" exception only a couple times. Not sure if it is related.

` Task exception was never retrieved future: <Task finished name='Task-12' coro=<gateway.heartbeat() done, defined at C:\Users\Jason\PycharmProjects\option-strat\venv\lib\site-packages\selfcord\api\gateway.py:540> exception=ConnectionClosedOK(Close(code=1000, reason=''), Close(code=1000, reason=''), False)> Traceback (most recent call last): File "C:\Users\Jason\PycharmProjects\option-strat\venv\lib\site-packages\selfcord\api\gateway.py", line 550, in heartbeat await self.send_json(heartbeatJSON) File "C:\Users\Jason\PycharmProjects\option-strat\venv\lib\site-packages\selfcord\api\gateway.py", line 468, in send_json await self.ws.send(ujson.dumps(payload)) File "C:\Users\Jason\PycharmProjects\option-strat\venv\lib\site-packages\websockets\legacy\protocol.py", line 619, in send await self.ensure_open() File "C:\Users\Jason\PycharmProjects\option-strat\venv\lib\site-packages\websockets\legacy\protocol.py", line 920, in ensure_open raise self.connection_closed_exc() websockets.exceptions.ConnectionClosedOK: sent 1000 (OK); then received 1000 (OK) Reconnect websocket Could not decompress Error -3 while decompressing data: invalid stored block lengths Could not decompress Error -3 while decompressing data: invalid stored block lengths

Process finished with exit code 0 `

dolfies commented 1 year ago

This is not discord.py-self's renamed branch. You have probably accidentally installed a different selfcord library.

xabaddonx1 commented 1 year ago

So sorry you are right, my mistake.