Fedora 34 - Deluge Daemon 2.0.3 lies about port being in use by another service

General support for problems installing or using Deluge
swills1
New User
New User
Posts: 9
Joined: Sun Oct 31, 2021 11:36 pm

Fedora 34 - Deluge Daemon 2.0.3 lies about port being in use by another service

Post by swills1 »

I have been trying to get Deluge to work all weekend. I have had 1.3.15 running for a few years with zero issues, but that box is dying so I must move off of it. I noticed that on Debian and Ubunutu, this patch hasn't been applied. But Fedora comes out of the box with it in place in the /deluge/log.py

https://git.deluge-torrent.org/deluge/c ... ed0f2c3206

Deluge doesn't seem to come with the newest version of the Python package Twisted on any of the three mentioned distros. But they all come with a version after the issue tied to the patch was supposedly fixed. Each of the three distros have major cons when using Deluge 2.0.3. So I am just trying to stick with Fedora 34 that is entirely up to date and working through every issue I see to hopefully end up with something stable.

So far, I have been able to get it to be a lot more stable by updating twisted to the newest version with
pip install twisted --upgrade
. I am using deluge-daemon 2.0.3 with deluge-web. Every now and then the daemon just crashes. I dump the logs with
deluged -L debug -l /home/swills1/log
, and it tells me the following. Keep in mind, I was using the default port, got the following error, so I changed the port to 58855 in the core.conf and web settings. I stopped and started deluge daemon before and after. But I still get the following. This port is absolutely not in use. This is a momentary issue. It will crash, I wait a about 20 seconds and it's good. Some times it is super hard to get it back, but typically if I just wait it comes back up.
18:32:30 [DEBUG ][deluge.core.rpcserver :415 ] Daemon already running or port not available.: Couldn't listen on localhost:58855: [Errno 98] Address already in use.
18:32:30 [ERROR ][deluge.core.daemon_entry :124 ] Cannot start deluged, listen port in use.
Check for other running daemons or services using this port: localhost:58855
18:32:30 [INFO ][deluge.core.daemon_entry :137 ] Exiting...
What is happening is, it is crashing then when it tries to restart, the daemon is already running. Any idea where to look to get a better idea of why it crashes? It crashes every 3 min. Sometimes it just pops back up, others I have to keep poking it.

A second problem is, when I reboot the box - all torrent come up in an error state when using Fedora. This does not happen with Ubunutu or Debian. So everything must be rechecked after a reboot. Fedora makes everything super easy and I am confident I can get is somewhat stable if I can solve the above, but this is an absolute killer knowing I can't reboot my box without having to recheck every single torrent. So Debian and Ubunut might be more manual work to get things stable, that may be worth not having to recheck.

Thanks.

EDIT

Okay, the rebooting and things being in an error state looks like it might be starting deluge-daemon before mounting my file share. Restarting deluge-daemon puts all torrents in their proper state. So that part is solved. I just need to make sure mount happens first. But the continual crashing and trying to restart is still a thing.
swills1
New User
New User
Posts: 9
Joined: Sun Oct 31, 2021 11:36 pm

Re: Fedora 34 - Deluge Daemon 2.0.3 lies about port being in use by another service

Post by swills1 »

It looks like AutoAdd might be the problem. I turned it off and things seemed great. I noticed it got enabled in the conf file under var/lib/deluge/.config/deluge/core.conf but not under /home/swills1/.config/deluge/core.conf. I enabled it in both configs and have it running now. Waiting to see how it goes. Hopefully it was as simple as putting it in my home directory config. If I have to disable it, then Deluge is kind of pointless for me. We'll see.
swills1
New User
New User
Posts: 9
Joined: Sun Oct 31, 2021 11:36 pm

Re: Fedora 34 - Deluge Daemon 2.0.3 lies about port being in use by another service

Post by swills1 »

Definitely looking like AutoAdd. I tried Fedora 35 too since its version of rb_libtorrent and libtorrent-python3 are the newer versions. Turning off AutoAdd stops Deluge Daemon crashing and memory doesn't climb to the max. Same for Ubuntu and Debian.

In short, AutoAdd current build makes Deluge 2.0.3 unstable. I guess we can turn it on when we want to use it, then turn it off. Really stinks not having watch folder(s). When I turn it on and it crashes, it takes a while to get it back up.
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Fedora 34 - Deluge Daemon 2.0.3 lies about port being in use by another service

Post by mhertz »

Sorry don't know, but you could try latest autoadd from develop branch, though the newer commits doesn't seem related, but just in case. Drop in plugin dir of deluge profile of user running daemon, and own if using thinclient.

viewtopic.php?t=55968

Other then that, then imho there's to many things fixed in current develop VS latest stable, so id recommend using that.

Here's a post about installing that easilly, though after posting that, id probably just suggest use 'pip3 install --user git+........ ' instead of making venv(was just easier to fully remove when having other stuff installed by pip under own user, with venv's, or so I believe I.e 'pip uninstall' doesn't remove deps), but regardless.

viewtopic.php?t=55970
swills1
New User
New User
Posts: 9
Joined: Sun Oct 31, 2021 11:36 pm

Re: Fedora 34 - Deluge Daemon 2.0.3 lies about port being in use by another service

Post by swills1 »

Thanks, I actually tried that egg from the first topic you linked. Didn't seem to help and the filename was weird. I'll try the Develop branch of deluge. I was looking for a walk through on it. Thanks. Deluge-Daemon is still crashing with AutoAdd off. It was stable for a bit then wasn't .I'll try develop. Thanks again.
swills1
New User
New User
Posts: 9
Joined: Sun Oct 31, 2021 11:36 pm

