Error on syncing slash commands/app commands
Summary
Our Bot gets an Error on startup mentioning a exeption in the on_connect
Reproduction Steps
- Updating the bot to Beta 3
- Using debug_guilds=[] with the guilds you want guild commands in. (commands.Bot())
- Having a slash commands and guild command in your code (in Cogs)
Minimal Reproducible Code
No response
Expected Results
The app commands and slash commands should sync/update in your debug guilds
Actual Results
Ignoring exception in on_connect
Traceback (most recent call last):
File "/home/container/.local/lib/python3.10/site-packages/discord/client.py", line 352, in _run_event
await coro(*args, **kwargs)
File "/home/container/.local/lib/python3.10/site-packages/discord/bot.py", line 1038, in on_connect
await self.sync_commands()
File "/home/container/.local/lib/python3.10/site-packages/discord/bot.py", line 540, in sync_commands
registered_commands = await self.register_commands(commands, force=force)
File "/home/container/.local/lib/python3.10/site-packages/discord/bot.py", line 382, in register_commands
commands = copy.deepcopy(commands)
File "/usr/local/lib/python3.10/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/usr/local/lib/python3.10/copy.py", line 206, in _deepcopy_list
append(deepcopy(a, memo))
File "/usr/local/lib/python3.10/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/usr/local/lib/python3.10/copy.py", line 271, in _reconstruct
state = deepcopy(state, memo)
File "/usr/local/lib/python3.10/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/usr/local/lib/python3.10/copy.py", line 231, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/local/lib/python3.10/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/usr/local/lib/python3.10/copy.py", line 271, in _reconstruct
state = deepcopy(state, memo)
File "/usr/local/lib/python3.10/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/usr/local/lib/python3.10/copy.py", line 231, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/local/lib/python3.10/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/usr/local/lib/python3.10/copy.py", line 271, in _reconstruct
state = deepcopy(state, memo)
File "/usr/local/lib/python3.10/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/usr/local/lib/python3.10/copy.py", line 231, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/local/lib/python3.10/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/usr/local/lib/python3.10/copy.py", line 271, in _reconstruct
state = deepcopy(state, memo)
File "/usr/local/lib/python3.10/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/usr/local/lib/python3.10/copy.py", line 231, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/local/lib/python3.10/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/usr/local/lib/python3.10/copy.py", line 271, in _reconstruct
state = deepcopy(state, memo)
File "/usr/local/lib/python3.10/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/usr/local/lib/python3.10/copy.py", line 231, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/local/lib/python3.10/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/usr/local/lib/python3.10/copy.py", line 271, in _reconstruct
state = deepcopy(state, memo)
File "/usr/local/lib/python3.10/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/usr/local/lib/python3.10/copy.py", line 231, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/local/lib/python3.10/copy.py", line 161, in deepcopy
rv = reductor(4)
TypeError: cannot pickle '_asyncio.Task' object
Intents
discord.Intents.all()
System Information
- Python v3.9.0-final
- py-cord v2.0.0-beta
- py-cord pkg_resources: v2.0.0b3
- aiohttp v3.8.1
- system info: Debian 10
Checklist
- [X] I have searched the open issues for duplicates.
- [X] I have shown the entire traceback, if possible.
- [X] I have removed my token from display, if visible.
Additional Context
No response
Additional Context: In our bot we don´t use a on_connect event
Seems the error occurs only when the slash command/app command is coded in a cog
Can reproduce with cogs, same issue (Debian 11).
I have the same problem (Debian 10).
Experiencing the same issue with a docker image of python:3.9-alpine. This is new since upgrading to v2.0.0b3
I get it on on_connect as per the original poster and with slash commands. The slash commands are all in cogs.
Oh, If you look closely at the error, it is subtly different between on_connect and the error when you use slash command:
Ignoring exception in on_interaction
Traceback (most recent call last):
File "/opt/pysetup/.venv/lib/python3.9/site-packages/discord/bot.py", line 731, in process_application_commands
command = self._application_commands[interaction.data["id"]]
KeyError: '930900980483125309'
During handling of the above exception, another exception occurred:
[...]
Duplicate of #911
Experiencing the same issue with a docker image of python:3.9-alpine. This is new since upgrading to v2.0.0b3
I get it on on_connect as per the original poster and with slash commands. The slash commands are all in cogs.
Oh, If you look closely at the error, it is subtly different between on_connect and the error when you use slash command:
Ignoring exception in on_interaction Traceback (most recent call last): File "/opt/pysetup/.venv/lib/python3.9/site-packages/discord/bot.py", line 731, in process_application_commands command = self._application_commands[interaction.data["id"]] KeyError: '930900980483125309' During handling of the above exception, another exception occurred: [...]
Please make a new issue for this
Experiencing the same issue with a docker image of python:3.9-alpine. This is new since upgrading to v2.0.0b3 I get it on on_connect as per the original poster and with slash commands. The slash commands are all in cogs. Oh, If you look closely at the error, it is subtly different between on_connect and the error when you use slash command:
Ignoring exception in on_interaction Traceback (most recent call last): File "/opt/pysetup/.venv/lib/python3.9/site-packages/discord/bot.py", line 731, in process_application_commands command = self._application_commands[interaction.data["id"]] KeyError: '930900980483125309' During handling of the above exception, another exception occurred: [...]Please make a new issue for this
@BobDotCom, it took me some time before I was back at my computer, so I updated to the fix for #911 and it resolved the issue. I think it was the same issue, just bubbling up differently depending on how the interaction was being called. As of the latest commit (4e8b396a) I can no longer reproduce the error.
Experiencing the same issue with a docker image of python:3.9-alpine. This is new since upgrading to v2.0.0b3 I get it on on_connect as per the original poster and with slash commands. The slash commands are all in cogs. Oh, If you look closely at the error, it is subtly different between on_connect and the error when you use slash command:
Ignoring exception in on_interaction Traceback (most recent call last): File "/opt/pysetup/.venv/lib/python3.9/site-packages/discord/bot.py", line 731, in process_application_commands command = self._application_commands[interaction.data["id"]] KeyError: '930900980483125309' During handling of the above exception, another exception occurred: [...]Please make a new issue for this
@BobDotCom, it took me some time before I was back at my computer, so I updated to the fix for #911 and it resolved the issue. I think it was the same issue, just bubbling up differently depending on how the interaction was being called. As of the latest commit (4e8b396) I can no longer reproduce the error.
So the issue is fixed on beta 3? Or will it take a bit till it will be pushed again to pypi?