Deluge keeps giving problems no matter how hard I try

General support for problems installing or using Deluge
Cas_vt
Member
Member
Posts: 17
Joined: Fri Mar 12, 2021 2:51 pm

Deluge keeps giving problems no matter how hard I try

Post by Cas_vt »

Hey there,

I'm having quite alot of problems with my Deluge and I want to fix it once and for all.
Here comes the list:
  1. [1]When I do deluge-console cache (but it can be everything, not only cache), it gives the following error everytime:

    Code: Select all

    Could not connect to daemon: 127.0.0.1:58846
      Password does not match
    When doing sudo -u deluge deluge-console cache, it does work but I don't want to do that. I don't want to use sudo and run it with a certain user. I just want to do deluge-console cache and it should work.
  1. [2]When making any request to deluge-console, it always gives the following error (ontop of the error described in problem 1):

    Code: Select all

     Unable to initialize gettext/locale!
    'ngettext'
     Traceback (most recent call last):
       File "/usr/lib/python3/dist-packages/deluge/i18n/util.py", line 118, in setup_translation
          builtins.__dict__['_n'] = builtins.__dict__['ngettext']
    KeyError: 'ngettext'
  1. [3]Everytime that I restart deluged (or restart the server), I get the message in the webui (from connection manager) to choose a host. I only have 1 host. How can I disable the message in such way that deluge just choses the host (as it's the only host)?
  1. [4]Doing sudo systemctl status deluged.service deluge-web.service shows the following errors:

    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
    
  1. [5]In the webui, it shows the following in the bar at the bottom:

    Code: Select all

    Download: Nan GiB/s Upload: Nan GiB/s Traffic: NaN GiB/s External IP: n/a Freespace in download folder: Error
  1. [6]Sonarr and Radarr aren't able to connect and 'upload' torrents to Deluge.
  1. [7]I have already completly uninstalled Deluge twice but when installing again, deluge-web starts at my custom set port. Which is strange because that would mean that it didn't completely uninstall.
Deluge is a great piece of software but I'm done with it if stuff like this keeps going on. I want to set it up/fix it in such a way that I will NEVER have an error or problem again with it. Because I'm done with all the problems it is giving.
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 »

1: Set up your deluge credentials and connect info in ~/.config/deluge. It's complaining because you are either not providing credentials, or they are wrong.

2: set your locale correctly -- this varies based on OS/distro.

3: set your config up properly -- it is asking because you don't have it in ~/.config/deluge

4: install the correct version of twisted, as required by deluge -- i think you need something like 19.7 or higher

5: I'm going to hazard a guess and assume its another issue due to a missing or incorrect config

6: no details given, so hard to say, but I am going to guess an incorrect config or version issues.

7: all signs point to the fact that you did not reinstall correctly, and left config files behind, which now have incorrect values set.
Deluge is a great piece of software but I'm done with it if stuff like this keeps going on. I want to set it up/fix it in such a way that I will NEVER have an error or problem again with it. Because I'm done with all the problems it is giving.
It's *shocking* that you were not able to find this information via google -- these are all relatively common issues, and point to the same solution. You should tell your system administrator you are having issues and ask them to update and fix the issues -- point them here, and at google if they have many questions. Every one of these issue points to an issue with your system administrator and user, and not the software. Of course you are going to have issues if you are trying to use an invalid configuration -- that's not the software's fault.
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

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

Post by mhertz »

In addition to ashmandias help above, just wanted to add that the error messages ngettext and findcaller, are both fixed in deluge develop + upgraded twisted. They can be ignored for now, but can fill up your logging however. Mail your package maintainer to backport related commits, or change to dev as a special case, since appropriate here, e.g some reported partition or Ram, cannot remember what, filled up after 24 hours or something, because of it.

Auto-connect host in webui is in FAQ: https://dev.deluge-torrent.org/wiki/Faq ... ificdaemon (How patch deluge to omit password for webUI, if wanted, can be googled, e.g I posted once updated deluge-dev patch I made from reading about what code needed changing, or so I believe atleast.)

Deluge-console connect to deluged from systemd service, usually meaning deluge user, so you need have user/pass in auth file of daemon under deluge user deluge profile and same in hostlist.conf of own deluge profile. (Deluge can login without pass for localhost through localclient default line in auth, but works only for same user running client/daemon.)

It is little bit of a "Google is your friend" to setup for sure, but not to hard. Sorry don't have time now for links or more detail, but should get you going atleast somewhat.
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 »

I'm on Ubuntu 20.04.1 LTS by the way

I was trying to make it work but it didn't. So I thought starting with a fresh install would help. So I did the following:

Code: Select all

sudo apt-get purge deluged deluge-console deluge-web
sudo apt-get autoremove
sudo rm -r /home/cas/.config/deluge
sudo rm -r /var/lib/deluge (turns out that directory was completly empty)
sudo gpasswd -d deluge deluge
sudo deluser deluge
sudo delgroup deluge
sudo rm /etc/systemd/system/deluged.service /etc/systemd/system/deluge-web.service
sudo systemctl daemon-reload
And now deluge is completly removed I thought. So I went to the official documentation (https://dev.deluge-torrent.org/wiki/Ins ... nux/Ubuntu) and installed deluge again following "Headless install from Terminal:". Before I could do anything else, it already gave me the following error while installing (I've never had this error before):

Code: Select all

mrt 13 15:43:50 Waveserver systemd[141784]: deluged.service: Failed to determine user credentials: No such process
mrt 13 15:43:50 Waveserver systemd[141784]: deluged.service: Failed at step USER spawning /etc/init.d/deluged: No such process
I've already googled quite a bit and tried things out but I couldn't make it work. I was planning on following these links but this error stopped that ofcourse: https://deluge.readthedocs.io/en/latest ... rvice.html and https://dev.deluge-torrent.org/wiki/Use ... cationfile.

I did quite a bit of googling but I couldn't make it work. So now I'm basically asking (instead of "how to fix deluge?") "how do I correctly install and setup deluge?" So that it uses the deluge user (because previously the /var/lib/deluge dir was completly empty) and all the config files and startup files are setup correctly.

That's all I want. To have deluge work correctly. I didn't do anything special. I didn't change any settings (aside from the port the web-ui runs on), I didn't install a beta version, I didn't mess with config files (I didn't even know where they were located) and still it won't work.
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

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

Post by mhertz »

Some reported like minded error, with other process than deluge, but rest message same, to go away with 'sudo systemctl daemon-reexec'. It was a specific systemd version needing that apparently,.

Your old settings are in hidden folder, so e.g if it's /var/lib/deluge, then run 'sudo rm -rf /var/lib/deluge/.config/deluge' as the 'deluge' profile-dir is located there under.

You have the choice of either official repo deluge package, or PPA package, as stated in that official ubuntu deluge setup link, so if you have issue with one, then maybe try the other, and I even think the repo package is the newest one, surpricingly. BTW, I found it strange no-one have setup an unofficial PPA with a stable deluge with backported fixed needed and a develop version to get the newest release, with such popular project. There is both, but they are both old, so no backported fixes for stable and dev version is not new. Maybe anyone cannot just setup PPAs, besides official project devs, I dunno as too lazy to lookup. There where previously one that posted a static build of deluge with most deps included already, for Debian, I'm gonna look little into that when have time later I.e it would be nice to have unofficial static binaries available for people with distro's not up-to-date, if possible, of latest deluge dev, though don't know if worth the effort, as not that hard to just build from source yourself, but regardless and just a passing thought really.
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 »

Cas_vt wrote:I'm on Ubuntu 20.04.1 LTS by the way

I was trying to make it work but it didn't. So I thought starting with a fresh install would help. So I did the following:

Code: Select all

sudo apt-get purge deluged deluge-console deluge-web
sudo apt-get autoremove
sudo rm -r /home/cas/.config/deluge
sudo rm -r /var/lib/deluge (turns out that directory was completly empty)
sudo gpasswd -d deluge deluge
sudo deluser deluge
sudo delgroup deluge
sudo rm /etc/systemd/system/deluged.service /etc/systemd/system/deluge-web.service
sudo systemctl daemon-reload
And now deluge is completly removed I thought. So I went to the official documentation (https://dev.deluge-torrent.org/wiki/Ins ... nux/Ubuntu) and installed deluge again following "Headless install from Terminal:". Before I could do anything else, it already gave me the following error while installing (I've never had this error before):

Code: Select all

mrt 13 15:43:50 Waveserver systemd[141784]: deluged.service: Failed to determine user credentials: No such process
mrt 13 15:43:50 Waveserver systemd[141784]: deluged.service: Failed at step USER spawning /etc/init.d/deluged: No such process
I've already googled quite a bit and tried things out but I couldn't make it work. I was planning on following these links but this error stopped that ofcourse: https://deluge.readthedocs.io/en/latest ... rvice.html and https://dev.deluge-torrent.org/wiki/Use ... cationfile.

I did quite a bit of googling but I couldn't make it work. So now I'm basically asking (instead of "how to fix deluge?") "how do I correctly install and setup deluge?" So that it uses the deluge user (because previously the /var/lib/deluge dir was completly empty) and all the config files and startup files are setup correctly.

That's all I want. To have deluge work correctly. I didn't do anything special. I didn't change any settings (aside from the port the web-ui runs on), I didn't install a beta version, I didn't mess with config files (I didn't even know where they were located) and still it won't work.
what does your service file look like? Googling that error makes it sound like it's due to an invalid username -- or improper fomating.

Does the user you are trying to run it as exist? My best guess is that you have mangled things by running random commands and actions and things are now screwy -- much like when you previously randomly reinstalled and did not clean up the first install. I'm not a ubuntu expert, but it sounds like the packages are not cleaning up the config files or recreating users that you deleted.
Last edited by ashmandias on Sun Mar 14, 2021 2:20 am, edited 1 time in total.
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

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

Post by mhertz »

Yeah, sounds like user account issue indeed, and my suggestion was probably wrong, but just saw several have same error with various systemd services here, though a few years ago however: postgresql.service: Failed to determine user credentials: No such process, including 3 other services or so, reported fixed with systemctl daemon-reexec, so just posted in case, but as said, little old post too, plus that command is just same as reboot roughly(systemd restart).
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 »

Okay, so..
When doing

Code: Select all

sudo systemctl cat deluged.service
I got the following:

Code: Select all

# /run/systemd/generator.late/deluged.service
# Automatically generated by systemd-sysv-generator

[Unit]
Documentation=man:systemd-sysv-generator(8)
SourcePath=/etc/init.d/deluged
Description=LSB: Start or stop the Deluge BitTorrent daemon.
Before=multi-user.target
Before=multi-user.target
Before=multi-user.target
Before=graphical.target
After=remote-fs.target
After=network-online.target
Wants=network-online.target

[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
SuccessExitStatus=5 6
ExecStart=/etc/init.d/deluged start
ExecStop=/etc/init.d/deluged stop

# /etc/systemd/system/deluged.service.d/user.conf
# Override service user
[Service]
User=deluge
Group=deluge
I noticed that the user deluge didn't exist. So I executed the following command to add the deluge user (https://deluge.readthedocs.io/en/latest ... rvice.html):

Code: Select all

sudo adduser --system  --gecos "Deluge Service" --disabled-password --group --home /var/lib/deluge deluge
Then I did

Code: Select all

sudo systemctl restart deluged
It worked and didn't give me an error message anymore.
But ofcourse there's a new problem now:

Code: Select all

● deluged.service - LSB: Start or stop the Deluge BitTorrent daemon.
     Loaded: loaded (/etc/init.d/deluged; generated)
    Drop-In: /etc/systemd/system/deluged.service.d
             └─user.conf
     Active: active (exited) since Mon 2021-03-15 12:29:00 CET; 6min ago
       Docs: man:systemd-sysv-generator(8)
    Process: 374873 ExecStart=/etc/init.d/deluged start (code=exited, status=0/SUCCESS)

mrt 15 12:29:00 Waveserver systemd[1]: Starting LSB: Start or stop the Deluge BitTorrent daemon....
mrt 15 12:29:00 Waveserver deluged[374873]:  * Starting Deluge BitTorrent Daemon deluged
mrt 15 12:29:00 Waveserver deluged[374879]: start-stop-daemon: unable to open pidfile '/var/run/deluged.pid' for writing (Permission denied)
mrt 15 12:29:00 Waveserver deluged[374878]: start-stop-daemon: child returned error exit status 2
mrt 15 12:29:00 Waveserver deluged[374873]:    ...fail!
mrt 15 12:29:00 Waveserver systemd[1]: Started LSB: Start or stop the Deluge BitTorrent daemon..
Eventhough it says active, the output says that it failed because of permissions. I already tried

Code: Select all

sudo chown deluge:deluge /var/run/deluged.pid
but it didn't work, saying that that file doesn't exist.

I wanted to do the answer on this (https://serverfault.com/questions/15933 ... in-var-run) page, but I can't find where "var/run/deluged.pid" is set in a file so that I can change the path to a deluge:deluge-owned folder inside /var/run.
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

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

Post by mhertz »

Sorry, not looked into your new PID issue honestly, but would just suggest myself that you ditch the second abstraction and additional point-of-failure addition, by disabling sysv-generator or however called, can't remember sorry, which tries link old sysv together with systemd. I before tested and wrote instructions for a user, specifically testing on ubuntu 14.04 like you, here: viewtopic.php?t=55673#p232328 (The service file links I posted are down, but was 100% vanilla from the official docs and I just added User and Group lines additionally to them to avoid needing additional user.conf, but isn't needed specifically). With such setup I haden't any PID issues when I tested it atleast.

Anyway, running 'sudo systemctl disable deluged' and then 'sudo systemctl stop deluged', will disable that sysv-generator stuff for deluge(the '--now' switch of first line I found strangely has specific semantics related this, no need go into here, but hence why didn't proposse instead here, just in case). Then follow official docs to the tee(unless wanting default debian-deluged user, then can skip the deluge user stuff) and try again i'd suggest.

I find it strange that you haden't any deluge user added, when apparently installing package using such, hence would be setup to auto-generate it. If it's repo package you used, then just strange that still references deluge and not debain-deluged, and cannot remember if was like that in my tests too.

I believe the repo package of deluge is newer than the PPA deluge package, as also is listed on the PPA i.e. lists newer version available elsewhere(repo), unless I remember wrong. As per the link I linked above, then though differs by generating a user named debian-deluged i believe, so either continue with that, or change to deluge as per the official systemd service docs for deluge.

https://deluge.readthedocs.io/en/latest ... rvice.html

Hope helps somewhat and sorry for not answering your actual specific question, though which other can help you with instead, if still preferred going that route, or well, rather sticking to current state/status-quo.

Edit: I just updated the links in the first posted link, as e.g. also others could find it later from a google search and I can relink it later on also to others in same boat, plus used hosting not time-limited. If installing repo deluge package and running commands exactly as posted, then should work and don't need anything else, i.e. don't need follow any of the steps in official docs for service setup as already done(and '--now' is okay in the way used there). Note that will use the default debian-deluged user which the deluge repo package sets up for you, so needs changed if wanting deluge named user specifically, but isn't important really, and the point is just using an unprivileged user for enhanced security, which debain-deluged is, plus personally I find it stupid to make another same styled user when one already generated and setup for you for that, with exact same functionality, but that's just me.
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 »

The file doesn't exist to change the permissions on -- because deluge failed to make it when you tried to start deluge(the error message is pretty clear about this). Fix the permissions on the directory so that deluge can make the pid file, and deluge will be able to start. Obviously, you cannot change permissions on a file that does not exist. It seems the vast majority of your problems stem from you not looking into what you are doing, or looking into the errors and you are randomly doing things, which seem to be making things worse. Personally, I would start with checking the init file for deluge, and making sure that the pid file is set appropriately there -- if it is not, update that file to fix it, and file a bug report on the package (you should file one anyway, since they are using both init files and systemd).

mhertz -- he explicitly deleted the deluge user as part of his mangling his system. Apt should have recreated the user if it did not exist, but that might have been broken when he was making changes outside of apt. I'm guessing that deleting and manually recreating the user without the correct groups led to this current problem, much like reinstalling without cleaning up config files led to the original one.
Post Reply