Re: Fedora 34 - Deluge Daemon 2.0.3 lies about port being in use by another service

Post by swills1 »

mhertz wrote: Mon Nov 01, 2021 8:54 am Sorry don't know, but you could try latest autoadd from develop branch, though the newer commits doesn't seem related, but just in case. Drop in plugin dir of deluge profile of user running daemon, and own if using thinclient.

viewtopic.php?t=55968

Other then that, then imho there's to many things fixed in current develop VS latest stable, so id recommend using that.

Here's a post about installing that easilly, though after posting that, id probably just suggest use 'pip3 install --user git+........ ' instead of making venv(was just easier to fully remove when having other stuff installed by pip under own user, with venv's, or so I believe I.e 'pip uninstall' doesn't remove deps), but regardless.

viewtopic.php?t=55970
Hello.

I am just not following how to install using git. Instead of using your link I am using pip install --user git+https://github.com/deluge-torrent/deluge.git@develop.

I et up a service file and ry to start it but it tells me it can't import deluge. But the deluge module is there.

systemctl status deluged

Code: Select all

Nov 01 13:31:58 seed systemd[1]: Started Deluge Bittorrent Client Daemon.
Nov 01 13:31:58 seed deluged[8068]: Traceback (most recent call last):
Nov 01 13:31:58 seed deluged[8068]:   File "/home/swills1/.local/bin/deluged", line 5, in <module>
Nov 01 13:31:58 seed deluged[8068]:     from deluge.core.daemon_entry import start_daemon
Nov 01 13:31:58 seed deluged[8068]: ModuleNotFoundError: No module named 'deluge'
Nov 01 13:31:58 seed systemd[1]: deluged.service: Main process exited, code=exited, status=1/FAILURE
Nov 01 13:31:58 seed systemd[1]: deluged.service: Failed with result 'exit-code'.
What is the proper way to install this from develop? I pull down develop and I have all the pieces. But I guess I don't know how to wire it up.

EDIT

I might have found an easy way. Use this but change it to develop. Testing now.
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Fedora 34 - Deluge Daemon 2.0.3 lies about port being in use by another service

Post by mhertz »

I just tested on an ubuntu 21.10 VM, and it worked without venv too, i.e.: 'pip3 install --user git+git://deluge-torrent.org/deluge.git', of-course need git installed.

Then after making the services and 'sudo systemctl daemon-reload', then didn't work from systemd, only manual from terminal, and status from systemd was that it exited to quickly, and I fixed by adding 'User=martin' under '[Service]' and 'sudo systemctl daemon-reload' - you can use 'deluge' user or whatever user instead of your own if preffered instead.

It is develop branch by default btw, so don't need specify branch, unless wanting stable, which is master branch.

Personally I hate untracked files under /, so prefer venv's or --user installs, but if not caring, then can also just use "sudo pip install ..." etc.

Sorry, don't know why states no module - does deluge/deluged start fine from terminal without systemd?
swills1
New User
New User
Posts: 9
Joined: Sun Oct 31, 2021 11:36 pm

Re: Fedora 34 - Deluge Daemon 2.0.3 lies about port being in use by another service

Post by swills1 »

I went a different route.

Using Ubunutu 20.04 VM on Proxmox host;

sudo add-apt-repository -u ppa:deluge-team/develop

sudo apt-get install deluged -y

sudo apt-get install deluge-web -y

Then I used your linked doc to create the service files.
https://deluge.readthedocs.io/en/latest ... rvice.html

Then I started the services and checked the status (systemctl status) and they were running. I currently have 2.1.1 installed and running! Something is wrong with my user. It won't let me log in when going to the web portal. But this is great that I am this far. I'll figure out the user here in a bit.

Image

EDIT

Actually user looks good. The connection manager shows my daemon online. I click connect in the web portal and it doesn't actually connect. Super close though!
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Fedora 34 - Deluge Daemon 2.0.3 lies about port being in use by another service

Post by mhertz »

Cool :) The reason I posted that thread with instructions initially, was that this "daily" develop PPA, unless i'm missing something, is supplying a year old dev build, but better than 2.0.3 atleast I think.

Edit: Maybe 'allow remote connections' need enabled? I'm not sure about localhost, but maybe is needed, e.g. if server and daemon run from different users. It's in core.conf of deluge-profile of daemon and restart daemons.
swills1
New User
New User
Posts: 9
Joined: Sun Oct 31, 2021 11:36 pm

Re: Fedora 34 - Deluge Daemon 2.0.3 lies about port being in use by another service

Post by swills1 »

Are you able to connect via web portal? With what user? I have never had to allow remote connections before.

EDIT

Allow remote wasn't it. I am missing some part of setup. I have to be. It says online, I click connect, it just does closes the dialogue box and doesn't connect.

EDIT 2

So I re-set up the VM, installed deluged and deluge-web from the normal repo, then added the develop repo, then updated deluged to 2.1.1, then rebooted. So I am using web 2.0.3 with daemon 2.1.1. It is working. I am tempted to update deluge-web. I need to firstmake a system file for it because Ubuntu doesn't come with one for web. Then I will back up my working vm, and attempt to update web. But I am running on 2.1.1 daemon!!! Excited to test it out. I can see plugins and all else!

There are so many little fixes so far!

EDIT 3

I updated deluge-web AFTER installing from normal repo and making a service file. Then I rebooted and it just worked. Now I just need to wait and see how stable it is. Before it was taking a moment to load tabs and things, but not now. (so far)

Thanks!
Last edited by swills1 on Mon Nov 01, 2021 10:44 pm, edited 3 times in total.
Post Reply