# deluged stopped working



## nforced (Apr 18, 2014)

I just noticed deluged is down, it was working today but now it won't start manually. I see this in my console

```
#deluged -d -L debug
[ERROR   ] 22:31:42 main:237 [Errno 2] No such file or directory: '/usr/local/lib/python2.7/site-packages/cryptography/hazmat/bindings/__pycache__/_cffi__x5eaa210axf0ae7e21.c'
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/deluge-1.3.6-py2.7.egg/deluge/main.py", line 229, in start_daemon
    from deluge.core.daemon import Daemon
  File "/usr/local/lib/python2.7/site-packages/deluge-1.3.6-py2.7.egg/deluge/core/daemon.py", line 39, in <module>
    from twisted.internet import reactor
  File "/usr/local/lib/python2.7/site-packages/twisted/internet/reactor.py", line 38, in <module>
    from twisted.internet import default
  File "/usr/local/lib/python2.7/site-packages/twisted/internet/default.py", line 56, in <module>
    install = _getInstallFunction(platform)
  File "/usr/local/lib/python2.7/site-packages/twisted/internet/default.py", line 48, in _getInstallFunction
    from twisted.internet.pollreactor import install
  File "/usr/local/lib/python2.7/site-packages/twisted/internet/pollreactor.py", line 25, in <module>
    from twisted.internet import posixbase
  File "/usr/local/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 24, in <module>
    from twisted.internet import error, udp, tcp
  File "/usr/local/lib/python2.7/site-packages/twisted/internet/tcp.py", line 29, in <module>
    from twisted.internet._newtls import (
  File "/usr/local/lib/python2.7/site-packages/twisted/internet/_newtls.py", line 21, in <module>
    from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol
  File "/usr/local/lib/python2.7/site-packages/twisted/protocols/tls.py", line 40, in <module>
    from OpenSSL.SSL import Error, ZeroReturnError, WantReadError
  File "/usr/local/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "/usr/local/lib/python2.7/site-packages/OpenSSL/rand.py", line 11, in <module>
    from OpenSSL._util import (
  File "/usr/local/lib/python2.7/site-packages/OpenSSL/_util.py", line 4, in <module>
    binding = Binding()
  File "/usr/local/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 83, in __init__
    self._ensure_ffi_initialized()
  File "/usr/local/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 99, in _ensure_ffi_initialized
    libraries)
  File "/usr/local/lib/python2.7/site-packages/cryptography/hazmat/bindings/utils.py", line 72, in build_ffi
    ext_package="cryptography",
  File "/usr/local/lib/python2.7/site-packages/cffi/api.py", line 341, in verify
    lib = self.verifier.load_library()
  File "/usr/local/lib/python2.7/site-packages/cffi/verifier.py", line 73, in load_library
    self._write_source()
  File "/usr/local/lib/python2.7/site-packages/cffi/verifier.py", line 125, in _write_source
    file = open(self.sourcefilename, 'w')
IOError: [Errno 2] No such file or directory: '/usr/local/lib/python2.7/site-packages/cryptography/hazmat/bindings/__pycache__/_cffi__x5eaa210axf0ae7e21.c'
```

Reinstalling  deluged and python27 doesn't help.
Does anyone else have this problem with the current ports (up-to-date)?
Thanks


----------



## frankofo (Apr 20, 2014)

I had the same error. Doing `pkg remove -f python27 py27-openssl` and `pkg install python27 py27-openssl` fixed this problem in my case. If not, try `pkg upgrade -f`.


----------



## possamai (Apr 23, 2014)

Same issue here.

For me this helped: `portmaster -r python27-2.7.6_4`

So if you use portmaster, try that.


----------



## dove (May 7, 2014)

It's actually a reinstall of security/py-cryptography that resolves this issue (I noticed it when running `make configure` in net-im/papyon).

Before the reinstall, lib/python2.7/site-packages/cryptography has:


```
1/lib/python2.7/site-packages/cryptography/_cffi__x5fea2bacx4a8b9ec1.so
1/lib/python2.7/site-packages/cryptography/_cffi__x657b2f6exf0ae7e21.so
1/lib/python2.7/site-packages/cryptography/_cffi__xcfd0a060xfba2f231.so
```

After:


```
2/lib/python2.7/site-packages/cryptography/_cffi__x36bf4a13xfba2f231.so
2/lib/python2.7/site-packages/cryptography/_cffi__x5eaa210axf0ae7e21.so
2/lib/python2.7/site-packages/cryptography/_cffi__xa1394602x4a8b9ec1.so
```

What's happening is verifier.py in the security/py-cryptography package tries to rebuild the .so if it's not there.  If you are running as a regular user, it fails trying to build in /usr/local/lib/python2.7/site-packages/cryptography/hazmat/bindings/__pycache__/ since regular users can't write there.


----------

