Skip to content

mount: tell why FUSE support is unavailable - #10159

Merged
ThomasWaldmann merged 1 commit into
borgbackup:masterfrom
ThomasWaldmann:mount-fuse-errors-8657
Aug 21, 2026
Merged

mount: tell why FUSE support is unavailable#10159
ThomasWaldmann merged 1 commit into
borgbackup:masterfrom
ThomasWaldmann:mount-fuse-errors-8657

Conversation

@ThomasWaldmann

Copy link
Copy Markdown
Member

Fixes the actionable part of #8657 (see also #8388): borg mount only said no FUSE support without any hint at the cause, so users could not tell "not installed" from "installed, but broken" (e.g. a pyfuse3 wheel linked against a libfuse soname that no longer exists).

  • fuse_impl: record the import error of each FUSE implementation that failed to load in a new fuse_import_errors dict. Also catch non-ImportError failures: mfusepy raises OSError at module import time if libfuse is missing (and AttributeError/NotImplementedError in other cases). Since mfusepy is the first default implementation, that previously crashed borg mount — and sysinfo() in exception handlers — with a raw traceback on any host without libfuse.

  • borg mount: show the recorded errors:

    Runtime error: borg mount not available: no FUSE support, BORG_FUSE_IMPL=mfusepy,pyfuse3,llfuse.
    import of mfusepy failed: Unable to find libfuse
    import of pyfuse3 failed: libfuse3.so.3: cannot open shared object file: No such file or directory
    import of llfuse failed: No module named 'llfuse'
    
  • sysinfo: it reported fuse: None when mfusepy was the active implementation (it only looked at llfuse). Now it reports the active module (mfusepy has no __version__, so the version is best-effort) and includes the recorded import errors when no implementation loaded — so the debug output users paste into issue reports shows the cause directly.

  • tests: new test_fuse_import_errors_recorded covering the OSError case and the error recording.

  • docs: note in the Standalone Binary section that third-party binaries might lack FUSE support and that OS-level FUSE is needed.

A 1.4-maint backport of the diagnostic part would be easy if wanted (1.4 only has pyfuse3/llfuse, so the OSError hazard does not exist there).

🤖 Generated with Claude Code

@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.00%. Comparing base (7babd39) to head (2927349).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/borg/archiver/mount_cmds.py 25.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10159      +/-   ##
==========================================
- Coverage   87.00%   87.00%   -0.01%     
==========================================
  Files         101      101              
  Lines       17996    18002       +6     
  Branches     2738     2738              
==========================================
+ Hits        15657    15662       +5     
- Misses       1635     1637       +2     
+ Partials      704      703       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

- fuse_impl: record the import error of each FUSE implementation that
  failed to load. also catch non-ImportError failures: mfusepy raises
  OSError at import time if libfuse is missing (and AttributeError /
  NotImplementedError in other cases), which previously crashed borg
  with a traceback instead of a clean error.
- borg mount: show the recorded errors, so users see the actual cause
  (e.g. a missing shared library) instead of just "no FUSE support".
- sysinfo: report mfusepy as the active FUSE implementation (it showed
  "fuse: None" although mounting worked) and include the recorded
  import errors if no implementation loaded, so debug output pasted
  into issues shows why.
- docs: note that third-party binaries might lack FUSE support.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ThomasWaldmann
ThomasWaldmann force-pushed the mount-fuse-errors-8657 branch from 8e37306 to 2927349 Compare August 21, 2026 10:41
@ThomasWaldmann
ThomasWaldmann merged commit 7a0a8d0 into borgbackup:master Aug 21, 2026
21 of 23 checks passed
@ThomasWaldmann
ThomasWaldmann deleted the mount-fuse-errors-8657 branch August 21, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant