docker compose error
st0nec0ld opened this issue · 7 comments
Hi,
i try your docker, testet dietpi and pi os lite, on both same error
Attaching to OwnTone
OwnTone |
OwnTone | * /proc is already mounted
OwnTone | mount: permission denied (are you root?)
OwnTone |
OwnTone | * Unable to mount tmpfs on /run.
OwnTone |
OwnTone | * Can't continue.
OwnTone | * Mounting /run ... OpenRC 0.52.1 is starting up Linux 6.1.21-v8+ (aarch64) [DOCKER]
OwnTone |
OwnTone | * Caching service dependencies ... [ ok ]
OwnTone | mkdir: can't create directory '/sys/fs/cgroup/openrc.syslog': Read-only file system
OwnTone | * Starting busybox syslog ... [ ok ]
OwnTone | mkdir: can't create directory '/sys/fs/cgroup/openrc.dbus': Read-only file system
OwnTone | * /run/dbus: creating directory
OwnTone | * /run/dbus: correcting owner
OwnTone | * Starting System Message Bus ... [ ok ]
OwnTone | mkdir: can't create directory '/sys/fs/cgroup/openrc.avahi-daemon': Read-only file system
OwnTone | * Starting avahi-daemon ... [ ok ]
OwnTone | mkdir: can't create directory '/sys/fs/cgroup/openrc.avahi-dnsconfd': Read-only file system
OwnTone | * Starting avahi-dnsconfd ... [ ok ]
OwnTone | mkdir: can't create directory '/sys/fs/cgroup/openrc.owntone': Read-only file system
OwnTone | [2024-06-29 08:54:11] [ LOG] main: OwnTone version 28.9 taking off
OwnTone | [2024-06-29 08:54:11] [ LOG] main: OwnTone version 28.9 taking off
OwnTone | [2024-06-29 08:54:11] [ LOG] main: Built with:
OwnTone | [2024-06-29 08:54:11] [ LOG] main: Built with:
OwnTone | [2024-06-29 08:54:11] [ LOG] main: - ffmpeg
OwnTone | [2024-06-29 08:54:11] [ LOG] main: - ffmpeg
OwnTone | [2024-06-29 08:54:11] [ LOG] main: - Spotify
OwnTone | [2024-06-29 08:54:11] [ LOG] main: - Spotify
OwnTone | [2024-06-29 08:54:11] [ LOG] main: - librespot-c
OwnTone | [2024-06-29 08:54:11] [ LOG] main: - librespot-c
OwnTone | [2024-06-29 08:54:11] [ LOG] main: - LastFM
OwnTone | [2024-06-29 08:54:11] [ LOG] main: - LastFM
OwnTone | [2024-06-29 08:54:11] [ LOG] main: - Chromecast
OwnTone | [2024-06-29 08:54:11] [ LOG] main: - Chromecast
OwnTone | [2024-06-29 08:54:11] [ LOG] main: - MPD
OwnTone | [2024-06-29 08:54:11] [ LOG] main: - MPD
OwnTone | [2024-06-29 08:54:11] [ LOG] main: - Websockets
OwnTone | [2024-06-29 08:54:11] [ LOG] main: - Websockets
OwnTone | [2024-06-29 08:54:11] [ LOG] main: - ALSA
OwnTone | [2024-06-29 08:54:11] [ LOG] main: - ALSA
OwnTone | [2024-06-29 08:54:11] [ LOG] main: - Webinterface
OwnTone | [2024-06-29 08:54:11] [ LOG] main: - Webinterface
OwnTone | [2024-06-29 08:54:11] [ LOG] main: - Regex
OwnTone | [2024-06-29 08:54:11] [ LOG] main: - Regex
OwnTone | [2024-06-29 08:54:11] [ LOG] main: mDNS init
OwnTone | [2024-06-29 08:54:11] [ LOG] mdns: Avahi state change: Client running
OwnTone | [2024-06-29 08:54:11] [ LOG] db: Configured to use database file '/var/cache/owntone/database.db'
OwnTone | [2024-06-29 08:54:11] [ LOG] db: Could not open '/var/cache/owntone/database.db': unable to open database file
OwnTone | [2024-06-29 08:54:11] [FATAL] db: Could not open database
OwnTone | [2024-06-29 08:54:11] [FATAL] main: Database init failed
OwnTone | [2024-06-29 08:54:11] [ LOG] main: mDNS deinit
OwnTone | [2024-06-29 08:54:11] [ LOG] main: Exiting.
OwnTone | * Starting owntone ... [ ok ]
i use docker compose
version: "3.8"
services:
owntone:
image: docker.io/owntone/owntone:latest
container_name: OwnTone
network_mode: host
environment:
- UID=1000
- GID=1000
volumes:
- /etc/owntone:/etc/owntone
- /mnt/media:/srv/media
- /var/cache/owntone:/var/cache/owntone
restart: unless-stopped
any help?
You should start the container as root.
My recommendation would be to use podman with quadlets to run your containers.
I am also running into a permissions issue using podman. I'm using the 'pods' frontend for convenience, which runs as my user. There are no errors apart from the container not being able to write the database file.
@hacketiwack would there be any way to get the right permissions without running podman as root? It would be ideal being able to run this as a normal user using the pods gui frontend.
Thanks for any advice.
* /proc is already mounted
* /run/lock: correcting mode
* /run/lock: correcting owner
* Caching service dependencies ...
[ ok ]
* Starting busybox syslog ...
[ ok ]
* /run/dbus: creating directory
* /run/dbus: correcting owner
* Starting System Message Bus ...
[ ok ]
* Starting avahi-daemon ...
[ ok ]
* Starting avahi-dnsconfd ...
[ ok ]
* Starting owntone ...
[2024-07-18 14:25:44] [ LOG] main: OwnTone version 28.9 taking off
[2024-07-18 14:25:44] [ LOG] main: OwnTone version 28.9 taking off
[2024-07-18 14:25:44] [ LOG] main: Built with:
[2024-07-18 14:25:44] [ LOG] main: Built with:
[2024-07-18 14:25:44] [ LOG] main: - ffmpeg
[2024-07-18 14:25:44] [ LOG] main: - ffmpeg
[2024-07-18 14:25:44] [ LOG] main: - Spotify
[2024-07-18 14:25:44] [ LOG] main: - Spotify
[2024-07-18 14:25:44] [ LOG] main: - librespot-c
[2024-07-18 14:25:44] [ LOG] main: - librespot-c
[2024-07-18 14:25:44] [ LOG] main: - LastFM
[2024-07-18 14:25:44] [ LOG] main: - LastFM
[2024-07-18 14:25:44] [ LOG] main: - Chromecast
[2024-07-18 14:25:44] [ LOG] main: - Chromecast
[2024-07-18 14:25:44] [ LOG] main: - MPD
[2024-07-18 14:25:44] [ LOG] main: - MPD
[2024-07-18 14:25:44] [ LOG] main: - Websockets
[2024-07-18 14:25:44] [ LOG] main: - Websockets
[2024-07-18 14:25:44] [ LOG] main: - ALSA
[2024-07-18 14:25:44] [ LOG] main: - ALSA
[2024-07-18 14:25:44] [ LOG] main: - Webinterface
[2024-07-18 14:25:44] [ LOG] main: - Webinterface
[2024-07-18 14:25:44] [ LOG] main: - Regex
[2024-07-18 14:25:44] [ LOG] main: - Regex
[2024-07-18 14:25:44] [ LOG] main: mDNS init
[2024-07-18 14:25:44] [ LOG] mdns: Avahi state change: Client registering
[2024-07-18 14:25:44] [ LOG] db: Configured to use database file '/var/cache/owntone/database.db'
[2024-07-18 14:25:44] [ LOG] db: Could not open '/var/cache/owntone/database.db': unable to open database file
[2024-07-18 14:25:44] [FATAL] db: Could not open database
[2024-07-18 14:25:44] [FATAL] main: Database init failed
[2024-07-18 14:25:44] [ LOG] main: mDNS deinit
[2024-07-18 14:25:44] [ LOG] main: Exiting.
@litemotiv and @st0nec0ld, what user did you configure in your container configuration for the parameter GID and UID?
Within the container, the owntone
process is started with the user having this group identifier (GID) and user identifier (UID).
Therefore, check what user you have configured - I would recommend to create a user for your owntone container - and give permission to that user to the directories and files under /var/cache/owntone.
As written in the documentation:
Furthermore, you must ensure that at least the cache directory is writable by the user and group identifiers provided at startup.
I hope this is now clearer.
I will review the documentation to make it clearer and simpler.
Thanks @hacketiwack that's informative.
I'm running the container without UID parameters, so it should default to 1000:1000 which is my local user id.
Would it be possible for us to give those permissions to /var/cache/owntone before running the container?
Or would it perhaps be possible to distribute the image with the /var/cache/owntone directory already existing and owned by the 'owntone' user? Similar to the /etc/owntone/owntone.conf file that is pre-existing?
/etc/owntone #
drwxr-xr-x 1 root root 24 Jul 18 17:32 .
drwxr-xr-x 1 root root 110 Jul 18 17:32 ..
-rwxr-xr-x 1 owntone owntone 18090 Jul 18 17:32 owntone.conf
@litemotiv I ran into the same problem when trying to run it with podman as rootless. Your last comment led me to the simple fix: chmod 777 the cache directory on the host. Now the process that is trying to setup the database (and is apparently not running as the owntone user) can write.
Not sure if it matters, but I also did the same for the mapped etc directory.
This is a standard problem with a lot of containers, not only owntone.
Always either create all the needed directories yourself with the appropriate permissions or adjust the permissions and then restart the container.
I prefer to change the root owner/group permission to my own user/group (chown), but sometimes only chmod 777 is a quick fix.
It seems this problem has been solved.