Page 1 of 1

deluge-console: errors and unstable

Posted: Thu Sep 05, 2024 11:06 pm
by hunterthompson
Hi, I'm running deluged and deluge-console on a linux OS:
deluged -version
deluged 2.1.2.dev0
libtorrent: 2.0.10.0
Python: 3.12.3
OS: Linux Ubuntu 24.04 noble
deluge-console -version
deluge-console 2.1.2.dev0
libtorrent: 2.0.10.0
Python: 3.12.3
OS: Linux Ubuntu 24.04 noble

Deluged and deluge-web seem to work fine, but everytime I use deluge-console directly in console or in a script, I get this in return before getting the result of my command:

[ERROR ][deluge.component :132 ] [Failure instance: Traceback: <class 'AttributeError'>: 'ConsoleUI' object has no attribute 'started_deferred'
/usr/lib/python3/dist-packages/twisted/internet/defer.py:877:callback
/usr/lib/python3/dist-packages/twisted/internet/defer.py:984:_startRunCallbacks
/usr/lib/python3/dist-packages/twisted/internet/defer.py:1078:_runCallbacks
/usr/lib/python3/dist-packages/twisted/internet/defer.py:1949:_gotResultInlineCallbacks
--- <exception caught here> ---
/usr/lib/python3/dist-packages/twisted/internet/defer.py:2003:_inlineCallbacks
/usr/lib/python3/dist-packages/deluge/ui/console/main.py:366:start
]
Unhandled error in Deferred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 877, in callback
self._startRunCallbacks(result)
File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 984, in _startRunCallbacks
self._runCallbacks()
File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1078, in _runCallbacks
current.result = callback( # type: ignore[misc]
File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1949, in _gotResultInlineCallbacks
_inlineCallbacks(r, gen, status, context)
--- <exception caught here> ---
File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 2003, in _inlineCallbacks
result = context.run(gen.send, result)
File "/usr/lib/python3/dist-packages/deluge/ui/console/main.py", line 366, in start
self.started_deferred.callback(True)
builtins.AttributeError: 'ConsoleUI' object has no attribute 'started_deferred'

Has anyone an idea about how I can correct this error?
Thanks by advance

Re: deluge-console: errors and unstable

Posted: Fri Sep 06, 2024 7:45 am
by mhertz
Thanks, I see this came after commit 253eb22, affecting chained connect command. I'll look into it at a later time, or atleast make a ticket, thanks for reporting. In meantime, a workaround is to not use 'connect', but instead like:

Code: Select all

deluge-console -d <ip> -p <port> -U <user> -P <password> command[; command...]

Re: deluge-console: errors and unstable

Posted: Fri Sep 06, 2024 9:18 am
by ambipro
mhertz wrote: Fri Sep 06, 2024 7:45 am Thanks, I see this came after commit 253eb22, affecting chained connect command. I'll look into it at a later time, or atleast make a ticket, thanks for reporting. In meantime, a workaround is to not use 'connect', but instead like:

Code: Select all

deluge-console -d <ip> -p <port> -U <user> -P <password> command[; command...]
Many more PRs are in your future mhertz :D

Re: deluge-console: errors and unstable

Posted: Fri Sep 06, 2024 10:58 am
by mhertz
Did I mention I love you bro! Thank you so much my friend :)

Re: deluge-console: errors and unstable

Posted: Fri Sep 06, 2024 4:19 pm
by hunterthompson
I'll try that tonight, thanks a lot!

Re: deluge-console: errors and unstable

Posted: Fri Sep 06, 2024 4:59 pm
by hunterthompson
The workaround seems to work in my scripts, even better than "connect", except the one which removes torrents by magnet.

I tried using:
deluge-console -d ip -p port -U user -P password "rm -c $LIST"
deluge-console -d ip -p port -U user -P password "rm -c $LIST ; exit"
These commands work, and remove the torrents in my list, but none of them ends.
I need to stop the command manually, and I get this in return:

Unhandled error in Deferred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 877, in callback
self._startRunCallbacks(result)
File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 984, in _startRunCallbacks
self._runCallbacks()
File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1078, in _runCallbacks
current.result = callback( # type: ignore[misc]
File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1949, in _gotResultInlineCallbacks
_inlineCallbacks(r, gen, status, context)
--- <exception caught here> ---
File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 2003, in _inlineCallbacks
result = context.run(gen.send, result)
File "/usr/lib/python3/dist-packages/deluge/ui/console/main.py", line 208, in exec_args
await commander.exec_command(cmd)
builtins.TypeError: object NoneType can't be used in 'await' expression

Do you have a workaround for this error?

Thanks again

Re: deluge-console: errors and unstable

Posted: Sun Sep 08, 2024 5:51 pm
by mhertz
You're very welcome buddy :)

Sorry little slow, anyway that is indeed another issue you ran into there, with a PR submitted for it already, so should hopefully be fixed for next release of deluge, or in time, with that debian package using dev snapshots.

You can add the main fix for it, by just adding 'return d' to line 79 of 'usr/lib/python3/dist-packages/deluge/ui/console/cmdline/commands/rm.py', or apply full fix with this command-line(just additionally fixes the non -c version of command):

Code: Select all

sudo find /usr -path '*/deluge/ui/console/cmdline/commands/rm.py' -exec sh -c 'curl https://patch-diff.githubusercontent.com/raw/deluge-torrent/deluge/pull/464.patch | patch {}' \;
(Can see your precise path in logging, but made it variable to support others too, e.g. differences between distros, py versions and source-based installs)

Hope helps.