#3465: Non-interactive deluge-console hangs on twisted errors
----------------------------+------------------------
 Reporter:  jschauer        |       Type:  bug
   Status:  new             |   Priority:  minor
Milestone:  needs verified  |  Component:  Console UI
  Version:  develop         |   Keywords:
----------------------------+------------------------
 Using the deluge-console frontend with commands instead of the interactive
 mode causes it to hang silently after a connection error and possibly from
 other twisted errors.

 Observed on both system Gentoo deluge-2.0.3 and the current develop
 (3ec23ad96) in a virtualenv. Python3.8, twisted 20.3.

 To reproduce:
 - Do not start a deluge daemon process
 - Use the deluge-console frontend in non-interactive mode.
   - eg {{{ deluge-console -Ldebug quit }}}

 Expected behavior: Command aborts with a non-debug level error message

 Observed behavior: Command hangs indefinitely

 The reason for this seems to be the error handler {{{on_connect_fail}}} in
 {{{deluge.ui.console.main:exec_args}}}.
 In this situation the parameter {{{reason}}} contains a
 {{{twisted.failure.Failure}}} with {{{.value}}} of type
 {{{twisted.internet.error.ConnectError}}} which does not have a member
 {{{message}}} causing an exception that will be caught silently somewhere.

 Apparently any runtime exception in the error handler will silently be
 ignored and causes the application to hang. I do not have enough knowledge
 with twisted or deluge to know if this is expected behavior or how to fix
 the underlying problem.

 For my local installation I've used this trivial patch to work around this
 specific error for now:

 {{{
 diff --git a/deluge/ui/console/main.py b/deluge/ui/console/main.py
 index 23965bbb2..6d1e19d5c 100644
 --- a/deluge/ui/console/main.py
 +++ b/deluge/ui/console/main.py
 @@ -207,7 +207,7 @@ def on_connect_fail(reason):
              if reason.check(DelugeError):
                  rm = reason.getErrorMessage()
              else:
 -                rm = reason.value.message
 +                rm = reason.value
              print(
                  'Could not connect to daemon: %s:%s\n %s'
                  % (options.daemon_addr, options.daemon_port, rm)
 }}}

 Unsure for which types the {{{message}}} member would be available instead
 of str() support.

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3465>
Deluge <https://deluge-torrent.org/>
Deluge Project

-- 
You received this message because you are subscribed to the Google Groups 
"Deluge Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/deluge-dev/047.69b70ef90d663fffa60e37329a77937b%40deluge-torrent.org.

Reply via email to