On Fri, 27 Aug 2021 12:10:22 +0200 Jonas Andradas <[email protected]>
wrote:
> Package: deluge-web
> Version: 2.0.3-3.1
> Severity: important
> X-Debbugs-Cc: [email protected]
>
> Dear Maintainer,
>
> Since the update to Debian 11 "bullseye", which updated Python to
> version 3.9, I am seeing that deluge-web (and the deluged daemon) are
> showing some errors.
>
> When using the web interface to connect to the daemon, the web appears
> empty, and any attempt to modify the configuration does not seem to
> persist this. Adding a torrent (from a URL or a file, for example Debian's
ISO
> installer [1]) errors start to appear in the console and, despite the
> torrent seems added in the web interface, it never starts downloading,
> and does not seem recognized by the backend deluged daemon.
>
> [1]
> https://cdimage.debian.org/debian-cd/current/amd64/bt-dvd/debian-11.0.0-amd64-DVD-1.iso.torrent
>
> The errors I observe in the console are the following ones, repeated
> many times:
>
> Temporarily disabling observer LegacyLogObserverWrapper(<bound method
TwistedLoggingObserver.emit of <deluge.log.TwistedLoggingObserver object at
0x7f56ae63e5b0>>) 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:
568:_startRunCallbacks
> /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.9/logging/__init__.py:1489:critical
> /usr/lib/python3.9/logging/__init__.py:1573:_log
> ]
> Traceback (most recent call last):
> File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 568,
in _startRunCallbacks
> self._runCallbacks()
> 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.9/logging/__init__.py", line 1489, in critical
> self._log(CRITICAL, msg, args, **kwargs)
> File "/usr/lib/python3.9/logging/__init__.py", line 1573, 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
>
> Unhandled error in Deferred:
> 12:04:33 [CRITICAL][twisted :154 ] Unhandled error in
Deferred:
>
This seems to be a known issue, cause because the logging.Logger class in
Python > 3.8 has changed. There is a path for file deluge/log.py which solves
the issue (I tested this locally), which is referenced in deluge's git [1]
[1]
diff --git a/deluge/log.py b/deluge/log.py
index 75e8308..0f9877f 100644
--- a/deluge/log.py
+++ b/deluge/log.py
@@ -86,7 +86,7 @@ class Logging(LoggingLoggerClass):
def exception(self, msg, *args, **kwargs):
yield LoggingLoggerClass.exception(self, msg, *args, **kwargs)
- def findCaller(self, stack_info=False): # NOQA: N802
+ def findCaller(self, *args, **kwargs): # NOQA: N802
f = logging.currentframe().f_back
rv = '(unknown file)', 0, '(unknown function)'
while hasattr(f, 'f_code'):