Skip to content
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

AttributeError: 'NoneType' object has no attribute 'ack' (Not fixed with duplicate threads' solutions) #6271

Closed
3 tasks done
StephenDeVita opened this issue Jan 7, 2021 · 1 comment
Labels
invalid This is not right.

Comments

@StephenDeVita
Copy link

StephenDeVita commented Jan 7, 2021

Summary

Bot runs as normal, occasionally crashes due to the NoneType error.

Reproduction Steps

Cannot consistently reproduce this. This error occurs around every 3 days.

Expected Results

Bot runs as usual with no problem.

Actual Results

Traceback (most recent call last):
File "D:/Downloads2/Pycharm projects/DiscordBot2/DiscordBot2.py", line 32, in
client.run('bot_token')
File "D:\Downloads2\Pycharm projects\DiscordBot2\lib\site-packages\discord\client.py", line 678, in run
return future.result()
File "D:\Downloads2\Pycharm projects\DiscordBot2\lib\site-packages\discord\client.py", line 658, in runner
await self.start(*args, **kwargs)
File "D:\Downloads2\Pycharm projects\DiscordBot2\lib\site-packages\discord\client.py", line 622, in start
await self.connect(reconnect=reconnect)
File "D:\Downloads2\Pycharm projects\DiscordBot2\lib\site-packages\discord\client.py", line 524, in connect
await self.ws.poll_event()
File "D:\Downloads2\Pycharm projects\DiscordBot2\lib\site-packages\discord\gateway.py", line 504, in poll_event
await self.received_message(msg.data)
File "D:\Downloads2\Pycharm projects\DiscordBot2\lib\site-packages\discord\gateway.py", line 401, in received_message
self._keep_alive.ack()
AttributeError: 'NoneType' object has no attribute 'ack'

Checklist

  • I have searched the open issues for duplicates.

There are 2 duplicate threads with this issue: Thread1 and Thread2. However, the solutions presented in both of these threads do not solve the issue

  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

System Information

  • Python v3.8.6-final
  • discord.py v1.5.1-final
  • aiohttp v3.6.2
  • system info: Windows 10 10.0.19041
@StephenDeVita StephenDeVita added the bug This is a bug with the library. label Jan 7, 2021
@Rapptz
Copy link
Owner

Rapptz commented Jan 7, 2021

Based on the traceback you've included with line numbers, this is not v1.5.1. In v1.5.1 it is impossible to run into this because there is a None check. Note that the ack happens in line 460, not 401 in the current version.

Please update your library in your virtual environment before making a duplicate issue.

@Rapptz Rapptz closed this as completed Jan 7, 2021
@Rapptz Rapptz added invalid This is not right. and removed bug This is a bug with the library. labels Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This is not right.
Projects
None yet
Development

No branches or pull requests

2 participants