'Unhandled Error in Deferred' and other errors

General support for problems installing or using Deluge
Post Reply
sewyer
New User
New User
Posts: 4
Joined: Fri Feb 26, 2021 12:02 am

'Unhandled Error in Deferred' and other errors

Post by sewyer »

Hi,
I hope someone can help me. I'm running deluge 2.0.3 inside a docker container using the linuxserver/deluge image on a Raspberry. My web-UI setup works fine. But now I wanted to use the console to create a torrent. I'm running into errors everywhere.

First, I connect to my container and type "deluge-console". But the interface that is displaying the 127.0.0.1 host just hangs and when I quit I get "Unhandled error in Deferred" for each time I tried to select the host.

This command works: `deluge-console "connect localhost localclient password; info"`.

Next, I wanted to change the default username/password thinking this might be the problem, with
`deluge-console -U localclient -P password config --set username localclient`
but I get
`TypeError: next expected at least 1 arguments, got 0`

And
`deluge-console -U localclient -P password`
of course, doesn't work as well. Unhandled error in Deferred. But there isn't a single error in deluged.log.

I'm at my wit's end. Nothing I try works.
I would appreciate any help.
mhertz
Moderator
Moderator
Posts: 2195
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: 'Unhandled Error in Deferred' and other errors

Post by mhertz »

I experienced this, and found you have to run the ncurses UI as same user as running deluged, as even though having user/pass then fails otherwise as stated. You can use e.g. 'sudo -u <deluged-running-user> deluge-console', or just login as deluged-running-user firstly before running deluge-console. A bug obviously, but just a work-around suggested. I actually forgot report this, as always run deluge-console in non-curses cli-mode, except if testing something, and as same user too, but will report it soon, if not forgetting again :) Plus the -c option of rm is conflicting with --config/-c, but long-version works i.e --confirm, but probably not need report it, as I see PR submitted for it already, curtesy of Lucas-C.
sewyer
New User
New User
Posts: 4
Joined: Fri Feb 26, 2021 12:02 am

Re: 'Unhandled Error in Deferred' and other errors

Post by sewyer »

Logging in as the same user that is running deluged changed nothing sadly.
But I noticed after running `ps aux` that the root user is running `s6-supervise deluged` while the other user runs `/usr/bin/python3 /usr/bin/deluged -c /config -d --loglevel=i`. I don't know what the first process is or if it has any significance.
mhertz
Moderator
Moderator
Posts: 2195
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: 'Unhandled Error in Deferred' and other errors

Post by mhertz »

Granted i'm not using docker, but as said I have to run 'sudo -u deluge deluge-console' here to avoid the deffered twisted error, even with the auth's in place both places etc. which I believe is user 'abc' at your end, but didn't work you stated.

Anyway, I experimented a little more and found now that I can connect to the daemon without changing user, by in my own users '~/.config/deluge/hostlist.conf' either add new host, or as I did, just replace the two default lines of localclient user and pass, just under the line with port of '58846', with e.g. 'test' and 'test', and then if having an auth file in the daemon's config folder with same user/pass, so here 'test:test:10', then works and I can log in fine with just a return after running only 'deluge-console' from my own user.

Anyway maybe you have other issues than me, as did read some docker users having issues, with various solutions, e.g. needing change from host to bridge networking in docker config, or vice-versa, and one reported only udp not tcp defined for the 58846 port, which needed changing, but hopefully it's enough by the previous note above.

Ohh, since you're using docker, then I guess need change also allow_remote=true in the core.conf of daemon and the 127.0.0.1 IP of hostlist.conf in your own deluge-profile to docker IP, unless you enter the docker-shell/image when running deluge-console. Sorry, knowing next to nothing about docker's.
sewyer
New User
New User
Posts: 4
Joined: Fri Feb 26, 2021 12:02 am

Re: 'Unhandled Error in Deferred' and other errors

Post by sewyer »

