duplicati / duplicati

Store securely encrypted backups in the cloud!
Other
10.87k stars 893 forks source link

IOException: Stale file handle #5268

Open mfide opened 1 month ago

mfide commented 1 month ago

Hello,

Thank you for this great tool.

I started using duplicati almost a month ago to automate the backup requirements of my dedicated server in US . The server runs Ubuntu 22.04 and Docker version 26.1.4 and below yml file represents my duplicati docker container usage. Currently it has Duplicati v2.0.8.1_beta_2024-05-07.

services:
  duplicati:
    image: lscr.io/linuxserver/duplicati:latest
    container_name: duplicati
    environment:
      - PUID=0 #uid of root user
      - PGID=0 #gid of the root group
      - TZ=Europe/Zurich
      - CLI_ARGS=
    volumes:
      - ./appdata/config:/config
      - /media/nas/Backups/Duplicati:/backups
      - /:/source
#    ports:
#      - 8200:8200
    restart: unless-stopped

In the host linux in US, I have an NFSv4 mount to /media/nas/, physically it is a 4TB SSD disk in my home (Switzerland) where I keep my backups.

My weekly backup tasks were working fine but I saw this morning that all tasks have been failed due to an error called "IOException: Stale file handle". I thought that somehow I lost the NFS connection between my dedicated server in US and home NAS but I verified it from the linux machine in US, the NFS mount was still active and working. (I can access to all files) So this was not the problem. At this point, I reran some backup tasks manually and ended up with same error and failure message.

See below screenshot for the issue: duplicati_problem

Later I decided to down the container of duplicati and up again and then manually triggered the backup tasks and they all worked correctly.

Do you have any idea what can cause the "IOException: Stale file handle" error and later it disappears once I restart the duplicati?

Thank you.

duplicatibot commented 1 month ago

This issue has been mentioned on Duplicati. There might be relevant details there:

https://forum.duplicati.com/t/stale-file-handle-backing-nfs-mount/2192/4

kenkendk commented 1 month ago

Hi @mfide , I think this happens because the Docker container is mounting the remote folder. If the connection is lost, Docker will keep the handle and this gives the "stale file handle" error. Stopping the container will close the handle and starting it will create a new (working) handle.

mfide commented 1 month ago

Hi @kenkendk, Thank you for the suggestion. You are right this could be the one of the possibilities. I will try to mount nfs volume directly in docker compose instead of mounting it in the host Linux and binding the mounted folder statically in the docker. And lets see if docker manages nfs mounts better :)

One suggestion about how to do that is available here: https://www.reddit.com/r/selfhosted/comments/lkti7c/how_do_you_properly_attach_nfs_shares_to_docker/