Deluge keeps giving problems no matter how hard I try

General support for problems installing or using Deluge
mhertz
Moderator
Moderator
Posts: 2195
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Deluge keeps giving problems no matter how hard I try

Post by mhertz »

Thanks for clarifying ashmandias :)

Btw, it sounds like I'm deranged or something lol saying disabling the systemd service momentarily, disables the sysv compatibility layer, but it really does I found, and states on terminal afterwards that deluged now removed from that sysv runtime generator whatever have you, so one can proceed with strict systemd afterwards. I had other errors than OP though when not have done that, with the daemon failing continually, but no message about pid for me though.
ashmandias
Member
Member
Posts: 22
Joined: Thu Feb 11, 2021 7:12 pm

Re: Deluge keeps giving problems no matter how hard I try

Post by ashmandias »

Are you also on ubutnu 20? that would confirm the pid issue was from his changes and not inherent to the package
mhertz
Moderator
Moderator
Posts: 2195
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Deluge keeps giving problems no matter how hard I try

Post by mhertz »

No, i'm not on ubuntu, and just previously tested it for one on ubuntu 20.04 live-iso in a VM. I also previously helped another with ubuntu 20.10 which took alot debugging and I setup a full ubuntu install in VM for that then, as was a docker deluge issue and the live-iso VM couldn't install that, and I still had the image actually, though as said, little newer than OP's ubuntu version.

Anyway I quickly checked again in that VM, and I just installed the repo package as is newer than the PPA I believe, though in this newer ubuntu the deluge package was one edition further updated 2.0.3-3 instead of 2.0.3-2, but still had that annoying sysv-compatibility layer.

By default the service started and ended/failed without specifying what error was. The pid and location is defined in the sysv file under /etc/init.d/deluged which systemd service calls, though in my case it wasen't the issue, or atlerast didn't complain about it. It also had the required -d swicth defined for deluged I checked, but still failed for whatever reason.

