deluge just broke on archlinux

General support for problems installing or using Deluge
pjlbyrne
Leecher
Leecher
Posts: 71
Joined: Thu May 22, 2014 9:28 am

deluge just broke on archlinux

Post by pjlbyrne »

root@nelly # systemctl status deluged.service
× deluged.service - Deluge Bittorrent Client Daemon
Loaded: loaded (/etc/systemd/system/deluged.service; enabled; preset: disabled)
Drop-In: /etc/systemd/system/deluged.service.d
└─user.conf
Active: failed (Result: exit-code) since Wed 2024-04-03 16:28:57 BST; 1h 11min ago
Duration: 1.830s
Docs: man:deluged
Process: 304 ExecStart=/usr/bin/deluged -d -L info -l /var/log/deluge/daemon.log (code=exited, status=1/FAILURE)
Main PID: 304 (code=exited, status=1/FAILURE)
CPU: 804ms

Apr 03 16:28:57 nelly deluged[304]: dists = ws.resolve(reqs, Environment())
Apr 03 16:28:57 nelly deluged[304]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Apr 03 16:28:57 nelly deluged[304]: File "/usr/lib/python3.11/site-packages/pkg_resources/__init__.py", line 829, in resolve
Apr 03 16:28:57 nelly deluged[304]: dist = self._resolve_dist(
Apr 03 16:28:57 nelly deluged[304]: ^^^^^^^^^^^^^^^^^^^
Apr 03 16:28:57 nelly deluged[304]: File "/usr/lib/python3.11/site-packages/pkg_resources/__init__.py", line 870, in _resolve_dist
Apr 03 16:28:57 nelly deluged[304]: raise DistributionNotFound(req, requirers)
Apr 03 16:28:57 nelly deluged[304]: pkg_resources.DistributionNotFound: The 'zope-interface>=5' distribution was not found and is required by twisted
Apr 03 16:28:57 nelly systemd[1]: deluged.service: Main process exited, code=exited, status=1/FAILURE
Apr 03 16:28:57 nelly systemd[1]: deluged.service: Failed with result 'exit-code'.





I tried rebuilding from source again after 'git pull' but - same error.

May be related to:
https://stackoverflow.com/questions/677 ... face-4-6-0

??
mhertz
Moderator
Moderator
Posts: 2218
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: deluge just broke on archlinux

Post by mhertz »

Yes, that's an issue with needing update setuptools https://github.com/deluge-torrent/delug ... 1712919646

But you found that yourself I see - good job :)
pjlbyrne
Leecher
Leecher
Posts: 71
Joined: Thu May 22, 2014 9:28 am

Re: deluge just broke on archlinux

Post by pjlbyrne »

Oh thanks - do I need to pin setuptools version back then? Do I do that in archlinux package manager pacman?
Sorry, I've been building my own deluge 2 from git for years but I don't know much about the build system.
mhertz
Moderator
Moderator
Posts: 2218
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: deluge just broke on archlinux

Post by mhertz »

I'm sorry, I replied before being on my computer, and just knew from experience that such error was because of setuptools pre 62.0. However, now after checking on my system then I don't have that issue myself, and neither should presumably, because arch uses python-setuptools 69.0.3. I tested the deluge repo package, and also built from source both 2.1.1 release and develop branch. All ran without issue.

