unable to find user in passwd file (docker compose) - Pollo - 2024-12-18
Hello! I am trying to set up docker and after using the documentation for docker compose setup, I'm getting this error when I try to start the container with docker compose up:
"Error response from daemon: unable to find user pete: no matching entries in passwd file"
I don't understand why i'm getting this error because my user is in the passwd file already. I am running the latest stable build of the Ubuntu docker container runtime (27.2.0). Here is my docker-compose.yml file:
Code: services:
jellyfin:
image: 'jellyfin/jellyfin:latest'
container_name: jellyfin
user: pete:pete
network_mode: 'host'
ports:
- 8096:8096
volumes:
- /var/snap/docker/common/var-lib-docker/volumes/jellyfin-config:/config
- /var/snap/docker/common/var-lib-docker/volumes/jellyfin-cache:/cache
- type: bind
source: /media/pete/{media dir}
target: /media
#- type: bind
#source: /path/to/media2
#target: /media2
#read_only: true
# Optional - extra fonts to be used during transcoding with subtitle burn-in
- type: bind
source: /home/pete/snap/docker/jellyfin/fonts
target: /usr/local/share/fonts/custom
read_only: true
restart: 'unless-stopped'
# Optional - alternative address used for autodiscovery
#environment:
#- JELLYFIN_PublishedServerUrl=http://example.com
# Optional - may be necessary for docker healthcheck to pass if running in host network mode
extra_hosts:
- 'host.docker.internal:host-gateway'
Any help will be appriciated!
RE: unable to find user in passwd file (docker compose) - theguymadmax - 2024-12-18
In the terminal, type: id
This will display your UID and GID, which you can then enter for the user. See the example below:
Code: services:
jellyfin:
image: jellyfin/jellyfin:latest
container_name: jellyfin
user: 1000:1000
group_add:
- "992" #render
network_mode: 'host'
volumes:
- /home/max/docker/Jellyfin/Config:/config
- /home/max/docker/Jellyfin/Cache:/cache
- /media/Media:/Media
restart: 'unless-stopped'
devices:
- /dev/dri/renderD128:/dev/dri/renderD128
RE: unable to find user in passwd file (docker compose) - Pollo - 2024-12-18
(2024-12-18, 03:10 AM)theguymadmax Wrote: In the terminal, type: id
This will display your UID and GID, which you can then enter for the user. See the example below:
Code: services:
jellyfin:
image: jellyfin/jellyfin:latest
container_name: jellyfin
user: 1000:1000
group_add:
- "992" #render
network_mode: 'host'
volumes:
- /home/max/docker/Jellyfin/Config:/config
- /home/max/docker/Jellyfin/Cache:/cache
- /media/Media:/Media
restart: 'unless-stopped'
devices:
- /dev/dri/renderD128:/dev/dri/renderD128
Thank you, that seemed to work! However I'm getting a new error now
Code: jellyfin | Unhandled exception.
jellyfin | System.UnauthorizedAccessException: Access to the path '/config/log' is denied.
jellyfin | ---> System.IO.IOException: Permission denied
jellyfin | --- End of inner exception stack trace ---
jellyfin | at System.IO.FileSystem.CreateDirectory(String fullPath, UnixFileMode unixCreateMode)
jellyfin | at System.IO.Directory.CreateDirectory(String path)
jellyfin | at Jellyfin.Server.Helpers.StartupHelpers.CreateApplicationPaths(StartupOptions options)
jellyfin | at Jellyfin.Server.Program.StartApp(StartupOptions options)
jellyfin | at Jellyfin.Server.Program.<Main>(String[] args)
jellyfin exited with code 139
I tried changing the directories, creating them, and disable + re-enabling docker through snap, but I still get the same error. I'm not sure if this change is correct or if I need to make the /config/log directory.
Code: volumes:
- /var/snap/docker/common/var-lib-docker/volumes/jellyfin-config:/var/log/docker/jellyfin/config
- /var/snap/docker/common/var-lib-docker/volumes/jellyfin-cache:/var/log/docker/jellyfin/cache
RE: unable to find user in passwd file (docker compose) - theguymadmax - 2024-12-18
You don't have permission to access the specified locations. To resolve this, I recommend the following steps:
1. Create a Docker Folder in Your Home Directory:
Set up a dedicated directory for your Docker containers and their associated data inside your home directory. This way, you will have full control over the directories and avoid permission issues. Make sure folder are created prior to running docker compose up -d.
Directory Structure:- /home/pete/Docker/
- /home/pete/Docker/Jellyfin/
- /home/pete/Docker/Jellyfin/config/
- /home/pete/Docker/Jellyfin/cache/
- /home/pete/Docker/Jellyfin/docker-compose.yml
2. Update Your docker-compose.yml File:
Modify the volumes section in your docker-compose.yml to point to the new directories you created in your home directory.
Original:
Code: volumes:
- /var/snap/docker/common/var-lib-docker/volumes/jellyfin-config:/var/log/docker/jellyfin/config
- /var/snap/docker/common/var-lib-docker/volumes/jellyfin-cache:/var/log/docker/jellyfin/cache
Updated:
Code: volumes:
- /home/pete/Docker/Jellyfin/config:/config
- /home/pete/Docker/Jellyfin/cache:/cache
RE: unable to find user in passwd file (docker compose) - Pollo - 2024-12-19
(2024-12-18, 05:02 PM)theguymadmax Wrote: You don't have permission to access the specified locations. To resolve this, I recommend the following steps:
1. Create a Docker Folder in Your Home Directory:
Set up a dedicated directory for your Docker containers and their associated data inside your home directory. This way, you will have full control over the directories and avoid permission issues. Make sure folder are created prior to running docker compose up -d.
Directory Structure:- /home/pete/Docker/
- /home/pete/Docker/Jellyfin/
- /home/pete/Docker/Jellyfin/config/
- /home/pete/Docker/Jellyfin/cache/
- /home/pete/Docker/Jellyfin/docker-compose.yml
2. Update Your docker-compose.yml File:
Modify the volumes section in your docker-compose.yml to point to the new directories you created in your home directory.
Original:
Code: volumes:
- /var/snap/docker/common/var-lib-docker/volumes/jellyfin-config:/var/log/docker/jellyfin/config
- /var/snap/docker/common/var-lib-docker/volumes/jellyfin-cache:/var/log/docker/jellyfin/cache
Updated:
Code: volumes:
- /home/pete/Docker/Jellyfin/config:/config
- /home/pete/Docker/Jellyfin/cache:/cache
Oh ok, thank you for the explanation! I'll most likely stick to this method, but would it be better in the long term for me to use volumes instead of bind mounts?
|