unable to connect to console

General support for problems installing or using Deluge
leif
New User
New User
Posts: 4
Joined: Fri Oct 04, 2024 12:27 am

Re: unable to connect to console

Post by leif »

I had this problem because I was running Deluge using the container from LinuxServer.io listed here https://docs.linuxserver.io/images/docker-deluge/

when I try to enter the container with `docker compose exec deluge bash` and then try to run `deluge-console`, it is not possible to connect to the daemon, you get the same error message `Failed to connect! Password does not match`

However unlike the solutions posted here, it does not seem like it is possible to fix this at all. Because

- docker container defaults to the `root` user with uid 0
- the container is (typically) configured to run under user `abc` with uid 1000
- if you try to enter the container as user `abc` with a command like `docker compose exec --user abc deluge bash`, you still cannot access it because the command `deluge-console` gives error `Unable to use default config directory, exiting... ([Errno 13] Permission denied: '/root/.config')` ; it also does not work with `deluge-console -c /config` (the actual config location in the container) for the same reason
- `sudo` is not installed inside the container so you cannot easily manipulate your permissions or user while inside the container

The only solution I could find for this was, by chance, I already had Deluge installed locally on the server anyway via the system package manager, so I had a local copy of `deluge-console` that was not inside a container but installed at `/usr/bin/deluge-console`

It turns out that if your local user id is 1000 (`id`) the same as the uid configured inside the container, you can just expose the daemon port on the container by making sure `58846:58846` is set in your docker compose file and restarting the container. Then, you can run `deluge-console` on your host system (not the `deluge-console` inside the container) and it should successfully connect to the daemon running inside the container.

I write all this out because, I just spent the last hour trying to figure out how to get the `deluge-console` inside the docker container to work, and I did not see anything online that mentioned these headaches. Also weird that the only way I could get it to work was to connect to the deluge daemon inside the container with a `deluge-console` running natively on the host machine. Never would have considered that until I realized that by default the host `deluge-console` was trying to connect to 127.0.0.1:58846, which was already listed in the docker-compose.yaml.

hope this helps someone
User avatar
ambipro
Moderator
Moderator
Posts: 672
Joined: Thu May 19, 2022 3:33 am
Contact:

Re: unable to connect to console

Post by ambipro »

Just to clarify, I ran deluge-console in linuxserver's container as root - as you said that is the default when you get a console....and I can connect to the local RPC daemon.

There shouldn't be any issue running deluge-console as any user. I'm not sure what issue you are having as root.

The permission denied for /root/.config is unrelated to anything other than standard permissions reading in the container, but irrelevant as running it as root should work.

What I did.

1. Shell into container
2. Run deluge-console
3. Add the RPC host if not already present - I used the host IP rather than the localhost/127 - as typically in docker the daemon would bind to the 172 IP and not localhost in some cases. Exposing RPC port is necessary.
4. Hit enter to connect to the host...

Image
leif
New User
New User
Posts: 4
Joined: Fri Oct 04, 2024 12:27 am

Re: unable to connect to console

Post by leif »

hi ambipro, thanks for the reply, I gave it another shot as you described, but still does not work. Here is what I did

- my docker-compose.yaml looks like this

Code: Select all

services:
  deluge:
    image: lscr.io/linuxserver/deluge:latest
    container_name: deluge
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=EST
      - DELUGE_LOGLEVEL=error #optional
    volumes:
      - /home/me/apps/deluge:/config
    ports:
      - 8112:8112 # web interface
      - 6881:6881
      - 6881:6881/udp
      - 6882:6882
      - 6882:6882/udp
      - 6883:6883
      - 6883:6883/udp
      - 6884:6884
      - 6884:6884/udp
      - 6885:6885
      - 6885:6885/udp
      - 6886:6886
      - 6886:6886/udp
      # daemon port
      - 58846:58846
    restart: unless-stopped
- enter the container with docker compose exec deluge bash
- run deluge-console, looks like this

https://imgur.com/a/M4YSuKe

- try to connect to the daemon listed at 127.0.0.1:58846 but it does not work;

https://imgur.com/a/QalkYDS
( Password does not match )

- tried adding a new host but using the IP address of the server on the network

https://imgur.com/a/g01N4Do

( Invalid port. Must be an integer )

Not sure exactly what the 172 IP address you refer to would be. And not really sure what else would be needed to make it work. I dont want to derail the thread too much tho, since I got it to work with the local deluge-console I guess that is enough, but it would be nice to figure out why this is not working. Thanks.
User avatar
ambipro
Moderator
Moderator
Posts: 672
Joined: Thu May 19, 2022 3:33 am
Contact:

Re: unable to connect to console

Post by ambipro »

The port integer thing I believe mhertz posted a fix for.

You can also use my container which is based off linuxserver and running the develop branch (latest updates) if you'd like to instead.

viewtopic.php?t=56891 This post - you'd just change the image to mine (I have both libtorrentv1 and 2x (master) image tags)

Unfortunately, with the image you have even if you changed the file mhertz fixed, it will reset everytime the container is recreated/updates.

I believe you can also edit some conf files though....but the easiest thing would be to use my container if you're going to be changing this often.

172 is the internal docker network IP address range, all of your containers will have that IP class unless you changed the network configuration.

As you can see, 127 does not work, but your host IP does, the issue is the port number.

Also you will need use the RPC user and password located under the Daemon settings, rather than any webui passwords.
Post Reply