BUG: Docker dropping NFS mounted folders, recovers upon restart #94

Closed
opened 2026-04-24 22:58:18 +02:00 by adam · 4 comments
Owner

Originally created by @Allastratou on GitHub (Nov 17, 2021).

Server is running Ubuntu Bullseye, with latest docker image.

Have an NFS share " /share/media/audiobooks " mapped on ubuntu to " /mnt/media/audiobooks ". Within container, host folder " /mnt/media/audiobooks " is mounted to " /audiobooks "

After a few hours (unsure the exact amount of time, but definitely less than a day) all covers show as "invalid file type", non-cached books will not play, and when I connect to the container's console, running " ls /audiobooks " returns "stale file handle". Upon restarting the container, access is restored and everything functions as expected.

I've confirmed other containers that access this NFS share do not have this issue, and the parent OS does still have the NFS folder mounted and accessible. Running " ls /mnt/media/audiobooks " works as expected.

Originally created by @Allastratou on GitHub (Nov 17, 2021). Server is running Ubuntu Bullseye, with latest docker image. Have an NFS share " /share/media/audiobooks " mapped on ubuntu to " /mnt/media/audiobooks ". Within container, host folder " /mnt/media/audiobooks " is mounted to " /audiobooks " After a few hours (unsure the exact amount of time, but definitely less than a day) all covers show as "invalid file type", non-cached books will not play, and when I connect to the container's console, running " ls /audiobooks " returns "stale file handle". Upon restarting the container, access is restored and everything functions as expected. I've confirmed other containers that access this NFS share do not have this issue, and the parent OS does still have the NFS folder mounted and accessible. Running " ls /mnt/media/audiobooks " works as expected.
adam closed this issue 2026-04-24 22:58:19 +02:00
Author
Owner

@advplyr commented on GitHub (Nov 17, 2021):

Have you tried setting up a docker volume for the NFS instead of mounting it in ubuntu?
https://docs.docker.com/storage/volumes/

Audiobookshelf doesn't do anything differently then other docker images, so I'm not sure why it would be different.

@advplyr commented on GitHub (Nov 17, 2021): Have you tried setting up a docker volume for the NFS instead of mounting it in ubuntu? https://docs.docker.com/storage/volumes/ Audiobookshelf doesn't do anything differently then other docker images, so I'm not sure why it would be different.
Author
Owner

@zombiehoffa commented on GitHub (Nov 17, 2021):

This seems like a pretty common problem using nfs in docker and also kubernetes: https://duckduckgo.com/?q=stale+file+handle+nfs+docker

Here's one possible solution if you absolutely must use nfs: https://engineerworkshop.com/blog/automatically-resolve-nfs-stale-file-handle-errors-in-ubuntu-linux/

@zombiehoffa commented on GitHub (Nov 17, 2021): This seems like a pretty common problem using nfs in docker and also kubernetes: https://duckduckgo.com/?q=stale+file+handle+nfs+docker Here's one possible solution if you absolutely must use nfs: https://engineerworkshop.com/blog/automatically-resolve-nfs-stale-file-handle-errors-in-ubuntu-linux/
Author
Owner

@Allastratou commented on GitHub (Nov 17, 2021):

Thanks for the responses! I just thought it was odd that this was the only container with this behavior, even though I have two more containers with the exact same setup. I went ahead and created a CIFS docker volume instead, I'll let ya know how it goes.

@Allastratou commented on GitHub (Nov 17, 2021): Thanks for the responses! I just thought it was odd that this was the only container with this behavior, even though I have two more containers with the exact same setup. I went ahead and created a CIFS docker volume instead, I'll let ya know how it goes.
Author
Owner

@Allastratou commented on GitHub (Nov 22, 2021):

Have you tried setting up a docker volume for the NFS instead of mounting it in ubuntu? https://docs.docker.com/storage/volumes/

Yup! Works perfectly so far. Thanks again people!

@Allastratou commented on GitHub (Nov 22, 2021): > Have you tried setting up a docker volume for the NFS instead of mounting it in ubuntu? https://docs.docker.com/storage/volumes/ Yup! Works perfectly so far. Thanks again people!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#94