Page 1 of 1

Saving files failing with Stale File Handle: OSError: [Errno 116] Stale file handle:

Posted: October 15th, 2022, 3:28 pm
by Linphi
Here's a pastebin log: https://pastebin.com/n5mSXm6E

Since recently Sabnzbd is failing to save files with "Stale File Handle" errors. However I tried to write files on the OS level with the sabnzbd user and it all works fine, no other process on this machine seems to have an issue with the file system (smb export from Truenas).
Any ideas what the issue is here and why it is just Sabnzbd somehow being unable to write files?

Re: Saving files failing with Stale File Handle: OSError: [Errno 116] Stale file handle:

Posted: October 15th, 2022, 8:23 pm
by sander
Interesting read on https://stackoverflow.com/questions/201 ... linux-mean

TLDR: directory was deleted, and then recreated. And if you point to the old inode, you get that error.

Re: Saving files failing with Stale File Handle: OSError: [Errno 116] Stale file handle:

Posted: October 16th, 2022, 12:29 am
by Linphi
I tried to mount the directory though NFS instead to rule out samba - same issue, though slightly different error message.
Sabnzbd is actually able to create files and directories but most of them end up with 0 bytes for some reason. So it can’t be any permission issue.
If I try to modify those files from the terminal I don’t have any issues there… somehow something to do with how it handles files?
Clueless right now why it doesn’t work. Everything looks normal, can mount the same filesystem on my MacBook and create/copy files just fine over the network.
Plex accesses the same filesystem over the same mount and also has no issues there.

Re: Saving files failing with Stale File Handle: OSError: [Errno 116] Stale file handle:

Posted: October 16th, 2022, 12:56 am
by sander
/mnt/media/downloads/incomplete/ ... can't you put Incomplete on a local disk (and keep Complete on the TrueNAS)?

Re: Saving files failing with Stale File Handle: OSError: [Errno 116] Stale file handle:

Posted: October 16th, 2022, 1:40 am
by Linphi
Yes, I've done that now and that seems to work fine... it worked flawlessly over the network for years, so not sure what the current issue is with it. But should be no issue to keep it this way now.

Re: Saving files failing with Stale File Handle: OSError: [Errno 116] Stale file handle:

Posted: October 16th, 2022, 4:10 am
by sander
Great it works.

Having Incomplete aka Temporary Download Folder on a non-local disk can give problems: SAB does a lot of writing and reading to that directory: all separate articles (typically 1500 articles per 1GB), combining them, unrar, and par2-repair if needed. A perfect remote disk can handle that, but in practice things happen.

So safer to have Incomple on a locak disk.