← Back to issue list

sshfs breaks with serving user files to root in LXD

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1741082
Type
issue
State
closed
Author
~kalikiana
Labels
container sshfs
Created
Updated
Closed

Current evaluation

Fixed by merged PR canonical/snapcraft#1847 (commit e7d73a365), creating a matching user for remote LXD sshfs builds so project files are not left root-owned.

Resolution: closed resolved

Reason: The issue was fixed by canonical/snapcraft#1847, merged as commit e7d73a365. It creates the invoking user in the LXD container for remote sshfs builds, preventing root ownership and the resulting tar errors.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Mounting the local filesystem owned by the user via sshfs into a container running as root causes discrepancy with tools, such as tar, which try to change permissions to the effective user. Test case: $ git clone https://github.com/kalikiana/oman.git $ cd oman $ export SNAPCRAFT_CONTAINER_BUILDS=myremote $ snapcraft Get:1 gcc-6-base_6.0.1-0ubuntu1_amd64.deb [14.3 kB] Fetched 14.3 kB in 0s (0 B/s) tar: ./usr/lib/gcc/x86_64-linux-gnu/6: Cannot change ownership to uid 0, gid 0: Permission denied tar: ./usr/lib/gcc/x86_64-linux-gnu: Cannot change ownership to uid 0, gid 0: Permission denied tar: ./usr/lib/gcc: Cannot change ownership to uid 0, gid 0: Permission denied tar: ./usr/lib: Cannot change ownership to uid 0, gid 0: Permission denied tar: ./usr/share/doc/gcc-6-base/copyright: Cannot change ownership to uid 0, gid 0: Permission denied tar: ./usr/share/doc/gcc-6-base/README.Debian.amd64.gz: Cannot change ownership to uid 0, gid 0: Permission denied tar: ./usr/share/doc/gcc-6-base/changelog.Debian.gz: Cannot change ownership to uid 0, gid 0: Permission denied tar: ./usr/share/doc/gcc-6-base/TODO.Debian: Cannot change ownership to uid 0, gid 0: Permission denied tar: ./usr/share/doc/gcc-6-base: Cannot change ownership to uid 0, gid 0: Permission denied tar: ./usr/share/doc: Cannot change ownership to uid 0, gid 0: Permission denied tar: ./usr/share: Cannot change ownership to uid 0, gid 0: Permission denied tar: ./usr/lib/gcc/x86_64-linux-gnu/6.0.0: Cannot change ownership to uid 0, gid 0: Permission denied tar: ./usr: Cannot change ownership to uid 0, gid 0: Permission denied tar: .: Cannot change ownership to uid 0, gid 0: Permission denied tar: Exiting with failure status due to previous errors dpkg-deb: error: subprocess tar returned error exit status 2 Error while provisioning '/root/build_oman/parts/tools/ubuntu/download/gcc-6-base_6.0.1-0ubuntu1_amd64.deb'

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed by merged PR canonical/snapcraft#1847 (commit e7d73a365), creating a matching user for remote LXD sshfs builds so project files are not left root-owned.
stealth/space-bunny-alpha — closed resolved Fixed in canonical/snapcraft#1847 (commit e7d73a365): remote LXD sshfs builds now use the invoking container user, preventing root ownership and tar permission errors.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR #1847 (e7d73a365): remote LXD builds now run sshfs-mounted projects as the invoking user, avoiding root ownership errors.
qwen/qwen3.6-35b-a3b — — Closed without resolution due to inactivity. The report describes sshfs permission errors when mounting user-owned filesystems into root LXD containers, causing tar failures during snapcraft builds. No fix was applied.
qwen/qwen3.6-35b-a3b — — Closed without resolution. Mounting user-owned filesystems via sshfs into root LXD containers caused tar permission errors during snapcraft builds. The issue appears abandoned.

Update history

Date Change
created

Related work

Related issues

Issue Project State Summary Similarity
#1847 lxd: Use user in container when mounting remote via sshfs snapcraft merged Merged as commit e7d73a365: snapcraft now creates a user in the LXD container for remote sshfs builds so project files aren't left root-owned, fixing LP bug #1741082.
78%
#1780997 Persistent container builds are broken snapcraft (launchpad) closed Persistent LXD builds were fixed by canonical/snapcraft#1847 (commit e7d73a365), correcting user handling for remote SSHFS-mounted containers.
73%
#1741753 Snapcraft clean fails on root-owned files snapcraft (launchpad) closed Root-owned LXD build files broke snapcraft clean; fixed by merged PR snapcore/snapcraft#1904 (commit 6bd4c9e59), correcting raw.idmap ownership handling.
71%