Deluge keeps giving problems no matter how hard I try

General support for problems installing or using Deluge
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 »

That error is literally deluge saying it cannot lookup the tracker address -- so yes, yes it can be DNS related. If it was an error writing to the that location, the error would not be a DNS error, it would be an error about being unable to write to that location.

It's entirely possible that there is an issue now that there was not before? what tracker is it? can you resolve the address for that tracker from the command line for the deluge user? With the major fire in the OVH data center, and so many tracker sites having temporary issues, it is entirely likely that something that used to work may not currently be working.

I would think that with so many of your problems stemming from you assuming you know what you are doing, and then randomly making changes, you would know better than just assuming things are working.
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 »

I just guessed he also had permission issues, because stated changed to own user folder for downloads, which won't work unless making required changes though unrelated to that specific error of-course, but I think the error for writing is in the log and not UI. As internet and dns for the debian-deluged works as per the curl test, it sound like a public multi-tracker torrent, with one or more gone, and so permission error(additional to dns) , but of-course dont know. In my debug-logs I always have a couple initial "host not found (authoritive)" for the gone urls of the bootstrap dht nodes deluge has hardcoded(I asked Cas years ago to please add more, and gave the list qbittorrent used internally, which was added, but some down now and all are added to libtorrent and not just the top/working).
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 added the torrents again but now changed the download location from "/home/cas/Downloads" to "/var/lib/deluged/Downloads". They all work. So I was right and it wasn't a dns issue but a user-permissions isssue.

I did "sudo chmod a+rw /home/cas/Downloads", and that enabled deluge (run under debian-deluged) to write the files to "/home/cas/Downloads".

I was able to fix problem 3 in the original post (auto connect to a daemon). What I previously did was "1. copy hostlist.conf string and paste inside web.conf 2. restart deluged deluge-web". That, ofcourse didn't work. What I did now is "1. stop deluged deluge-web 2. copy hostlist.conf string and paste inside web.conf 3. start deluged deluge-web" That DID work. So problem 3 can be seen as fixed.
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.
This has fixed itself. It hasn't come forward anymore. It works now.

Problem 1 and 2 still stand. But due to the new (and better setup) install, it might be easier now to fix the problems.

Problem 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 debian-deluged 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.
Problem 2.
[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'
This error shows both when using deluge-console and when doing "sudo systemctl status deluge-web.service". Notice that it doesn't show in the status output of deluged.service. Only in the status output of deluge-web.service
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 »

problem 1: have you updated the passwords in ~/.config/deluge/ yet? The fact that it works when using the deluge user but not your normal user confirms it is a config issue, that is different between the two users.
problem 2: have you set locale yet?
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 »

Nice :)

If it was me that stated you should restart daemon(s) after editing conf(s), then sorry, sometimes state that by mistake, and meant with daemon(s) closed and start afterwards, as deluge reads conf on start and ignores afterwards and rewrites it's copy from memory into conf again at closing, hence overwriting any changes made in-between.

The last error is not important whatsoever and can be ignored, but if wanting it fixed, then can manually apply/backport following commit from deluge's develop branch: https://git.deluge-torrent.org/deluge/c ... 94017e7c85 Again should be reported imho to package maintainer to backport said fix, or alternatively they should make a decision to go with the dev release instead, like my used distro, instead of backporting this and that needed fix., e.g. a fix transfering your torrents from deluge1 instance to deluge2, plus py3.8 compatibility, plus this here, plus another unicode error etc etc is imho warranted - I wish Cas would just release 2.0.4 already, to stop all these issues, especially now when py3.8 is the norm and some systems get's bogged down with megs of error logging overloading ram/disk and these questions regarding various aspects are posted again and again, here and on all other related projects like all various docker images etc etc.

Anyway, your first issue, and sorry for the reversed chronology or whatever called, is that you run deluge-console as your own user and hence looks into ~/.config/deluge configs and your daemon is using debain-deluge's configs in it's other location. In my tests previously, it was not enough to use localclient line from daemon auth into user's hostlist.conf, and needed new user/pass to work, so, do this here:

Always stop daemons before making manual config changes i.e. 'sudo systemctl stop deluged deluge-web'.

You need another user besides default localclient, so if haven't already defined another one, then add new one with e.g. 'echo test:test:10 | sudo tee -a /var/lib/deluged/.config/deluge/auth'(test:test is user/pass wanted, and 10 is admin rights).

In your '~/.config/deluge/hostlist.conf', and if not existing you need run deluge-console once and just shift-q quit it afterwards and it will be there, but anyway you either edit the default localclient host defined, so you change the user and pass in the two lower lines of it's section to e.g. test and test, or whatever choosen in previous step, or you add another host to it, by adding new section over the bottom } and ], and needs a ', ' added after the localclient's sections's end-bracket, I can post you an example if need be. I would just change the default localclient one myself, to have test and test instead of localclient and xxxxxxxxxxxxxx. If adding new host, then the first line of id can be anything you want and not need be x chars and so e.g. can be called test also etc fine.

sudo systemctl start deluged deluge-web.

Works now I just tested again, since as said, I personally just use my own user, so no issues with this or permissions etc etc and only one location for everything, but potentially less secure should be understood.

Edit: ashmandias posted while I typed btw :)
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 »

Btw, if wanting to manually backport the py3.8 compatibility and ngettext commits from deluge develop onto deluge 2.0.3, then here's two commands doing that:

Code: Select all

sudo find /usr -path *deluge/i18n/util.py -exec sed -i "s/names='ngettext'/names=['ngettext']/" {} \;
sudo find /usr -path *deluge/log.py -exec sudo sed -i 's/stack_info=False/*args, **kwargs/' {} \;
Edit: I believe the py3.8 fix is only needed for if having twisted under 19.7.0, and I just checked and ubuntu 20.04 has 18.9 the ubuntu page lists for python3-twisted, so would need that fix, unless manually updating twisted from e.g. pip.

Edit2: I'm honestly not sure about the correlation i.e, I once discussed this on github with springjools, jools772 here, author of one of the two curently maintained autoremoveplus forks, and he got this issue even with said fix applied, and only wen't away when updating twisted, so your rmillage may vary. If having issues and wanting twisted updated to latest version through pip, then run 'sudo pip3 install --upgrade twisted'.
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 »

It's a wonder. It worked:

Code: Select all

sudo find /usr -path *deluge/i18n/util.py -exec sed -i "s/names='ngettext'/names=['ngettext']/" {} \;
sudo find /usr -path *deluge/log.py -exec sudo sed -i 's/stack_info=False/*args, **kwargs/' {} \;
The error doesn't show anymore. It doesn't show the error using deluge-console nor when viewing status deluge-web.service. Great!

So only problem 1 remains. The auth file (/var/lib/deluged/.config/deluge/auth) has one line with in it "localclient:xxx:10". You suggest adding "test:test:10". But wouldn't that make it so that I would need to do "deluge-console -U test -P test cache"? Or something similar to that? Why would I otherwise add test:test:10? You also said I could change the localclient to test:test:10. But isn't the localclient line for the webui? Whouldn't that block the web-ui from accessing the daemon?

My goal is

Code: Select all

(sudo if needed) deluge-console cache
not

Code: Select all

deluge-console -U test -P test cache
or
sudo -u debian-deluged deluge-console cache
I'm just going to be honest and say that I just don't completely understand the auth file. What does it do? "Yeah with users and passwords and stuff for accessing deluge" I don't understand it. The deluge support page explains how to add a "user" but not how to use it or what effect it has. I think you get it. I don't understand it.

It's me again but it's 20 minutes later now:
I stopped deluged and deluge-web. I left the localclient line alone and added a second line with "test:test:10". I started deluged and deluge-web.

Code: Select all

deluge-console -U test -P test cache
did work. But now I want it without "-U test -P test". Let's first just start with: Is that atleast possible?
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 »

Auth file is for defining users/pass for the daemon to authenticate with. You add stuff to hostlist.conf to use/match against said values in the auth, so auth is for daemon and hostlist.conf is for clients connecting to daemon, unless I'm mistaken. I agree the wiki misses a few points regarding this.

I proposed to edit hostlist.conf' localclient section, not the one in auth, or add new in hostlist.conf.

Autologin can be done in webui by just using localclient ID from hostlist.conf of /var/lib/deluged/.config/deluge which is same ID as for localclient account/line in auth in same location, but in my tests doesn't work for consoleui however, hence I suggest adding new line underneath localclient in auth, e.g test:test:10 just as example here. You will not need use any -U or -P for deluge-console if just changing localclient host in hostlist.conf of homedir deluge profile to test/test. webui still works from the localclient already defined in /var/lib/blah.

I know confusing, and I'm not even sure I fully understand the corrolation either :)

Edit: I'm sorry, disregarsd my post, i'm very sorry for the confusion, but just found I was wrong! So need test some more befor posting, and don't have time now, so will first post later and so i´maybe others already have helped you in meantime hopefully.

Indeed running deluge-console with commands doesn't work with my instructions, and I only tested running deluge-console standalone which then can login to host with a return with these mods, but then doesn't work with other commands I see in the non-curses UI then. Sorry again for the confusion - as said I never run like that and have only my own user defined, so don't have these issues, but should then also not provide advice neither of-course, atleast before propper testing. Sorry again!

Edit2: Okay had a few mins, and tried something again, which worked, so I believe this is the best way:

The hostlist.conf and auth file of your /var/lib/deluge/.config/deluge folder should only have one host in them, if they aren't then can easilly get back to new by deleting them with daemons stopped and starting daemons again and stopping them again, which regenerates them. Then either copy these two into your ~/.config/deluge folder, or copy there cotents over instead - if copying, then change owner/permissions afterwards to your own user, like rest files there, if that changed during copying.

If regenrated the files, then need update the web.conf autologin field again, cannot remember name, default_daemon or something.

That's it, now deluge-console works both standalone and with commands afterwards, and webUI. In short, the localclient line of auth in the daemon location need match the auth in user location and the hostlist.conf in user location need have a localclient host defined with same password as the localclient auth in daemon location and also needs defined with same ID as that localclient which can be found in hostlist.conf of daemon i.e. the one added for the webui autologin. Little confusing to say the least lol. :)

Sorry again for confusion.
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 need to edit the auth file for *BOTH* users. The client is trying to use the auth info in it's file to auth to the server. It does not match.
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 and thanks for correction ashmandias. Funny thing is I always used to say that, e.g helped people here also years ago stating this, but then recently found out about hostlist.conf and thought I was wrong before lol :) (I thought auth of daemon matched hostlist of client I mean). Anyway came to same conclusion before in my edits previously. As said uses same user myself, so never had these issues personally and never needed worry about hostlist.conf or auth, as localclient default account authorizes daemon with client automatically if localhost + same user, as is its intended purpose, so never learned fully honestly.

Sorry for wrong info Cas.
Post Reply