2023-11-11, 10:50 AM
I think I got this working now although I'm not quite sure on the root cause as this same setup worked perfectly on Ubuntu 22.04 LTS for years. I realised now that the issue always coincided with when the 'Scan Media Library' scheduled task ran which was set to run every 12 hours, for me this was always approximately 11am and 11pm. I found that the docker container kept losing the connection to the NFS mount point on the host so if the drop happened around 4pm for example then the next scheduled scan at 11pm would then remove all metadata, I wouldn't notice anything had gone wrong until 11pm or if I was to watch anything on my server.
To fix this, I ended up removing the mount from /etc/fstab and rebooting to remove the mount. I then mounted the NFS share manually as root user before adding the mount command back into /etc/fstab so it would remain after reboot. I also realised that the requirement I had set on the Docker services to not start until the NFS shares were ready wasn't working reliably as it seemed 50/50 on whether it would just work or whether Docker would just go ahead and start before the NFS shares were mounted.
I edited the override on the Docker services and changed it from this:
Before
To this:
After
I got the NFS unit names created by /etc/fstab by running:
For the past few days now I've been connecting into the Docker container to ensure the NFS mounts and media are visible at start-up and at random points during the day and so far no drops so all good .
To fix this, I ended up removing the mount from /etc/fstab and rebooting to remove the mount. I then mounted the NFS share manually as root user before adding the mount command back into /etc/fstab so it would remain after reboot. I also realised that the requirement I had set on the Docker services to not start until the NFS shares were ready wasn't working reliably as it seemed 50/50 on whether it would just work or whether Docker would just go ahead and start before the NFS shares were mounted.
I edited the override on the Docker services and changed it from this:
Before
Code:
[Service]
RequiresMountsFor=/mnt/media
To this:
After
Code:
[Unit]
Requires=mnt-media.mount
After=mnt-media.mount
I got the NFS unit names created by /etc/fstab by running:
Code:
systemctl list-units -t mount
For the past few days now I've been connecting into the Docker container to ensure the NFS mounts and media are visible at start-up and at random points during the day and so far no drops so all good .