-
-
Notifications
You must be signed in to change notification settings - Fork 456
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
nacl.exceptions.CryptoError: Decryption failed. Ciphertext failed verification #2033
Comments
I'm having the same issue. |
I am getting this too with voice chat bot when it tries to speak. It is happening quite a lot when it opens the text-to-speech generated .wav file and tries to broadcast it to voice chat. It doesn't happen every single time but it happens often, maybe one in 20 times. ` File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner File "/usr/lib/python3.9/threading.py", line 892, in run File "/home/user/.local/lib/python3.9/site-packages/discord/voice_client.py", line 863, in recv_audio File "/home/user/.local/lib/python3.9/site-packages/discord/voice_client.py", line 740, in unpack_audio File "/home/user/.local/lib/python3.9/site-packages/discord/sinks/core.py", line 113, in init File "/home/user/.local/lib/python3.9/site-packages/discord/voice_client.py", line 611, in _decrypt_xsalsa20_poly1305_lite File "/home/user/.local/lib/python3.9/site-packages/nacl/secret.py", line 149, in decrypt File "/home/user/.local/lib/python3.9/site-packages/nacl/bindings/crypto_secretbox.py", line 79, in crypto_secretbox_open File "/home/user/.local/lib/python3.9/site-packages/nacl/exceptions.py", line 88, in ensure nacl.exceptions.CryptoError: Decryption failed. Ciphertext failed verification` |
Summary
I'm using a bot based on pycord during long conversations on discord. Sometimes (it occur very rarely tho) a nacl.exceptions.CryptoError is raised, and i have no way to handle it other than monkey patch
Reproduction Steps
Well it occur so rarely, it's hard to reproduce...
It happens often after the bot is being listening for a long time.
Minimal Reproducible Code
Expected Results
That it doesn't crash
Actual Results
Exception in thread Thread-4:
Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
self.run()
File "/usr/lib/python3.9/threading.py", line 892, in run
self._target(*self._args, **self._kwargs)
File "/home/ubuntu/.local/lib/python3.9/site-packages/discord/voice_client.py", line 814, in recv_audio
self.unpack_audio(data)
File "/home/ubuntu/.local/lib/python3.9/site-packages/discord/voice_client.py", line 696, in unpack_audio
data = RawData(data, self)
File "/home/ubuntu/.local/lib/python3.9/site-packages/discord/sinks/core.py", line 112, in init
self.decrypted_data = getattr(self.client, f"decrypt{self.client.mode}")(
File "/home/ubuntu/.local/lib/python3.9/site-packages/discord/voice_client.py", line 611, in _decrypt_xsalsa20_poly1305_lite
return self.strip_header_ext(box.decrypt(bytes(data), bytes(nonce)))
File "/home/ubuntu/.local/lib/python3.9/site-packages/nacl/secret.py", line 149, in decrypt
plaintext = nacl.bindings.crypto_secretbox_open(
File "/home/ubuntu/.local/lib/python3.9/site-packages/nacl/bindings/crypto_secretbox.py", line 79, in crypto_secretbox_open
ensure(
File "/home/ubuntu/.local/lib/python3.9/site-packages/nacl/exceptions.py", line 88, in ensure
raise raising(*args)
nacl.exceptions.CryptoError: Decryption failed. Ciphertext failed verification
Intents
intents = discord.Intents.default() # Privileged message content intent intents.message_content = True # Guild members intents.members = True
System Information
Checklist
Additional Context
No response
The text was updated successfully, but these errors were encountered: