Page 1 of 2

Deluge takes ages to start and stop: Can't connect via web-ui

Posted: Sun Jun 27, 2021 4:59 pm
by Xi0N
Well, I don't know how to start.
I've been struggling with this issue for a long time now.
OS: Arch LINUX - Headless setup-

I followed arch wiki, like I've been setting deluge up for the past ten years or so:

Install
Created a user as per https://wiki.archlinux.org/title/deluge#Create_a_user
$ echo "delugeuser:p422WoRd:10" >> $HOME/.config/deluge/auth

Then started deluged and deluge-web but no matter what, deluge-web can't connect to the daemon, can't even "see" it.

For some time, deleting the state file, seemed to work since I was having some permission issues on the download dirs, but now that's fixed, yet starting deluge takes ages, and stopping it always times out (5 minutes) and ends getting sigkilled.

journalctl does not give any clue and I sincerely don't know how to troubleshoot what is happening.

I tried to delete all the config, uninstall and then install from zero, new configs, new all, but I still can't manage to make it work.

Can any caring soul help a guy out? I have lots of thing waiting to be downloaded... :(
If only I could know how to debug what deluge is trying to do or where does it get stuck...

Re: Deluge takes ages to start and stop: Can't connect via web-ui

Posted: Sun Jun 27, 2021 6:16 pm
by mhertz
If not having anything important, then you start fresh by 'sudo rm -rf /srv/deluge/.config/deluge' and 'rm -rf ~/.config/deluge'.

If you start deluged/deluge-web from systemd, then by default run under deluge user, so should echo auth password into '/srv/deluge/.config/deluge'. You don't really need though however, If just using deluged on localhost, and for gtkui you just copy hostlist.conf from /srv/deluge/.config/deluge into and overwrite the one in ~/.config/deluge and for webUI you shouldn't need copy anyhting over really.

I just tested here and didn't have this issue, both checked webUI and gtkUI(I don't use deluge through systemd myself usually, hence needing retest). I deleted both deluge profiles before testing(well, renamed my ~/.config/deluge to end in '-bak' as run deluged from own user myself normally).

Edit: Stop deluged/deluge-web from systemd before you delete the profile in '/srv/deluge/.config/deluge'

If still not working then could also do quick check without systemd, just to see/exclude if this is related or not, by stopping deluged/deluge-web from systemd, then run 'deluged' and 'deluge-web' and then check if can enter that from webbrowser in 'localhost:8112' or not - just for testing I mean'.

That arch wiki article about deluge thinclient isn't very good honestly, and mentions running under restricted user is recommended, but then goes on giving instructions/commands for running daemon under own user instead - I should probably edit that at one point, as it's a wiki afterall I.e user-editable, and I already have wiki account there, unless someone beats me to it.

Re: Deluge takes ages to start and stop: Can't connect via web-ui

Posted: Sun Jun 27, 2021 7:43 pm
by Xi0N
I started from scratch again and everything seemed to go smooth.

Suddenly, deluged goes offline on the web ui and this is what I get when I try to log in from the cli:

https://imgur.com/a/y0CnQhP

Any ideas?

Re: Deluge takes ages to start and stop: Can't connect via web-ui

Posted: Sun Jun 27, 2021 9:42 pm
by mhertz
Sorry to hear, maybe enable debug-logging for both deluged and webUI.

For the deluge-console error, then that happens whenever things not setup correct for authentication, meaning that for webUI atleast worked for me without doing anything, but for deluge-console and deluge-GTK there is steps involved, which I just state again just in case:

Code: Select all

sudo cp /srv/deluge/.config/deluge/{hostlist.conf,auth} ~/.config/deluge
sudo chown xion: ~/.config/deluge/{hostlist.conf,auth}
In last line you edit 'xion to your real personal user-name, but keep the colon afterwards it, which just means default group for said user. Also, if not having a local deluge config folder, then firstly with deluged/deluge-web from systemd stopped, you run 'deluged' and 'pkill deluged', and start deluged/deluge-web again from systemd and do above steps.

