Repository navigation
feat(storage): GET /v1/disks/unreadable lists the mounts df cannot read - #31
Merged
Merged
Conversation
A dead NFS share ("Stale file handle") or a FUSE mount whose program
died was said nowhere: the storage list left it out. The new route runs
df -P in English and returns each mount it complains about, with the
complaint. Root being refused another user's FUSE mount (a desktop's
/run/user/1000/doc) is not a dead mount and is left out; a df that does
not answer within 15 s, as on a hard NFS mount whose server is gone, is
one entry with no mount point. For "Needs attention" on the dashboard.
Asked in ReCasaOS/CasaOS#67.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up of #30, from ReCasaOS/CasaOS#67: the reporter's storage list died on a dead NFS mount in
/etc/fstab(df: /media/ser/fotos: Stale file handle). Since #30 the service survives it, but nothing tells the person the mount is dead. The reporter suggested pointing people at it.Change.
GET /v1/disks/unreadableanswers[{mount_point, error}]:df -PwithLC_ALL=Cand reads only its complaints on stderr (df: <path>: <complaint>, path unquoted when df quoted it);/run/user/1000/doc), not a dead mount;dfthat does not answer within 15 s (a hard NFS mount whose server is gone) is one entry with an emptymount_point;/v1/disks, so the gateway already routes it.The dashboard part is in CasaOS-UI (a row in "Needs attention" per entry).
Proof. Tests on the parsing (a stale handle, a quoted path with a space, one with a quote, the two refusals left out, a line that is not df's) and on the timeout. Run on Linux (WSL); the rest of the package passed there except the two helper-script tests, which fail in that copy on CRLF line endings only. Not looked at: a real dead NFS or FUSE mount, and a real hung
df.