"Library not loaded: libffi" after upgrade to 3.4.2

Support for Deluge on Apple Mac OS
Post Reply
bolshoi
Member
Member
Posts: 13
Joined: Sun Oct 25, 2020 5:42 am

"Library not loaded: libffi" after upgrade to 3.4.2

Post by bolshoi »

I'm using Deluge daemon on MacOS. I upgraded libffi library via brew recently from 3.3_3 to 3.4.2.
Deluge now fails with this error: dyld: Library not loaded: /usr/local/opt/libffi/lib/libffi.7.dylib

I used a workaround from google: https://github.com/platformio/platform- ... 0/issues/7
basically with the upgraded library libffi.7.dylib was removed and replaced with libffi.8.dylib. so I linked libffi.8.dylib to libffi.7.dylib using ln command.

Now deluge GTK launches fine, but the daemon still doesn't work and I don't see any new unusual errors.

Any clue?

I noticed a lot of times deluge fails when one of the dependencies is upgrade (happened recently with libtorrent, had to downgrade it). Is deluge no longer maintained? looks like it keeps losing support with up to date libraries sadly :(

cheers

EDIT: I see this error, but this has always been spammed in logs when using latest python (python 3.9.7)

Code: Select all

Temporarily disabling observer LegacyLogObserverWrapper(<bound method TwistedLoggingObserver.emit of <deluge.log.TwistedLoggingObserver object at 0x110e22f40>>) due to exception: [Failure instance: Traceback: <class 'TypeError'>: findCaller() takes from 1 to 2 positional arguments but 3 were given
/usr/local/lib/python3.9/site-packages/twisted/internet/defer.py:962:__del__
/usr/local/lib/python3.9/site-packages/twisted/logger/_logger.py:190:failure
/usr/local/lib/python3.9/site-packages/twisted/logger/_logger.py:144:emit
--- <exception caught here> ---
/usr/local/lib/python3.9/site-packages/twisted/logger/_observer.py:131:__call__
/usr/local/lib/python3.9/site-packages/twisted/logger/_legacy.py:93:__call__
/usr/local/lib/python3.9/site-packages/deluge/log.py:204:emit
/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/logging/__init__.py:1493:critical
/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/logging/__init__.py:1577:_log
]
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/twisted/internet/defer.py", line 962, in __del__
    log.failure(format,
  File "/usr/local/lib/python3.9/site-packages/twisted/logger/_logger.py", line 190, in failure
    self.emit(level, format, log_failure=failure, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/twisted/logger/_logger.py", line 144, in emit
    self.observer(event)
--- <exception caught here> ---
  File "/usr/local/lib/python3.9/site-packages/twisted/logger/_observer.py", line 131, in __call__
    observer(event)
  File "/usr/local/lib/python3.9/site-packages/twisted/logger/_legacy.py", line 93, in __call__
    self.legacyObserver(event)
  File "/usr/local/lib/python3.9/site-packages/deluge/log.py", line 204, in emit
    getattr(LoggingLoggerClass, event_dict['log_level'].name)(
  File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/logging/__init__.py", line 1493, in critical
    self._log(CRITICAL, msg, args, **kwargs)
  File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/logging/__init__.py", line 1577, in _log
    fn, lno, func, sinfo = self.findCaller(stack_info, stacklevel)
builtins.TypeError: findCaller() takes from 1 to 2 positional arguments but 3 were given
bolshoi
Member
Member
Posts: 13
Joined: Sun Oct 25, 2020 5:42 am

Re: "Library not loaded: libffi" after upgrade to 3.4.2

Post by bolshoi »

original error:

Code: Select all

Traceback (most recent call last):
  File "/usr/local/bin/deluge", line 8, in <module>
    sys.exit(start_ui())
  File "/usr/local/lib/python3.9/site-packages/deluge/ui/ui_entry.py", line 143, in start_ui
    ui.start()
  File "/usr/local/lib/python3.9/site-packages/deluge/ui/gtk3/__init__.py", line 43, in start
    from .gtkui import GtkUI
  File "/usr/local/lib/python3.9/site-packages/deluge/ui/gtk3/gtkui.py", line 50, in <module>
    from deluge.ui.client import client
  File "/usr/local/lib/python3.9/site-packages/deluge/ui/client.py", line 17, in <module>
    from twisted.internet import defer, reactor, ssl
  File "/usr/local/lib/python3.9/site-packages/twisted/internet/ssl.py", line 59, in <module>
    from OpenSSL import SSL
  File "/usr/local/lib/python3.9/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import crypto, SSL
  File "/usr/local/lib/python3.9/site-packages/OpenSSL/crypto.py", line 17, in <module>
    from OpenSSL._util import (
  File "/usr/local/lib/python3.9/site-packages/OpenSSL/_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/usr/local/lib/python3.9/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 16, in <module>
    from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: dlopen(/usr/local/lib/python3.9/site-packages/_cffi_backend.cpython-39-darwin.so, 2): Library not loaded: /usr/local/opt/libffi/lib/libffi.7.dylib
  Referenced from: /usr/local/lib/python3.9/site-packages/_cffi_backend.cpython-39-darwin.so
  Reason: image not found
bolshoi
Member
Member
Posts: 13
Joined: Sun Oct 25, 2020 5:42 am

Re: "Library not loaded: libffi" after upgrade to 3.4.2

Post by bolshoi »

I fixed this by running:

Code: Select all

pip3 install --force-reinstall cryptography
deluged seems to work for now.
Post Reply