NFS client mounts switch to read-only with 'stale file handle' after server cluster failover
Environment
Ubuntu 20.04 clients mounting NFSv4 exports from an HA storage cluster (two-node active/passive). Mounts configured in /etc/fstab using server virtual IP and automount via autofs on some hosts. Server cluster performed a planned failover which moved storage to the passive node.
Symptoms
Applications on the clients that write to the NFS share begin to receive I/O errors and the mount is switched to read-only by the kernel. Subsequent operations return 'Stale file handle' and processes attempting writes block or error out.
Observations
Kernel logs on clients show repeated messages like 'NFS: server 10.0.0.5 not responding, timed out' followed by 'NFS: Unexpected reply from server: Stale file handle'. showmount -e 10.0.0.5 returns export list only after remount. Remounting the NFS export (sudo mount -o remount /mnt/share) restores read/write access temporarily until the next failover. The server's exportfs configuration appears unchanged, but the underlying filesystem UUIDs on the storage may have changed during the failover.
Already attempted
Restarted nfs-common, rpcbind and autofs on clients, then remounted exports which restored access until the next failover. Checked /etc/fstab options and confirmed NFSv4 is used with default caching. On the server side, verified exports were present but noticed that the fsid values reported differ between nodes in the cluster after failover.
Question
What causes 'stale file handle' and mounts being forced read-only after an NFS server failover, and how can I make NFS client mounts resilient to server-side failover without risking data corruption? What reversible configuration/operational steps should I try next?
Verified community troubleshooting
No answers yet..
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags