Migrating deluge server from 18.04 -> 20.04

General support for problems installing or using Deluge
mhertz
Moderator
Moderator
Posts: 2195
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Migrating deluge server from 18.04 -> 20.04

Post by mhertz »

Usually it should be possible to simply rename the plugin's py version to 3.8, or alternatively remove it completely(as it's optional per spec). Py38 is for the most part downwards compatible with 3.7, except some deprecated functions I read, and I've tried it before with success of renaming py 3.6 plugins etc.

Sorry I don't know why you couldn't enable it. I haven't checked, but if your distro features a deluge 2.0.3 package and py3.8.x, then the deluge package mantainer there should have backported a commit from develop branch for py38 logging compatibility support, and use a newer twisted, e.g. 20.3.0, as you will atleast get erors shown during logging otherwise("3 args given, expected 2" messages repeatedly, etc), but I guess will still work, though haven't tried myself. I only have here, either deluge latest dev version, or a 2.0.3 stable with backported compatibility commit and newest twisted, but renaming latest yarss2 from 3.7 to 3.8, I was able to enable it in 2.0.3 and showed up fine, I just tested. Check debug log for errors otherwise, and make sure you're not trying use the v1.x yarss2 version obviously, so if building yourself, build from correct branch/source. Hope you can get it solved hopefully. Good luck.
shamael
Compulsive Poster
Compulsive Poster
Posts: 667
Joined: Sat Oct 08, 2016 9:28 am

Re: Migrating deluge server from 18.04 -> 20.04

Post by shamael »

I've not dig this part yet but a wrote womething that may help (really a maybe) viewtopic.php?f=7&t=55654&p=231516&hili ... ss#p231516
danger89
New User
New User
Posts: 1
Joined: Thu Jan 21, 2021 10:27 pm

Re: Migrating deluge server from 18.04 -> 20.04

Post by danger89 »

I'm new to Deluge, so I don't have a good experience from the start.

I used the Ubuntu PPA since that was recommended. I'm using Ubuntu Server 20.04 LTS (Focal). So I have a clear install of Deluge.

Headless installation went fine. However, running deluge-console and selecting the server (pressing enter), will result into:

Code: Select all

Unhandled error in Deferred:
Temporarily disabling observer LegacyLogObserverWrapper(<bound method TwistedLoggingObserver.emit of <deluge.log.TwistedLoggingObserver object at 0x7f098b1ee220>>) due to exception: [Failure instance: Traceback: <class 'TypeError'>: _findCaller() takes from 1 to 2 positional arguments but 3 were given
/usr/lib/python3/dist-packages/twisted/internet/defer.py:953:__del__
/usr/lib/python3/dist-packages/twisted/logger/_logger.py:270:critical
/usr/lib/python3/dist-packages/twisted/logger/_logger.py:144:emit
--- <exception caught here> ---
/usr/lib/python3/dist-packages/twisted/logger/_observer.py:131:__call__
/usr/lib/python3/dist-packages/twisted/logger/_legacy.py:93:__call__
/usr/lib/python3/dist-packages/deluge/log.py:208:emit
/usr/lib/python3/dist-packages/twisted/python/log.py:595:emit
/usr/lib/python3/dist-packages/twisted/logger/_legacy.py:154:publishToNewObserver
/usr/lib/python3/dist-packages/twisted/logger/_stdlib.py:115:__call__
/usr/lib/python3.8/logging/__init__.py:1500:log
/usr/lib/python3.8/logging/__init__.py:1565:_log
]
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 953, in __del__
    log.critical("Unhandled error in Deferred:",
  File "/usr/lib/python3/dist-packages/twisted/logger/_logger.py", line 270, in critical
    self.emit(LogLevel.critical, format, **kwargs)
  File "/usr/lib/python3/dist-packages/twisted/logger/_logger.py", line 144, in emit
    self.observer(event)
--- <exception caught here> ---
  File "/usr/lib/python3/dist-packages/twisted/logger/_observer.py", line 131, in __call__
    observer(event)
  File "/usr/lib/python3/dist-packages/twisted/logger/_legacy.py", line 93, in __call__
    self.legacyObserver(event)
  File "/usr/lib/python3/dist-packages/deluge/log.py", line 208, in emit
    PythonLoggingObserver.emit(self, event_dict)
  File "/usr/lib/python3/dist-packages/twisted/python/log.py", line 595, in emit
    _publishNew(self._newObserver, eventDict, textFromEventDict)
  File "/usr/lib/python3/dist-packages/twisted/logger/_legacy.py", line 154, in publishToNewObserver
    observer(eventDict)
  File "/usr/lib/python3/dist-packages/twisted/logger/_stdlib.py", line 115, in __call__
    self.logger.log(
  File "/usr/lib/python3.8/logging/__init__.py", line 1500, in log
    self._log(level, msg, args, **kwargs)
  File "/usr/lib/python3.8/logging/__init__.py", line 1565, 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


Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 654, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/lib/python3/dist-packages/deluge/ui/client.py", line 408, in __on_connect_fail
    self.daemon_info_deferred.errback(reason)
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 501, in errback
    self._startRunCallbacks(fail)
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 568, in _startRunCallbacks
    self._runCallbacks()
--- <exception caught here> ---
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 654, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/lib/python3/dist-packages/deluge/ui/console/modes/connectionmanager.py", line 90, in _on_connect_fail
    self.report_message('Failed to connect!', result)
  File "/usr/lib/python3/dist-packages/deluge/ui/console/widgets/popup.py", line 61, in report_message
    self.push_popup(MessagePopup(self, title, message))
  File "/usr/lib/python3/dist-packages/deluge/ui/console/widgets/popup.py", line 354, in __init__
    lns = format_utils.wrap_string(self.message, self.width - 3, 3, True)
  File "/usr/lib/python3/dist-packages/deluge/ui/console/utils/format_utils.py", line 207, in wrap_string
    s1 = string.split('\n')
builtins.AttributeError: 'Failure' object has no attribute 'split'

Temporarily disabling observer LegacyLogObserverWrapper(<bound method TwistedLoggingObserver.emit of <deluge.log.TwistedLoggingObserver object at 0x7f098b1ee220>>) due to exception: [Failure instance: Traceback: <class 'TypeError'>: findCaller() takes from 1 to 2 positional arguments but 3 were given
/usr/lib/python3/dist-packages/twisted/internet/defer.py:962:__del__
/usr/lib/python3/dist-packages/twisted/logger/_logger.py:190:failure
/usr/lib/python3/dist-packages/twisted/logger/_logger.py:144:emit
--- <exception caught here> ---
/usr/lib/python3/dist-packages/twisted/logger/_observer.py:131:__call__
/usr/lib/python3/dist-packages/twisted/logger/_legacy.py:93:__call__
/usr/lib/python3/dist-packages/deluge/log.py:204:emit
/usr/lib/python3.8/logging/__init__.py:1481:critical
/usr/lib/python3.8/logging/__init__.py:1565:_log
]
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 962, in __del__
    log.failure(format,
  File "/usr/lib/python3/dist-packages/twisted/logger/_logger.py", line 190, in failure
    self.emit(level, format, log_failure=failure, **kwargs)
  File "/usr/lib/python3/dist-packages/twisted/logger/_logger.py", line 144, in emit
    self.observer(event)
--- <exception caught here> ---
  File "/usr/lib/python3/dist-packages/twisted/logger/_observer.py", line 131, in __call__
    observer(event)
  File "/usr/lib/python3/dist-packages/twisted/logger/_legacy.py", line 93, in __call__
    self.legacyObserver(event)
  File "/usr/lib/python3/dist-packages/deluge/log.py", line 204, in emit
    getattr(LoggingLoggerClass, event_dict['log_level'].name)(
  File "/usr/lib/python3.8/logging/__init__.py", line 1481, in critical
    self._log(CRITICAL, msg, args, **kwargs)
  File "/usr/lib/python3.8/logging/__init__.py", line 1565, in _log
    fn, lno, func, sinfo = self.findCaller(stack_info, stacklevel)
builtins.TypeError: findCaller() takes from 1 to 2 positional arguments but 3 were give
deluged 2.0.3
deluge-console 2.0.3
libtorrent: 1.1.13.0
Python: 3.8.5
OS: Linux Ubuntu 20.04 focal

Help me!

Ps. The service itself is also crashed I think now..

● deluged.service - LSB: Start or stop the Deluge BitTorrent daemon.
Loaded: loaded (/etc/init.d/deluged; generated)
Active: active (exited) since Thu 2021-01-21 23:14:43 CET; 38min ago
pu5htiu
New User
New User
Posts: 3
Joined: Mon Feb 01, 2021 2:19 pm

Re: Migrating deluge server from 18.04 -> 20.04

Post by pu5htiu »

delete and purge all deluge ppa, as 20.04 has a working version of 2.0.3,

downgrade to deluged/focal,focal,now 2.0.3-2

and you will need to upgrade to libtorrent1.2:

sudo add-apt-repository ppa:libtorrent.org/1.2-daily
sudo apt-get update
sudo apt-get install python3-libtorrent

# deluged --version
deluged 2.0.3
libtorrent: 1.2.11.0
Python: 3.8.5
OS: Linux Ubuntu 20.04 focal
Post Reply