However, I suspect that you have some cached older setuptools used, under ~/.cache/pip/*, so when installing from source with pip, then probably need -U or --no-cache-dir to override - can also just delete setuptools manually, no need, but can find with 'find ~/.cache/pip -path *setuptools*'. Hmm, wait a minute, I write while testing, and setuptools comes from the venv, if using such, which python used the cache for, when generating it, i.e. through 'python -m venv' etc. Anyway, quickest is just to in the venv run 'bin/pip install -U setuptools'. Also, despite using --system-site-packages when generating venv, then still uses setuptools from pypi, including the one in cache if there, hence issue, presumably.

Sorry for little confusing written, and let me know if anything unclear.

Edit: Venv's --upgrade-deps switch, as in e.g. 'python -m venv --system-site-packages --upgrade-deps ~/.local/deluge' can also be used as alternative to updating setuptools manually in venv, both for already made venv's and for generating new ones without this issue of old cached setuptools used.

Edit2: Sorry your logs clearly show you don't use any venv, and you don't use makepkg as would use repo python-setuptools, already up-to-date. So you install from source and install as root - I guess you then possibly have a user install of setuptools installed, presumably under deluge user, if using that user from your systemd service setup, e.g. check with 'sudo -u deluge pip show setuptools'. If so, then you can then remove it, so repo version used instead, or update it, i.e. 'sudo -u deluge pip uninstall setuptools --break-system-packages' or 'sudo -u deluge pip install -U setuptools --break-system-packages', latter switches because pep668. If wrong in preceding thought and so not having old setuptools under deluge user local install, then maybe under /usr/local/* or alike, from before pep668, so if having an older(<62) setuptools under /usr/local/*, then can run one of the two before mentioned command-lines(remove or upgrade), and just need omit the '-u deluge' part to make work here.
pjlbyrne
Leecher
Leecher
Posts: 71
Joined: Thu May 22, 2014 9:28 am

Re: deluge just broke on archlinux

Post by pjlbyrne »

No need for sorry! I am very grateful for your kind attention. I'm afraid I don't seem to have any .cache versions of setuptools.

I tried building again and the output ends with:
/home/_____/repos/deluge
root@nelly # python setup.py install
..
Installed /usr/lib/python3.11/site-packages/deluge-2.1.1.dev99-py3.11.egg
Processing dependencies for deluge==2.1.1.dev99
Searching for zope-interface>=5
Reading https://pypi.org/simple/zope-interface/
No local packages or working download links found for zope-interface>=5
error: Could not find suitable distribution for Requirement.parse('zope-interface>=5')

Very peculiar - it seemed to break on a reboot, not even system update.
Got to go for day job now ... thanks again for your suggestions mherz.
mhertz
Moderator
Moderator
Posts: 2218
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: deluge just broke on archlinux

Post by mhertz »

Appreciate your reply buddy :)

Hmm, indeed you're right... I'll investigate and post later, dunno when exactly have time/motivation to look in depth, but in mean time, then works fine through the 'pip install .' method, which is more recommended these days seemingly, though as said because of pep668 then need add --break-system-packages if wanting install into a non-venv, like root as in your case - it is more recommended install into a venv though, manually or through e.g. pipx tool. I'll post back as said.

Edit: OK, solution is to specifically needing specify prefix, for setup.py based installs, I.e. here:

Code: Select all

# python setup.py install --root=/
pjlbyrne
Leecher
Leecher
Posts: 71
Joined: Thu May 22, 2014 9:28 am

Re: deluge just broke on archlinux

Post by pjlbyrne »

Ok thanks mherz. Is there a python version you recommend for building deluge? archlinux is on 3.11 - but might an older version be better?

I will set up a new venv to build & run deluge.
mhertz
Moderator
Moderator
Posts: 2218
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: deluge just broke on archlinux

Post by mhertz »

I don't think an older python version would give you any benefits really, well except if getting your libtorrent from pypi(with pip), where only have installable wheels for up to python 3.10, but not relevant if using libtorrent from arch's [extra] repo, aur or build yourself.

Anyway, as said in my edit, then you just need add a '--root=/' argument to your 'python setup.py install' command line, to fix your issue, and so don't need bother with venv's and whatnot, unless actually wanting to, sorry if made it sound like that.

And you're very welcome mate, and learned something new myself which is always nice(this extra fail-reason other than outdated setuptools, plus that --root arg also additionally omits that stupid *egg dir otherwise installed into by default when installed through setup.py method). Thanks.
pjlbyrne
Leecher
Leecher
Posts: 71
Joined: Thu May 22, 2014 9:28 am

Re: deluge just broke on archlinux

Post by pjlbyrne »

I did try adding '--root=/':
# python setup.py install --root=/

but I seem to have the same problem:
root@nelly # systemctl status deluged.service
× deluged.service - Deluge Bittorrent Client Daemon
Loaded: loaded (/etc/systemd/system/deluged.service; enabled; preset: disabled)
Drop-In: /etc/systemd/system/deluged.service.d
└─user.conf
Active: failed (Result: exit-code) since Fri 2024-04-05 12:12:32 BST; 55s ago
Duration: 1.409s
Docs: man:deluged
Process: 27088 ExecStart=/usr/bin/deluged -d -L info -l /var/log/deluge/daemon.log (code=exited, status=1/FAILURE)
Main PID: 27088 (code=exited, status=1/FAILURE)
CPU: 1.275s

Apr 05 12:12:32 nelly deluged[27088]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Apr 05 12:12:32 nelly deluged[27088]: File "/usr/lib/python3.11/site-packages/pkg_resources/__init__.py", line 829, in resolve
Apr 05 12:12:32 nelly deluged[27088]: dist = self._resolve_dist(
Apr 05 12:12:32 nelly deluged[27088]: ^^^^^^^^^^^^^^^^^^^
Apr 05 12:12:32 nelly deluged[27088]: File "/usr/lib/python3.11/site-packages/pkg_resources/__init__.py", line 870, in _resolve_dist
Apr 05 12:12:32 nelly deluged[27088]: raise DistributionNotFound(req, requirers)
Apr 05 12:12:32 nelly deluged[27088]: pkg_resources.DistributionNotFound: The 'zope-interface>=5' distribution was not found and is required by twisted
Apr 05 12:12:32 nelly systemd[1]: deluged.service: Main process exited, code=exited, status=1/FAILURE
Apr 05 12:12:32 nelly systemd[1]: deluged.service: Failed with result 'exit-code'.
Apr 05 12:12:32 nelly systemd[1]: deluged.service: Consumed 1.275s CPU time.



I suppose I must have missed some other step which you performed.

I am compiling a separate python3.10 distribution. I think this will be better for stability in the future.

I suppose ideally someone ought to support deluge 2 via pacman, but I expect the list of people who might do that is very short and probably includes me! I don't know anything about pacman package development but perhaps I can find the time to look into it.
mhertz
Moderator
Moderator
Posts: 2218
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: deluge just broke on archlinux

Post by mhertz »

Deluge 2 stable is supported in arch, and dev builds are in AUR, plus easy make your own dev branch package - let me know if need some arch/packaging help, not an expert myself though, but might be able to help possibly, if needed.

Anyway, I know you probably might not need this anyway, I mean if changing to py3.10 and possibly venv, but just for completeness, then omitting --root arg will list that zope-interface error at end of installing, but is still installed however, and seems work running too. If adding --root arg, then no zope-interface error at end of install, but neither installed hence errors out on run! If had run without --root precedingly, then would be there, even if uninstalling deluge before, as deps not uninstalled. Also, if had python-zope-interface installed with pacman before, then also would be there obviously, and can also install it afterwards to fix through 'pacman -S python-zope-interface'. Also, if having installed deluge without --root arg, and then afterwards with --root arg, then you would have two deluge installs as old one still lingering with old path i.e. non --root arg is in /usr/lib/python3.11/site-packages/deluge-2.1.1.dev99-py3.11.egg/, and then new install with --root arg in /usr/lib/python3.11/site-packages/deluge/. Old can be deleted manually or from pip uninstall deluge --break-system-packages, where first time removes one of the deluge installs and repeating the command the other. If you don't see what I see, then what version states pip show setuptools and pip show zope-interface ?

Really confusing above, apologies. I don't like taint my / with untracked files(pacman) so made new fresh arch VM for these tests, as didn't have any test arch VMs, and wanted exact reproducal.
Post Reply