Can't start service in Gentoo

General support for problems installing or using Deluge
Post Reply
Lagu
New User
New User
Posts: 9
Joined: Sun Nov 15, 2015 11:31 pm

Can't start service in Gentoo

Post by Lagu »

Hi! I used Deluge from a long time, but when I started a new pc with it, has been so hard to init! this seems to happens in Gentoo mainly.

There is two main issues:

- Can't enable the logs from systemd
- Deluge is empty (NotAuthorizedError: Auth level too low: 0 < 5)

Lets start with the first one and systemctl configs:

Code: Select all

systemctl cat deluged
# /usr/lib/systemd/system/deluged.service
[Unit]
Description=Deluge BitTorrent client
Documentation=man:deluged
After=network.target local-fs.target
Wants=local-fs.target

[Service]
ExecStart=/usr/bin/deluged -d -c ${DELUGED_HOME} ${DELUGED_OPTS}

[Install]
WantedBy=multi-user.target

# /etc/systemd/system/deluged.service.d/00gentoo.conf
[Service]
User=deluge
Group=deluge
#UMask=0002
Environment="DELUGED_HOME=/var/lib/deluge" "DELUGED_OPTS=-p 58846"

Code: Select all

systemctl status deluge-web
○ deluge-web.service - Deluge WebUI
     Loaded: loaded (/usr/lib/systemd/system/deluge-web.service; enabled; preset: disabled)
    Drop-In: /etc/systemd/system/deluge-web.service.d
             └─00gentoo.conf
     Active: inactive (dead) since Thu 2025-02-13 09:20:46 -03; 35min ago
   Duration: 9h 55min 10.303s
 Invocation: 7acd107ca9db45e6809e374117e3b831
       Docs: man:deluge-web
   Main PID: 2950 (code=exited, status=0/SUCCESS)
   Mem peak: 88.5M
        CPU: 6.851s

feb 12 23:25:36 localhost.localdomain systemd[1]: Started Deluge WebUI.
feb 12 23:25:49 localhost.localdomain deluge-web[2950]: 23:25:49 [ERROR   ][deluge.ui.web.json_api     :1672] Unable to connect to daemon, check host_id "64f7a08fadc84327af076a7789030843" is correct.
feb 12 23:26:11 localhost.localdomain deluge-web[2950]: 23:26:11 [ERROR   ][deluge.ui.web.json_api     :1672] Unable to connect to daemon, check host_id "64f7a08fadc84327af076a7789030843" is correct.
feb 13 09:20:46 localhost.localdomain systemd[1]: Stopping Deluge WebUI...
feb 13 09:20:46 localhost.localdomain systemd[1]: deluge-web.service: Deactivated successfully.
feb 13 09:20:46 localhost.localdomain systemd[1]: Stopped Deluge WebUI.
feb 13 09:20:46 localhost.localdomain systemd[1]: deluge-web.service: Consumed 6.851s CPU time, 88.5M memory peak.

Code: Select all

localhost /etc/conf.d # cat deluged
# /etc/conf.d/deluged
# Change this to the user you want to run deluged as.
# You may specify a group too, after a colon
DELUGED_USER="deluge:deluge"
# DELUGED_UMASK="0002"
DELUGED_OPTS="-p 58846 -L debug -l /var/lib/deluge/deluge.log"
DELUGED_HOME="/var/lib/deluge"

Code: Select all

localhost /etc/conf.d # cat deluge-web
# /etc/conf.d/deluge-web
# Change this to the user you want to run deluged as.
# You may specify a group too, after a colon
DELUGE_WEB_USER="deluge:pelota"
DELUGE_WEB_HOME="/deluge"
DELUGE_WEB_OPTS="-p 8112 -L debug -l /deluge/deluge-web.log"
In theory, in Gentoo, you should not touch the systemd files, and instead we need to update the ones in /etc/conf.d, but after testing I noticed they are not working, for example the params to enable logs do not works....

