← Back to issue list

Formatting virtual partition devices fails with I/O error on Ubuntu 26.04 (fusefile 2.0)

View original Github issue

Metadata

Project
imagecraft
Number
#460
Type
issue
State
open
Author
lengau
Labels
—
Created
Updated
Closed
—

Current evaluation

imagecraft pack fails on Ubuntu 26.04: fusefile 2.0/libfuse3 enables splice reads and returns -EIO on FUSE_BUF_IS_FD writes, breaking mkfs.vfat/mke2fs on virtual partition devices. Root cause and repro provided; maintainer marked low priority, no fix yet.

Suggested action: keep open

Reason: Maintainer-filed bug with a precise root-cause analysis (fusefile 2.0's .write_buf enabling splice and fusefile.c returning -EIO on FUSE_BUF_IS_FD) and two reproducers, and the maintainer's comment triages it as low priority rather than closing it. It affects only destructive mode or the multipass backend, so it is a valid but narrow-impact bug that should remain open.

Evaluated by: mr-cal-bot

Impact: 40 Quick Win: 10 Complexity: 65 Confidence: 75 Actionability: 75

Issue body

On Ubuntu 26.04 (Resolute) hosts and GitHub Actions VM runners, `imagecraft pack` fails when formatting partitions: ```text mkfs.vfat: failed whilst writing root directory CalledProcessError: Command '['mkfs.vfat', '-n', 'system-boot', '.../.devices/pc_efi.img']' returned non-zero exit status 1. ``` This causes `tests/integration/test_application.py::test_imagecraft_pack` to fail when run with root privileges. ### Root Cause - Ubuntu 26.04 upgraded `fusefile` from 1.2 (`libfuse2`) to 2.0 (`libfuse3`). - `fusefile 2.0` defines `.write_buf = fusefile_write_buf`, causing `libfuse3` to enable splice reads from `/dev/fuse`. - Writes ≥ 4096 bytes (e.g. `mkfs.vfat` root directory, `mke2fs` journals) arrive with `FUSE_BUF_IS_FD` set. - `fusefile.c:816` explicitly returns `-EIO` when `FUSE_BUF_IS_FD` is present instead of reading from the file descriptor. - Unprivileged LXD containers mask the bug because user namespaces block `splice(2)`, forcing `libfuse3` to fall back to in-memory buffers. ### Reproduction On an Ubuntu 26.04 host/VM: 1. Running the integration test: ```bash sudo env "PATH=$PATH" uv run pytest tests/integration/test_application.py::test_imagecraft_pack -vv -s ``` 2. Minimal `fusefile` CLI reproducer: ```bash truncate -s 100M /tmp/disk.img touch /tmp/part.img fusefile /tmp/part.img /tmp/disk.img/1048576+67108864 mkfs.vfat -n system-boot /tmp/part.img # Fails: mkfs.vfat: failed whilst writing root directory ``` ### Proposed Workarounds / Fixes - Work around the `fusefile 2.0` splice issue in Imagecraft (e.g., wrapper, preload shim, or alternative virtual device approach). - Or run root integration tests in an unprivileged LXD container where FUSE splice is disallowed. --- *Note: This issue was written by a toaster (`gemini-3.8-flash` via `opencode` harness).*

Evaluation history

Date Model Scores Action Summary
~deepseek/deepseek-pro-latest
Impact: 40
Quick Win: 10
Complexity: 65
Confidence: 75
Actionability: 75
keep open imagecraft pack fails on Ubuntu 26.04: fusefile 2.0/libfuse3 enables splice reads and returns -EIO on FUSE_BUF_IS_FD writes, breaking mkfs.vfat/mke2fs on virtual partition devices. Root cause and repro provided; maintainer marked low priority, no fix yet.
stealth/space-bunny-alpha
Impact: 65
Quick Win: 21
Complexity: 60
Confidence: 78
Actionability: 80
needs triage imagecraft pack fails on Ubuntu 26.04: fusefile 2.0/libfuse3 enables splice reads, and fusefile returns -EIO on FUSE_BUF_IS_FD writes, breaking mkfs.vfat/mke2fs on virtual partition devices. Maintainer-filed with root cause and repro; no fix yet.
qwen/qwen3.8-27b
Impact: 65
Quick Win: 19
Complexity: 60
Confidence: 80
Actionability: 72
keep open imagecraft pack fails on Ubuntu 26.04: fusefile 2.0 (libfuse3) enables splice reads and fusefile returns -EIO on FUSE_BUF_IS_FD writes, breaking mkfs.vfat/mke2fs on virtual partition devices. New maintainer-filed issue with root cause and reproducer; no fix in codebase yet.

Update history

Date Change
updated
created

Related work

  • Caused By: canonical/imagecraft#458 (confidence 85%)

    PR #458 introduced fusefile-based VirtualOffsetDevice, replacing loop devices; the fusefile 2.0 splice regression now breaks that path.

Related issues

No related issues found above the similarity threshold.