Anyway, to enable logging when using systemd is the following instructions:

Stop deluged/deluge-web from systemd.
Then generate override files that enable logging, which easiest way is run 'sudo systemctl edit deluged' which opens an editor and you need copy/paste into first empty line and save it:

Code: Select all

[Service]
ExecStart=
ExecStart=/usr/bin/deluged -d -L debug -l /srv/deluge/.config/deluge/deluged.log
Run 'sudo systemctl edit deluge-web' and again copy/paste following into first empty line and save it:

Code: Select all

[Service]
ExecStart=
ExecStart=/usr/bin/deluge-web -d -L debug -l /srv/deluge/.config/deluge/deluge-web.log
Start from systemd deluged/deluge-web and test untill hitting the issue, stop again deluged/deluge-web from systemd, and check /post the logs under '/srv/deluge/.config/deluge' i.e. 'deluged.log' and 'deluge-web.log'.

When wanting remove the logging again, then with deluged/deluge-web stopped from systemd, then run:

Code: Select all

sudo systemctl revert deluged deluge-web
Good luck.

Edit: I edited the two lines in first instructions posted, to also include and copy over the 'auth' file in addition to the 'hostlist.conf' file, because found that although only hostlist.conf was needed to run deluge-console and login there, then when running non-interactively e.g. 'deluge-console info', then it would fail and say password not match, so you needed additionally 'auth' copied over into your local user-dir for this to work correct in all situations.

Re: Deluge takes ages to start and stop: Can't connect via web-ui

Posted: Mon Jun 28, 2021 4:26 am
by Xi0N
I'm logging now: For some reason, today deluged wanted to start without issuess.
Please wait some days until i can get errors and report back again.

Re: Deluge takes ages to start and stop: Can't connect via web-ui

Posted: Wed Jun 30, 2021 3:47 pm
by Xi0N
After a system restart (graceful) the connection gets refused again
This is deluged.log https://pastebin.com/N2V16RN5
This is deluge.web.log https://pastebin.com/FizJw5wF

I can0t see anything relevant but those "connecton refused" messages.
Let me know if we can try anything else.

Re: Deluge takes ages to start and stop: Can't connect via web-ui

Posted: Wed Jun 30, 2021 5:32 pm
by mhertz
The deluged log is practically empty though - is it even running i.e. 'ps aux | grep [d]eluged' and/or is there reported errors in 'sudo systemct status deluged'.

Anyway, if deluged actually running and if deluged.log doesn't have anything relevant, then unfortunetly have no other suggestions i'm affraid.

Re: Deluge takes ages to start and stop: Can't connect via web-ui

Posted: Fri Jul 02, 2021 10:49 pm
by Xi0N
Yup, there's nothing else on the logs or journalctl I'm afraid... :(

Re: Deluge takes ages to start and stop: Can't connect via web-ui

Posted: Fri Jul 02, 2021 11:58 pm
by mhertz
If there's not more in that log, then the daemon isnt running imho - did you check as per my last reply? A running deluged daemon outputs alot more than those few lines, e.g which port bound to etc etc.

Re: Deluge takes ages to start and stop: Can't connect via web-ui

Posted: Sat Jul 03, 2021 6:58 pm
by Xi0N
Ok, I've tried several things.
Started from scratch: Remove deluge, plus deps. Delete user, group, home... etc... and reboot, just in case. Reinstall
At first I thought having the downloads folder on an NFS share must be doing some harm. But this time, I just left it alone: Default settings, default download folder, etc.... and downloaded arch's iso image.
Usually the first time you run deluge after installing, it does fire up properly and seems to work. The issues appear after rebooting and/or restarting.
After rebooting, the web-ui was unable to see the running daemon: I use it in headless mode: start deluged, start deluge-web and manage it from there.
This time I got this debug log: https://pastebin.com/6rHxhwu8
Which does not seem to clarify anithing at all.
This is with default setting, without loading the previous torrents and without any extra configuration.
I can't see anything significant on the debug log.
EDIT: BTW: Yes, ps-aux | grep deluged indeed shows running processess