I followed my own linked instructions I posted/linked to before and then worked fine again, and no sysv crap anymore(it didn't say the line about the sysv-layer removed for deluge now, when running third line, as it did on ubuntu 20.04 last I did it some time ago, but still worked fine and no traces of sysv when running 'sudo systemctl cat deluged' anymore).

The sysv-compatibility layer does use debian-deluged as user-name, and from the systemctl cat deluged OP posted previously, we can see he still has the override user.conf file adding deluge user instead of debian-deluged, so probably is that. Delete that file firstly i.e. user.conf under /etc/systemd/system/deluged.d/user.conf, well delete whole deluged.d parent-folder too, and i'd suggest follow my instructions also, but your call of-course. I linked the instructions again here, which is all that's needed right after having nstalled deluge from the repo(not PPA):

Code: Select all

sudo wget -O /etc/systemd/system/deluged.service tinyurl.com/yjfmz5zc
sudo wget -O /etc/systemd/system/deluge-web.service tinyurl.com/ffdkwvde
sudo systemctl disable --now deluged
sudo systemctl enable --now deluged deluge-web
The service files wget'ed in-place above, is as said fully identical to official docs listed ones, with just two lines added for the User/Group directives, so as don't need user.conf override file and dir additionally and don't need create new user, as default debain-deluged used here, from official deluge repo package(not PPA).
Cas_vt
Member
Member
Posts: 17
Joined: Fri Mar 12, 2021 2:51 pm

Re: Deluge keeps giving problems no matter how hard I try

Post by Cas_vt »

Delete that file firstly i.e. user.conf under /etc/systemd/system/deluged.d/user.conf, well delete whole deluged.d parent-folder too, and i'd suggest follow my instructions also, but your call of-course. I linked the instructions again here, which is all that's needed right after having nstalled deluge from the repo(not PPA):

Code: Select all

sudo wget -O /etc/systemd/system/deluged.service tinyurl.com/yjfmz5zc
sudo wget -O /etc/systemd/system/deluge-web.service tinyurl.com/ffdkwvde
sudo systemctl disable --now deluged
sudo systemctl enable --now deluged deluge-web
The service files wget'ed in-place above, is as said fully identical to official docs listed ones, with just two lines added for the User/Group directives, so as don't need user.conf override file and dir additionally and don't need create new user, as default debain-deluged used here, from official deluge repo package(not PPA).
I did this and both deluged.service and deluge-web.service are working:

Code: Select all

● deluged.service - Deluge Bittorrent Client Daemon
     Loaded: loaded (/etc/systemd/system/deluged.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2021-03-16 15:51:12 CET; 7s ago
       Docs: man:deluged
   Main PID: 2994 (deluged)
      Tasks: 7 (limit: 4648)
     Memory: 32.4M
     CGroup: /system.slice/deluged.service
             └─2994 /usr/bin/python3 /usr/bin/deluged -d

mrt 16 15:51:12 Waveserver systemd[1]: Started Deluge Bittorrent Client Daemon.

● deluge-web.service - Deluge Bittorrent Client Web Interface
     Loaded: loaded (/etc/systemd/system/deluge-web.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/deluge-web.service.d
             └─user.conf
     Active: active (running) since Tue 2021-03-16 15:51:12 CET; 7s ago
       Docs: man:deluge-web
   Main PID: 2995 (deluge-web)
      Tasks: 1 (limit: 4648)
     Memory: 38.4M
     CGroup: /system.slice/deluge-web.service
             └─2995 deluge-web

mrt 16 15:51:12 Waveserver systemd[1]: Started Deluge Bittorrent Client Web Interface.
mrt 16 15:51:13 Waveserver deluge-web[2995]: Unable to initialize gettext/locale!
mrt 16 15:51:13 Waveserver deluge-web[2995]: 'ngettext'
mrt 16 15:51:13 Waveserver deluge-web[2995]: Traceback (most recent call last):
mrt 16 15:51:13 Waveserver deluge-web[2995]:   File "/usr/lib/python3/dist-packages/deluge/i18n/util.py", line 118, in setup_transl>
mrt 16 15:51:13 Waveserver deluge-web[2995]:     builtins.__dict__['_n'] = builtins.__dict__['ngettext']
mrt 16 15:51:13 Waveserver deluge-web[2995]: KeyError: 'ngettext'

# /etc/systemd/system/deluged.service
[Unit]
Description=Deluge Bittorrent Client Daemon
Documentation=man:deluged
After=network-online.target

[Service]
Type=simple
UMask=007
User=debian-deluged
Group=debian-deluged

ExecStart=/usr/bin/deluged -d

Restart=on-failure

# Time to wait before forcefully stopped.
TimeoutStopSec=300

[Install]
WantedBy=multi-user.target

# /etc/systemd/system/deluge-web.service
[Unit]
Description=Deluge Bittorrent Client Web Interface
Documentation=man:deluge-web
After=network-online.target deluged.service
Wants=deluged.service

[Service]
Type=simple
UMask=027
User=debian-deluged
Group=debian-deluged

ExecStart=/usr/bin/deluge-web -d

Restart=on-failure

[Install]
WantedBy=multi-user.target

# /etc/systemd/system/deluge-web.service.d/user.conf
# Override service user
[Service]
User=deluge
Group=deluge
That's aside from the fact that deluge-web.service uses a /deluge-web.service.d/user.conf file. Should I delete that folder and underlaying user.conf file (as you told to do that to the deluged user.conf file)? But for the rest is it working. Joking. Ofcourse it isn't working.

It looks like the config file isn't... there. There isn't a config file.
When looking at all the settings via the web-ui, almost everything is empty (Downloads, Network, Encyption, Others, Proxy, Plugins). There isn't anything that is setup. All the settings are empty. That's also why the bar at the bottom of the web-ui doesn't show information (Nan GiB/s n/a Error etc), because there isn't a config file that tells the bar what to "scan".
When I first launched the deluged and the web-ui, it started on 8112. I logged in with "deluge" and changed my standard password. But after doing F5 and entering the password, it again said "change your standard password" which is logical when my new password isn't stored in the config file. Though changing the port to 8008 did work (probably because the web-ui port is saved in the web-ui config instead of the deluged config).

I've been unsuccessfull in finding the config file online and where it should go. I searched through the github page of deluge to find the config file but could't find it. Is there a wget link to the config file? Is there any way to manually add the config file? In which directory should it go?
mhertz
Moderator
Moderator
Posts: 2195
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Deluge keeps giving problems no matter how hard I try

Post by mhertz »

Cas_vt wrote:[...] But for the rest is it working. Joking. Ofcourse it isn't working.
:)

Yes, delete that file and dir, though no issue here with my files as includes user/group, and if so can only be changed with firstly 'User=-' etc in user.conf, before the new user-setting line(to clean before set, as overwrite unsupported for certain stuff, like this here, well unless I'm mixing it up with the execstart line, but still/regardless, cleaner to delete useless/unneeded stuff.

The webui is empty because you first need login to your local deluged daemon, so open connection manager from webui, though should open automatically.

The conf isn't there by default, but generated after deluged/deluge-web stops. In this setup, it's in if remember correct /var/lib/deluged/.config/deluge.

BTW, if wanting revert to other method of deluge user, then should work I'd suspect, so if wanting that, then either change user/group in the two service files, or delete the two lines, and instead follow official docs of user.conf overrides etc, use that daemon-reload command just in case. This won't change your empty webui issue though, and just preference based, and as said, I find it redundant when already debian-deluged user made for it in deluge repo package.
Last edited by mhertz on Tue Mar 16, 2021 4:25 pm, edited 1 time in total.
Cas_vt
Member
Member
Posts: 17
Joined: Fri Mar 12, 2021 2:51 pm

Re: Deluge keeps giving problems no matter how hard I try

Post by Cas_vt »

The webui is empty because you first need login to your local deluged daemon, so open connection manager from webui, though should open automatically.
I (after restarting the webui) go to ipadress:8008 and get the connection manager. I choose the only host and I have access. The strange thing is, everytime I restart deluge-web.service, more and more settings appear haha. First everything was empty. The second time, the bar showed stats. The third time settings were enabled and "filled up". The fourth time every setting looked filled up and the bar shows everything. But setting the password for accesssing the web-ui is still strange.

I enter the web-ui and it tells me to enter the password. Eventhough I've changed my password away from the standard one, after entering it it says that I should change the standard password. Like it doesn't set the imaginary variable "standard_password=true" to "false", but does register the new password. So the standard password doesn't work anymore, only my new custom one. But after logging in, it still says "We recommend changing the default password." Simply said: How do I fix it? A strange problem for sure.

Sonarr and Radarr are able to connect.

I tried adding a torrent and seeing if it downloads and moves the files and stuff. It doesn't. I can add it but it doesn't download. I think it is because the network settings are set incorrectly. The torrent 100% works, trust me. See picture:
Image
It says the tracker status is "Error: Host not found (authoritative)" (The picture says something different but this is what it says now).

I should mention that I was indeed able to locate the config file inside the lib "/var/lib/deluged/.config/deluge".

EDIT:
1. I've now tried multiple torrents. Everytime they go to 50kb/s after adding but after a few seconds go down to 0 and stay there. Like "hell yeah lets download [3 seconds pass] oh wait never mind"

2. Problem 4 in original post (3 arguments were given where 1 or 2 are accepted) is now only for deluge-web.service. For deluged.service not anymore.
Previously: Both deluged and deluge-web:

Code: Select all

mrt 12 14:50:28 Waveserver deluged[20344]: builtins.TypeError: findCaller() takes from 1 to 2 positional arguments but 3 were given
Now: ONLY deluge-web:

Code: Select all

mrt 12 14:50:28 Waveserver deluged[20344]: builtins.TypeError: findCaller() takes from 1 to 2 positional arguments but 3 were given
Were making slow but good progress people!

EDIT2:
1. regarding Problem 4 in original post: In the previous edit, I said that now only deluge-web.service shows the error. After restarting (using systemctl restart deluge-web.service) the web-ui, it now doesn't show the error. So both deluged and deluge-web now don't show the error anymore. AKA Problem 4 in original is solved (well more like "has dissapeared"). Again, the more I restart deluge-web.service, the better it gets!

I tried solving problem 3 in the original post, but failed. I copied the string inside hostlist.conf (there were two but both didn't work) and pasted it inside web.conf after "default_daemon" and restarted deluged and deluge-web. Both strings didn't work. When launching the web-ui, it still shows the connection manager, making me choose the daemon I want to connect to.
mhertz
Moderator
Moderator
Posts: 2195
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Deluge keeps giving problems no matter how hard I try

Post by mhertz »

I don't have time now to fire up my before mentioned left-over ubuntu 20.10 VM, which anyway uses newer version of deluge package besides not being your ubuntu edition anyway, but I did some quick testing on my own used distro, and have a few comments.

When selecting yes to change password, then deluge opens preferences and you're not logged in yet, as connection manager is behind that dialog, hence empty - should be filled a bug ticket about this. After logging in and checking preferences again, then worked/filled-in.

It asks for if wanting change password, as long as '"first_login": false,' isn't defined in web.conf. Note all changes, should be made into /var/lib/deluged/.config/deluge, and not in ~/.confg/deluge. I didn't have issues and was set auto, though my distro makes an exception and uses unstable deluge in there repo, as makes sence here, but doubt it's different in latest stable deluge, atleast don't remember any commits added referencing said issue in commit-log of develop branch.

I checked adding to default daemon worked fine for me, i.e. with deluged and deluge-web stopped, edit web.conf to have the first line of the localclient user added into default-daemon and start deluged and deluge-web afterwards.

When something downloads and quickly stops afterwards, then often a permission issue i.e. I could download in the default location fine, but when changing to my own user-folder's Downloads folder, then failed, because the user-account deluged is running under, haven't write access to that folder, so need change permissions for that to work, e.g. add debian-deluged group to your own user and change your download folder to permit fellow group-members write-access, if not already(btw I made an edit at bottom of my last post, about if wanted then you could revert to standard deluge user if wanted, as believe it works now, but up to you, and won't help any of your issues however, and just added for full reference if preffering instead). However, in that case the download shows error in the webui and you didn't mention that, plus you stated that error of the tracker, which when looking up means the tracker's url couldn't be resolved, so network issue seemingly.

I once had a stupid issue that took long to solve for me, which was that my /etc/resolv.conf wasen't readable by the user of the deluged running process and hence no network access, but that's a special case and not likely related, as was my own fault for restoring that file from a backup, which messed up the permissions.

Can you check that you have internet access with your deluged user, by running in a terminal: 'sudo -u debain-deluged curl ifconfig.co', if works should output your IP address and if no internet or nameserver issue(dns) then would show an error instead.

Edit: Forgot the findcaller error, that is needing updated twisted over 19.7.0, but it already has that I remember from last testing it on ubuntu 20.04, but then still needs a fix that would needing backported from develop branch: https://git.deluge-torrent.org/deluge/c ... ed0f2c3206 Should be reported to package maintainers, though already has for ubuntu(or debian, cannot remember) I believe one posted once he just did, so maybe is in the 2.0.3-3 version of ubuntu 20.10, but I haven't checked that myself yet.
Last edited by mhertz on Tue Mar 16, 2021 7:57 pm, edited 1 time in total.
ashmandias
Member
Member
Posts: 22
Joined: Thu Feb 11, 2021 7:12 pm

Re: Deluge keeps giving problems no matter how hard I try

Post by ashmandias »

You are reporting a DNS error now. You are not downloading anything because your deluge machine cannot resolve the tracker hostname.
Cas_vt
Member
Member
Posts: 17
Joined: Fri Mar 12, 2021 2:51 pm

Re: Deluge keeps giving problems no matter how hard I try

Post by Cas_vt »

Code: Select all

sudo -u debian-deluged curl ifconfig.co
Gave as output my public ip address. The torrents that I used to test this, have already been used multiple times from my network e.g. I've already torrent-ed the content multiple times with that torrent. I've used those exact torrents multiple times to get their content. From my windows 10 computer and from my deluge server (that was using the deluge install from before this whole thread). It cannot be dns because dns is over the complete network, and i was able to download those torrents from multiple machines inside my lan. Seeing that I was able to download that exact torrent using deluge on the same server, I think it isn't possible since the new install. I'm almost certain it's because of the new install. Or better said, because of the new user management. It's probably due to writing permissions for debian-deluge. My download folder is set as "/home/cas/Downloads". My guess is that one user can't write files to folders inside other users home-dirs. What would be the correct permissions (chmod xxx) to allow write for debian-deluge to "/home/cas/Downloads"? The deluge install before this thread was being run under user and group cas. The new one is, of course, run under user and group debian-deluge.
mhertz
Moderator
Moderator
Posts: 2195
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Deluge keeps giving problems no matter how hard I try

Post by mhertz »

Cool, so your network is up to snuff - even if your machine works regarding network then still certain stuff can make network unavailable for specific users like debian-deluged here, but hapilly not the case, as you displayed in your test. It could then be a multi-tracker torrent, where one or more trackers ere down or ourdated so gone, and just happened to show status of one of those at the time.

Anyway, indeed it's because of the user management change. You said you previously used own user for deluge, which I also do myself, so if not minding the potential security issue, then you can just change user to your own user-name in the two service files, and delete the group line underneath as not needed. Note if doing this, that all config moves to ~/.config/deluge, well gets regenerated upon first run if missing rather. Probably needs also sudo systemctl daemon-reload.

If wanting keep the dedicated unprivileged user like now, then I must admit i'm not very much into permissions and chmod'ings and whatnot, and many ways doing it I guess, and honestly don't know what's best. Normally i'd think you could add your own user to debain-deluged group and then change your dowload folder with chmod to allow group writes, but I suspect it's only primary group that has group write permissions, and not secondary group members, but as said, know not much about this, as never bothered look it up propperly as haden't use for it yet. Of course you could add permissions to allow all to write to your download folder, but that isn't propperly the best route i'd guess. Hmm, also there's the issue of top folder restricting, i.e. even if changing perms on Downloads folder into home folder, then if home folder itself not allow it, then don't matter what set it up at. If wanting this route of still keeping debian-deluged(or deluge) user, then i'm sure others can help you with recommendet best procedure, instead of me needing read up on it first online - also if you might not even need it afterall, based on your preference.
Post Reply