Closed se-bastiaan closed 3 years ago
I have temporarily patched this on production to prevent problems with some hideous code.
Could share the temporary code?
uh I could have, but I kinda forgot this so when we updated to the latest master that went into the shredder :')
Unhandled exception in internal background task 'auto_full_sync'.
Traceback (most recent call last):
File "/home/deploy/.cache/pypoetry/virtualenvs/bot-tq7C0_9c-py3.8/lib64/python3.8/site-packages/discord/ext/tasks/__init__.py", line 101, in _loop
await self.coro(*args, **kwargs)
File "/opt/app/bot/cogs/sync.py", line 86, in auto_full_sync
await self._full_sync()
File "/opt/app/bot/cogs/sync.py", line 81, in _full_sync
await sync_members(members, membergroups, guild, True)
File "/opt/app/common/discord_helper.py", line 120, in sync_members
discord_user = await guild.fetch_member(member["discord"])
File "/home/deploy/.cache/pypoetry/virtualenvs/bot-tq7C0_9c-py3.8/lib64/python3.8/site-packages/discord/guild.py", line 1309, in fetch_member
data = await self._state.http.get_member(self.id, member_id)
File "/home/deploy/.cache/pypoetry/virtualenvs/bot-tq7C0_9c-py3.8/lib64/python3.8/site-packages/discord/http.py", line 243, in request
raise NotFound(r, data)
discord.errors.NotFound: 404 Not Found (error code: 10007): Unknown Member```
if not discord_user:
try:
discord_user = await guild.fetch_member(member["discord"])
except:
continue
Describe the bug
Full sync crashes when people leave the Discord
How to reproduce
Steps to reproduce the behaviour:
Expected behaviour
No crashes and the member is removed from DDB