Re: unable to connect to console
Posted: Fri Oct 04, 2024 12:39 am
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
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