flute
flute copied to clipboard
Could not initialize sodium
This may not be a bug on viola itself, but it's preventing us from loading the plugin :(
python: cargando el script "/home/fauno/.config/weechat/python/weechat_viola.py"
python: stdout/stderr: Traceback (most recent call last):
python: stdout/stderr: File "/home/fauno/.config/weechat/python/weechat_viola.py", line 24, in <module>
python: stdout/stderr: import viola.viola as viola
python: stdout/stderr: File "/home/fauno/.config/weechat/python/viola/viola.py", line 3, in <module>
python: stdout/stderr: import crypto
python: stdout/stderr: File "/home/fauno/.config/weechat/python/viola/crypto.py", line 8, in <module>
python: stdout/stderr: import nacl.signing
python: stdout/stderr: File "/usr/lib/python2.7/site-packages/nacl/signing.py", line 21, in <module>
python: stdout/stderr: import nacl.bindings
python: stdout/stderr: File "/usr/lib/python2.7/site-packages/nacl/bindings/__init__.py", line 97, in <module>
python: stdout/stderr: sodium_init()
python: stdout/stderr: File "/usr/lib/python2.7/site-packages/nacl/bindings/sodium_core.py", line 26, in sodium_init
python: stdout/stderr: raise CryptoError("Could not initialize sodium")
python: stdout/stderr: nacl.exceptions.CryptoError: Could not initialize sodium
python: no es posible analizar el archivo "/home/fauno/.config/weechat/python/weechat_viola.py"
we installed pynacl 1.0.1 from pip
Shit! I was encountering this bug in the past as well, but then it disappeared... I will try to reproduce it as soon as possible.
If you do the following patch to pynacl:
diff --git a/src/nacl/bindings/sodium_core.py b/src/nacl/bindings/sodium_core.py
index e45130b..1369c3e 100644
--- a/src/nacl/bindings/sodium_core.py
+++ b/src/nacl/bindings/sodium_core.py
@@ -22,5 +22,6 @@ def sodium_init():
Initializes sodium, picking the best implementations available for this
machine.
"""
- if lib.sodium_init() != 0:
- raise CryptoError("Could not initialize sodium")
+ retval = lib.sodium_init()
+ if retval != 0:
+ raise CryptoError("Could not initialize sodium %d" % retval)
you will be able to see the precise retval that caused the error.
In the past it was called because "sodium was already initialized", and I was not sure what was initializing it... Then the problem just disappeared in my test machines...
I will try look into it.
fwiw, retval is 1 :P
OK friend!
I suspect this is an upstream bug with PyNaCl. I filed a bug with them and hopefully it will get fixed, or they will let me know how to fix it on viola.
Till them, I pushed a dirty workaround so that more people can test: https://github.com/asn-the-goblin-slayer/viola/commit/b3867d3b8cff1c38fbbfc1de0c1ab447dc51de27
Please git pull and try again :)
Let me know if it doesn't work.
I'll let this ticket open till the real issue gets fixed.
Could be unrelated but i got the same error message when (i think) i tried to to load viola while it was allready loaded.
Is it possible that you are using some other plugin which uses pynacl and that prevents it from being loaded again?
mmm no, i installed pynacl specifically for this
D