If you try to change: /etc/systemd/system/deluged.service.d/00gentoo.conf and add the params like:

Code: Select all

[Service]
User=deluge
Group=deluge
#UMask=0002
Environment="DELUGED_HOME=/var/lib/deluge" "DELUGED_OPTS=-p 58846 -L debug -l /var/lib/deluge/deluge.log"
Then systemd returns a very weird error:

Code: Select all

× deluged.service - Deluge BitTorrent client
     Loaded: loaded (/usr/lib/systemd/system/deluged.service; enabled; preset: disabled)
    Drop-In: /etc/systemd/system/deluged.service.d
             └─00gentoo.conf
     Active: failed (Result: exit-code) since Thu 2025-02-13 09:55:56 -03; 2s ago
   Duration: 401ms
 Invocation: c9b7638fd543487199f9ced1ee3e3b94
       Docs: man:deluged
    Process: 143047 ExecStart=/usr/bin/deluged -d -c ${DELUGED_HOME} ${DELUGED_OPTS} (code=exited, status=2)
   Main PID: 143047 (code=exited, status=2)
   Mem peak: 28M
        CPU: 359ms

feb 13 09:55:56 localhost.localdomain systemd[1]: Started Deluge BitTorrent client.
feb 13 09:55:56 localhost.localdomain deluged[143047]: usage: deluged [-h] [-V] [-c <config>] [-l <logfile>] [-L <level>]
feb 13 09:55:56 localhost.localdomain deluged[143047]:                [--logrotate [<max-size>]] [-q] [--profile [<profile-file>]] [-u <ip-addr>]
feb 13 09:55:56 localhost.localdomain deluged[143047]:                [-p <port>] [-i <ip-addr>] [-o <interface>]
feb 13 09:55:56 localhost.localdomain deluged[143047]:                [--read-only-config-keys <comma-separated-keys>] [-P <pidfile>] [-d]
feb 13 09:55:56 localhost.localdomain deluged[143047]:                [-U <user>] [-g <group>]
feb 13 09:55:56 localhost.localdomain deluged[143047]: deluged: error: argument -p/--port: invalid int value: ' 58846 -L debug -l /var/lib/deluge/deluge.log'
feb 13 09:55:56 localhost.localdomain systemd[1]: deluged.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
feb 13 09:55:56 localhost.localdomain systemd[1]: deluged.service: Failed with result 'exit-code'.
So, how to enable logs to depure the next section faces this issue, any ideas?

We can start this process manually (to have logs), but the web-ui is empty.... it ask the password to access, and then everything is empty, if we try to add a torrent happens nothing.

If we check deluge-web logs we can find:

Code: Select all

09:29:51 [DEBUG   ][deluge.ui.client           :1672] RPCError Message Received!
--------------------------------------------------------------------------------
RPCRequest: core.get_external_ip()
--------------------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/deluge/core/rpcserver.py", line 330, in dispatch
    raise NotAuthorizedError(auth_level, method_auth_requirement)
deluge.error.NotAuthorizedError: Auth level too low: 0 < 5

NotAuthorizedError: Auth level too low: 0 < 5
I started this from zero, the empty folder and owned by the user deluge, so it start from default, the password to start is deluge, but still I got that types of messages, I'm uploading deluged and deluge-web logs.

There is a password do not match in the deluge-web logs, but no idea which one and why there is no error on the web-ui about it.

I'm using deluge 2.1.1.

Thx!
Attachments
deluge.zip
(39.7 KiB) Downloaded 163 times
shinger
Seeder
Seeder
Posts: 146
Joined: Sat Jun 05, 2010 1:02 pm

Re: Can't start service in Gentoo

Post by shinger »

Hello Lagu,

I would advice you to first start with the basics.

I see for example.

Code: Select all

