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

Abnormal sessions replace causing crashes #525

Open
3 tasks done
BlueSchnabeltier opened this issue Jun 22, 2023 · 9 comments
Open
3 tasks done

Abnormal sessions replace causing crashes #525

BlueSchnabeltier opened this issue Jun 22, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@BlueSchnabeltier
Copy link

BlueSchnabeltier commented Jun 22, 2023

Summary

After running commands a lot of times i get an error that says it's unable to get the session.

Reproduction Steps

Run commands a lot. A lot lot.

Code

async for command in thread.slash_commands(command_ids=[...]):
    await command(prompt=prompt)

Expected Results

It should execute the command.

Actual Results

It raises this error:

[2023-06-22 06:49:51] [ERROR   ] discord.app_commands.tree: Ignoring exception in command 'xxxxxxx'
Traceback (most recent call last):
  File "C:\Users\User\PycharmProjects\...\venv\lib\site-packages\discord\app_commands\commands.py", line 828, in _do_call
    return await self._callback(interaction, **params)  # type: ignore
  File "C:\Users\User\PycharmProjects\...\main.py", line 96, in xxxxxxx
    generation = await xxxxxxxxxxxxxxxxx.xxxxxxx(prompt, thread_id=thread.id)
  File "C:\Users\User\PycharmProjects\...\utils\midjourney.py", line 166, in xxxxxxx
    await client.start(self.__token)
  File "C:\Users\User\PycharmProjects\...\venv\lib\site-packages\selfcord\client.py", line 888, in start
    await self.connect(reconnect=reconnect)
  File "C:\Users\User\PycharmProjects\...\venv\lib\site-packages\selfcord\client.py", line 769, in connect
    await self.ws.poll_event()
  File "C:\Users\User\PycharmProjects\...\venv\lib\site-packages\selfcord\gateway.py", line 648, in poll_event
    await self.received_message(msg.data)
  File "C:\Users\User\PycharmProjects\...\venv\lib\site-packages\selfcord\gateway.py", line 598, in received_message
    func(data)
  File "C:\Users\User\PycharmProjects\...\venv\lib\site-packages\selfcord\state.py", line 1066, in parse_ready_supplemental
    self.parse_sessions_replace(data['sessions'], from_ready=True)
  File "C:\Users\User\PycharmProjects\...\venv\lib\site-packages\selfcord\state.py", line 1511, in parse_sessions_replace
    fake = data[self.session_id]  # type: ignore
KeyError: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' # <- This is the seesion id, I just didn't wanna show mine.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\User\PycharmProjects\...\venv\lib\site-packages\discord\app_commands\tree.py", line 1248, in _call
    await command._invoke_with_namespace(interaction, namespace)
  File "C:\Users\User\PycharmProjects\...\venv\lib\site-packages\discord\app_commands\commands.py", line 853, in _invoke_with_namespace
    return await self._do_call(interaction, transformed_values)
  File "C:\Users\User\PycharmProjects\...\venv\lib\site-packages\discord\app_commands\commands.py", line 846, in _do_call
    raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'xxxxxxx' raised an exception: KeyError: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' # <- This is the seesion id, I just didn't wanna show mine.

System Information

  • Python v3.10.8-final
  • selfcord.py v2.1.0-alpha
    • selfcord.py metadata: v2.1.0a4341+g08588492
  • aiohttp v3.8.4
  • system info: Windows 10 10.0.19044

Checklist

  • I have searched the open issues for duplicates.
  • I have shared the entire traceback.
  • I am using a user token (and it isn't visible in the code).

Additional Information

No response

@BlueSchnabeltier BlueSchnabeltier added the unconfirmed bug Unconfirmed bug label Jun 22, 2023
@inas2000
Copy link

Me too

@oliverisracing
Copy link

Hey i’m getting this too

@JRYT431
Copy link

JRYT431 commented Jun 24, 2023

Me too

@itskekoff
Copy link

lol wtf, i don't getting this error, maybe because i just finding slash command by query and executing it.

@BlueSchnabeltier
Copy link
Author

i hope @dolfies will look into this

@PixelSleuth
Copy link

Me too

1 similar comment
@GrahamboJangles
Copy link

Me too

@BlueSchnabeltier
Copy link
Author

lol wtf, i don't getting this error, maybe because i just finding slash command by query and executing it.

that has literally nothing to do with it

@dolfies
Copy link
Owner

dolfies commented Jun 24, 2023

I'm unable to reproduce this. I'd appreciate someone sending full debug logs when this occurs.

@dolfies dolfies changed the title discord.app_commands.errors.CommandInvokeError: Command '<COMMAND NAME>' raised an exception Abnormal sessions replace causing crashes Aug 14, 2023
@dolfies dolfies added bug Something isn't working and removed unconfirmed bug Unconfirmed bug labels Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants