owntone / owntone-server

Linux/FreeBSD DAAP (iTunes) and MPD audio server with support for AirPlay 1 and 2 speakers (multiroom), Apple Remote (and compatibles), Chromecast, Spotify and internet radio.
https://owntone.github.io/owntone-server
GNU General Public License v2.0
2.09k stars 237 forks source link

Owntone crashing USB drive without music library is unmounted #1812

Closed cdlenfert closed 1 month ago

cdlenfert commented 1 month ago

I'm running Owntone on a RockPi 4b SBC running DietPi on Debian 12 (bookwork) from the built in 32GB EMMC chip. Recently I've been plugging in flash drives to this system. I mount the drives to /mnt/drivename using the dietpi-drive_manager and when I'm done I use the same tool to unmount the drives. Every time I unmount a drive, Owntown shuts down. All I see in the log is the following (but I don't have it set to debug yet).

root@rockpi:~# tail -500 /var/log/owntone.log 
[2024-09-18 19:04:07] [  LOG]     main: Got SIGTERM or SIGINT
[2024-09-18 19:04:07] [  LOG]     main: Stopping gracefully
[2024-09-18 19:04:07] [  LOG]     main: mDNS deinit
[2024-09-18 19:04:07] [  LOG]     main: Remote pairing deinit
[2024-09-18 19:04:07] [  LOG]     main: MPD deinit
[2024-09-18 19:04:07] [  LOG]     main: HTTPd deinit
[2024-09-18 19:04:07] [  LOG]     main: Player deinit
[2024-09-18 19:04:07] [  LOG]     main: Library scanner deinit
[2024-09-18 19:04:08] [  LOG]     main: Cache deinit
[2024-09-18 19:04:08] [  LOG]     main: Worker deinit
[2024-09-18 19:04:08] [  LOG]     main: Database deinit
[2024-09-18 19:04:08] [  LOG]     main: Exiting.

This has happened for every extra drive I've unmounted. I realise this could most likely be an issue with how the dietpi-drive_manager handles unmounting, but I thought I'd check here first since owntone seems to be the only affected service.

hacketiwack commented 1 month ago

@cdlenfert, I cannot reproduce your error because my setup is quite different. However, did you try other ways to mount/unmount drives, for example systemd automount? (configration example here)

ejurgensen commented 1 month ago

"Got SIGTERM or SIGINT" means something else told OwnTone to stop. It's hard to say what or why. OwnTone's debug logging won't reveal it, but maybe you can find some other logging that does. I also think @hacketiwack's suggestion to try another way is good.

cdlenfert commented 1 month ago

Sounds good. Greatly appreciate the input. I'll post back to this thread if I find out more info or come up with a better system for mounting and unmounting drives that doesn't impact OwnTone.