feb 13 09:55:56 localhost.localdomain deluged[143047]: usage: deluged [-h] [-V] [-c <config>] [-l <logfile>] [-L <level>]
feb 13 09:55:56 localhost.localdomain deluged[143047]:                [--logrotate [<max-size>]] [-q] [--profile [<profile-file>]] [-u <ip-addr>]
feb 13 09:55:56 localhost.localdomain deluged[143047]:                [-p <port>] [-i <ip-addr>] [-o <interface>]
feb 13 09:55:56 localhost.localdomain deluged[143047]:                [--read-only-config-keys <comma-separated-keys>] [-P <pidfile>] [-d]
feb 13 09:55:56 localhost.localdomain deluged[143047]:                [-U <user>] [-g <group>]
feb 13 09:55:56 localhost.localdomain deluged[143047]: deluged: error: argument -p/--port: invalid int value: ' 58846 -L debug -l /var/lib/deluge/deluge.log'
Could you open deluged in the background with ( & at the end of the command) not using systemd unit file to start deluged, but just the normal command.

In my case it is for example /usr/bin/deluged -d -L info -l /var/log/deluge/deluged.log

If you have managed to make that work, then we can look if you still have the same problem maybe then syntax within the systemd unit file is incorrect.

If we have managed to fix deluged + deluged throught systemd unit file, then we will be looking at deluge-web.
===============================================================
Server: Rock 5B 8 Cores (ARM), 16 GB RAM, 2 TB 970 Evo +
OS: Linux Ubuntu 24.04 LTS
Deluge: v2.1.2
Plugins: Blocklist, LabelPlus, ItConfig, MyScheduler, Stats, Notifications, YaRSS2
Lagu
New User
New User
Posts: 9
Joined: Sun Nov 15, 2015 11:31 pm

Re: Can't start service in Gentoo

Post by Lagu »

Hi! I have tested that, I can start deluged successfully, works nice.

The only issue is when I start from systemd using the params above, I checked the format, is I think is correct, is the same file above:
/etc/systemd/system/deluged.service.d/00gentoo.conf

Code: Select all

[Service]
User=deluge
Group=deluge
#UMask=0002
Environment="DELUGED_HOME=/var/lib/deluge" "DELUGED_OPTS=-p 58846 -L debug -l /var/lib/deluge/deluge.log"
No idea why is failing with that error....
shinger
Seeder
Seeder
Posts: 146
Joined: Sat Jun 05, 2010 1:02 pm

Re: Can't start service in Gentoo

Post by shinger »

Hi Lagu,

Thanks for the reply, then we have to focus on your systemd unit file as deluged works fine.

Could you do a

journalctl -u <name of the systemd unit file>

mine looks like this

journalctl -u deluged.service

I want to see more logs
===============================================================
Server: Rock 5B 8 Cores (ARM), 16 GB RAM, 2 TB 970 Evo +
OS: Linux Ubuntu 24.04 LTS
Deluge: v2.1.2
Plugins: Blocklist, LabelPlus, ItConfig, MyScheduler, Stats, Notifications, YaRSS2
shinger
Seeder
Seeder
Posts: 146
Joined: Sat Jun 05, 2010 1:02 pm

Re: Can't start service in Gentoo

Post by shinger »

Btw,

Can you try to change the ExecStart

From this
ExecStart=/usr/bin/deluged -d -c ${DELUGED_HOME} ${DELUGED_OPTS}

To this

ExecStart=/usr/bin/deluged -d -c /var/lib/deluge -p 58846 -L debug -l /var/lib/deluge/deluge.log

Also make sure you have write permission with the user or group deluge to the directory + file /var/lib/deluge/deluge.log
===============================================================
Server: Rock 5B 8 Cores (ARM), 16 GB RAM, 2 TB 970 Evo +
OS: Linux Ubuntu 24.04 LTS
Deluge: v2.1.2
Plugins: Blocklist, LabelPlus, ItConfig, MyScheduler, Stats, Notifications, YaRSS2
Post Reply