Thanks for the help.
Sadly, nothing works. It isn't made any easier that I don't even know what that "Unhandled Error" might be.
But I'm slowly getting the feeling that the docker image is missing some library(ies).
mhertz
Moderator
Moderator
Posts: 2195
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: 'Unhandled Error in Deferred' and other errors

Post by mhertz »

Sorry, of-course you cannot change user through e.g. sudo from host when that user is in the docker-container, and that is just what I could do locally here, when testing this, as quick workaround.

Anyway, I just tested with the deluge docker linux-server image you're using, and one of my previous workarounds worked, described here next.

So, in the mounted deluge docker config-dir, you add a user/pass to the auth file, with deluge docker stopped, e.g. I just added a new line with 'test:test:10'. Then in your own users '~/.config/deluge/hostlist.conf' you change the two lower lines with 'localclient' and 'password', to instead 'test' and 'test'. Start deluge docker and run from your own user 'deluge-console', and press return when showing connection-manager and you're connected with the curses UI opening, without that buggy twisted deffered error plastering over the screen without possibility of entering correct user/pass :)

I tried also just adding the localclient password from deluge docker's auth into the localclient password of your own users hostlist.conf, but that didn't work, so you need add user/pass to docker deluge's auth.

Deluge-console '-U test -P test' still don't work when having added 'test:test:10' to deluge docker's auth, but as long as just adding, or replacing it, into your local hostlist.conf, then atlast that is a fool-proof solution/workaround.

Btw, I used the default template for setting up the docker from it's linux-server deluge page, so e.g. host network defined etc.

Hope helps.

Edit: Lol, forgive me for as said being a noob at dockers, so for the above, then in addition to installing deluge docker image and running it, then I also installed deluge again on host to get deluge-console so as to connect to the docker's deluged :) I tested this here in a VM btw, as obviously have deluge installed locally already. Anyway, i'm thinking now that you probably not have two deluge's installed for this, so probably exec into the docker image and run deluge-console from there. So, if wanting that, then I used 'su -c deluge-console abc' to run deluge-console from deluged-running-user, as sudo not installed in docker image, but didn't work, as restricted user, but just thought as 'sudo -u' worked then 'su -c' might also, but didn't. However, my workaround of running under deluged-running-user is solely just for getting to use that user's config, and so instead of changing user, you can just start deluge-console like so: 'deluge-console -c /config'. Then it's like previous solution just a question of pressing return to the screen showing your connected daemon and the curses UI starts correctly again :) You don't need other stuff for this last tip, i.e. no need adding user/pass to auth or changing hostlist.conf etc, and if you in-fact did run with two deluge installs(docker+local), then you could also skip all these top-described steps and likewise just instead fire deluge-console up with: 'deluge-console -c <mounted-docker-deluge-profile-path>' simply, which I just didn't think about for some dumb reason initially. An alias would help for that too of-course also, e.g just typing 'delu' or 'dc' for this, etc.
sewyer
New User
New User
Posts: 4
Joined: Fri Feb 26, 2021 12:02 am

Re: 'Unhandled Error in Deferred' and other errors

Post by sewyer »

I'm 100% I tried `deluge-console -c /config` before but this time it worked. Maybe because of a change along the way.
Anyways, much thanks. Appreciate the effort.
mhertz
Moderator
Moderator
Posts: 2195
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: 'Unhandled Error in Deferred' and other errors

Post by mhertz »

You're very welcome :) I should report this, as pretty big issue with consoleUI(cannot add new host from it directly), and happens everywhere, e.g. I now seen it on two different distro's with local installs, in addition to on docker. Anyway, I tested that workaround again with completely fresh re-generated profile and fully purged/reinstalled docker/image, so should work always, but you can as stated also just add new user/pass to auth and edit hostlist.conf's user/pass to match, or alternatively add new host(with docker stopped), which makes just 'deluge-console' work by itself(without '-c /config') and would be the standard method to setup manually. Thanks for replying back with confirmation likewise :)
Post Reply