← Back to issue list

lxc - Missing source path "/root/snap/charmcraft/common/cache/charmcraft/charmcraft-buildd-base-v7/BuilddBaseAlias.JAMMY/pip"

View original Github issue

Metadata

Project
charmcraft
Number
#2107
Type
issue
State
open
Author
mcfly722
Labels
Created
Updated
Closed

Current evaluation

Charmcraft pack fails on LXD cluster when container lands on a node lacking the shared cache pip dir; maintainer offered workaround (CRAFT_SHARED_CACHE) and asked if a patch release accepting a flag would help; no reporter reply since Jan 2025.

Suggested action: keep open

Reason: Maintainer lengau triaged this (2025-01-24), acknowledged it as 'a fairly unexpected breakage' in an unsupported LXD cluster setup, provided a CRAFT_SHARED_CACHE workaround, and ended with an open question to the reporter ('Would it work for you if an upcoming patch release of Charmcraft would acce[pt]...') that was never answered. The issue is triaged and awaiting reporter input, so it should stay open rather than be closed as stale; closing would discard an acknowledged bug in craft-providers' shared-cache mount path.

Impact: 40 Quick Win: 18.0 Staleness: 70 Complexity: 55 Confidence: 60 Support Request: 30

Issue body

### Bug Description Hello, we are using lxd cluster and trying to pack a new created empty charm from scratch, but it fails with error: ``` 'lxc --project charmcraft config device add local:charmcraft-test-on-amd64-for-amd64-2359335 disk-/root/.cache/pip disk source=/root/snap/charmcraft/common/cache/charmcraft/charmcraft-buildd-base-v7/BuilddBaseAlias.JAMMY/pip path=/root/.cache/pip' 2025-01-23 16:37:27.353 * Command exit code: 1 2025-01-23 16:37:27.353 * Command standard error output: b'Error: Failed add validation for device "disk-/root/.cache/pip": Missing source path "/root/snap/charmcraft/common/cache/charmcraft/charmcraft-buildd-base-v7/BuilddBaseAlias.JAMMY/pip" for disk "disk-/root/.cache/pip"\n' ``` pip installed folder **/root/snap/charmcraft/common/cache/charmcraft/charmcraft-buildd-base-v7/BuilddBaseAlias.JAMMY/pip** exist. ### To Reproduce ``` sudo apt install pip sudo snap install charmcraft --classic mkdir test cd test charmcraft init charmcraft pack ``` ### Environment ``` sudo snap list Name Version Rev Tracking Publisher Notes bare 1.0 5 latest/stable canonical✓ base charmcraft 3.2.2 5303 latest/stable canonical✓ classic core20 20240911 2434 latest/stable canonical✓ base core22 20241119 1722 latest/stable canonical✓ base core24 20241119 716 latest/stable canonical✓ base gnome-42-2204 0+git.38ea591 202 latest/stable canonical✓ - gtk-common-themes 0.1-81-g442e511 1535 latest/stable canonical✓ - juju 3.4.6 28491 3.4/stable canonical✓ - lxd 5.0.4-497fe1e 31333 5.0/stable/… canonical✓ - snapd 2.67 23545 latest/stable canonical✓ snapd ``` ``` lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.5 LTS Release: 22.04 Codename: jammy ``` ``` pip --version pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10) ``` ``` lxc --project charmcraft list +---------------------------------------------------------------+---------+---------------------+------+-----------+-----------+--------------+ | NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | LOCATION | +---------------------------------------------------------------+---------+---------------------+------+-----------+-----------+--------------+ | base-instance-charmcraft-buildd-base-v7--910533fdd664bd2cdbe9 | STOPPED | | | CONTAINER | 0 | mkhn-jj-tst1 | +---------------------------------------------------------------+---------+---------------------+------+-----------+-----------+--------------+ | charmcraft-test-on-amd64-for-amd64-2359335 | RUNNING | 10.68.84.107 (eth0) | | CONTAINER | 0 | mkhn-jj-tst2 | +---------------------------------------------------------------+---------+---------------------+------+-----------+-----------+--------------+ ``` ``` lxc --project charmcraft profile show default config: {} description: "" devices: eth0: name: eth0 nictype: bridged parent: br0 type: nic root: path: / pool: local type: disk name: default used_by: - /1.0/instances/base-instance-charmcraft-buildd-base-v7--910533fdd664bd2cdbe9?project=charmcraft - /1.0/instances/charmcraft-test-on-amd64-for-amd64-2359335?project=charmcraft ``` ### charmcraft.yaml ```yaml default, no any changes after charmcraft init ``` ### Relevant log output ```shell 2025-01-23 16:37:27.352 Traceback (most recent call last): 2025-01-23 16:37:27.353 File "/snap/charmcraft/5303/lib/python3.10/site-packages/craft_providers/lxd/lxc.py", line 139, in config_device_add_disk 2025-01-23 16:37:27.353 self._run_lxc(command, capture_output=True, project=project) 2025-01-23 16:37:27.353 File "/snap/charmcraft/5303/lib/python3.10/site-packages/craft_providers/lxd/lxc.py", line 104, in _run_lxc 2025-01-23 16:37:27.353 return subprocess.run(lxc_cmd, check=check, stdin=stdin.value, **kwargs) 2025-01-23 16:37:27.353 File "/snap/charmcraft/5303/usr/lib/python3.10/subprocess.py", line 526, in run 2025-01-23 16:37:27.353 raise CalledProcessError(retcode, process.args, 2025-01-23 16:37:27.353 subprocess.CalledProcessError: Command '['lxc', '--project', 'charmcraft', 'config', 'device', 'add', 'local:charmcraft-test-on-amd64-for-amd64-2359335', 'disk-/root/.cache/pip', 'disk', 'source=/root/snap/charmcraft/common/cache/charmcraft/charmcraft-buildd-base-v7/BuilddBaseAlias.JAMMY/pip', 'path=/root/.cache/pip']' returned non-zero exit status 1. 2025-01-23 16:37:27.353 2025-01-23 16:37:27.353 The above exception was the direct cause of the following exception: 2025-01-23 16:37:27.353 Traceback (most recent call last): 2025-01-23 16:37:27.353 File "/snap/charmcraft/5303/lib/python3.10/site-packages/craft_application/application.py", line 543, in run 2025-01-23 16:37:27.353 self.run_managed(platform, build_for) 2025-01-23 16:37:27.353 File "/snap/charmcraft/5303/lib/python3.10/site-packages/charmcraft/application/main.py", line 154, in run_managed 2025-01-23 16:37:27.353 super().run_managed(platform, build_for) 2025-01-23 16:37:27.353 File "/snap/charmcraft/5303/lib/python3.10/site-packages/craft_application/application.py", line 368, in run_managed 2025-01-23 16:37:27.353 with self.services.provider.instance( 2025-01-23 16:37:27.353 File "/snap/charmcraft/5303/usr/lib/python3.10/contextlib.py", line 135, in __enter__ 2025-01-23 16:37:27.353 return next(self.gen) 2025-01-23 16:37:27.353 File "/snap/charmcraft/5303/lib/python3.10/site-packages/charmcraft/services/provider.py", line 119, in instance 2025-01-23 16:37:27.353 with super().instance( 2025-01-23 16:37:27.353 File "/snap/charmcraft/5303/usr/lib/python3.10/contextlib.py", line 135, in __enter__ 2025-01-23 16:37:27.353 return next(self.gen) 2025-01-23 16:37:27.353 File "/snap/charmcraft/5303/lib/python3.10/site-packages/craft_application/services/provider.py", line 129, in instance 2025-01-23 16:37:27.353 with provider.launched_environment( 2025-01-23 16:37:27.353 File "/snap/charmcraft/5303/usr/lib/python3.10/contextlib.py", line 135, in __enter__ 2025-01-23 16:37:27.353 return next(self.gen) 2025-01-23 16:37:27.353 File "/snap/charmcraft/5303/lib/python3.10/site-packages/craft_providers/lxd/lxd_provider.py", line 143, in launched_environment 2025-01-23 16:37:27.353 instance = launch( 2025-01-23 16:37:27.353 File "/snap/charmcraft/5303/lib/python3.10/site-packages/craft_providers/lxd/launcher.py", line 783, in launch 2025-01-23 16:37:27.353 _create_instance( 2025-01-23 16:37:27.353 File "/snap/charmcraft/5303/lib/python3.10/site-packages/craft_providers/lxd/launcher.py", line 229, in _create_instance 2025-01-23 16:37:27.353 base_configuration.warmup(executor=instance) 2025-01-23 16:37:27.353 File "/snap/charmcraft/5303/lib/python3.10/site-packages/craft_providers/base.py", line 1088, in warmup 2025-01-23 16:37:27.353 self._mount_shared_cache_dirs(executor=executor) 2025-01-23 16:37:27.353 File "/snap/charmcraft/5303/lib/python3.10/site-packages/craft_providers/base.py", line 838, in _mount_shared_cache_dirs 2025-01-23 16:37:27.353 executor.mount(host_source=host_pip_cache_path, target=guest_pip_cache_path) 2025-01-23 16:37:27.353 File "/snap/charmcraft/5303/lib/python3.10/site-packages/craft_providers/lxd/lxd_instance.py", line 437, in mount 2025-01-23 16:37:27.353 self.lxc.config_device_add_disk( 2025-01-23 16:37:27.353 File "/snap/charmcraft/5303/lib/python3.10/site-packages/craft_providers/lxd/lxc.py", line 141, in config_device_add_disk 2025-01-23 16:37:27.353 raise LXDError( 2025-01-23 16:37:27.353 craft_providers.lxd.errors.LXDError: Failed to add disk to instance 'charmcraft-test-on-amd64-for-amd64-2359335'. 2025-01-23 16:37:27.353 * Command that failed: 'lxc --project charmcraft config device add local:charmcraft-test-on-amd64-for-amd64-2359335 disk-/root/.cache/pip disk source=/root/snap/charmcraft/common/cache/charmcraft/charmcraft-buildd-base-v7/BuilddBaseAlias.JAMMY/pip path=/root/.cache/pip' 2025-01-23 16:37:27.353 * Command exit code: 1 2025-01-23 16:37:27.353 * Command standard error output: b'Error: Failed add validation for device "disk-/root/.cache/pip": Missing source path "/root/snap/charmcraft/common/cache/charmcraft/charmcraft-buildd-base-v7/BuilddBaseAlias.JAMMY/pip" for disk "disk-/root/.cache/pip"\n' 2025-01-23 16:37:27.353 Full execution log: '/root/.local/state/charmcraft/log/charmcraft-20250123-163454.690259.log' ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 40
Quick Win: 18.0
Staleness: 70
Complexity: 55
Confidence: 60
Support Request: 30
keep open Charmcraft pack fails on LXD cluster when container lands on a node lacking the shared cache pip dir; maintainer offered workaround (CRAFT_SHARED_CACHE) and asked if a patch release accepting a flag would help; no reporter reply since Jan 2025.
qwen/qwen3.6-35b-a3b
Staleness: 75
Complexity: 30
Confidence: 85
Support Request: 35
keep open Charmcraft pack fails in LXD clusters when the target node lacks the host pip cache directory. Maintainer acknowledged, provided workarounds, and indicated a patch is in progress. Awaiting user feedback.
qwen3.6-35b-a3b-mtp-q6
Staleness: 65
Complexity: 25
Confidence: 85
Support Request: 0
keep open Charmcraft pack fails in LXD clusters when the target node lacks the expected pip cache directory. Maintainer acknowledged the limitation, provided workarounds, and created an internal ticket.
qwen3.6-35b-a3b-mtp-q6
Staleness: 45
Complexity: 30
Confidence: 90
Support Request: 10
keep open Charmcraft pack fails in LXD clusters due to missing shared cache paths on secondary nodes. Maintainer acknowledged, provided workarounds, and noted an upcoming patch release will address it.
qwen3.6-35b-a3b-mtp-q6
Staleness: 80
Complexity: 20
Confidence: 85
Support Request: 70
close not a bug charmcraft pack fails in LXD clusters due to missing pip cache directories on secondary nodes. Maintainers acknowledged the bug, provided workarounds, and logged internal ticket CRAFT-4039. Awaiting patch release.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/craft-providers#756 (confidence 55%)

    craft-providers commit d4e3f46 'fix(base): warn, don't fail, on failures to mount a shared cache (#756)' changes _mount_shared_cache_dirs to warn instead of raising, which would turn this hard failure into a non-fatal warning. Date not confirmed, so confidence is moderate.

Related issues

Issue Project State Summary Similarity
#560 Charmcraft pack is giving error frequently charmcraft closed Charmcraft pack failed due to an apt-get network error installing snapd in an LXD container. Maintainers linked it to a known networking issue. The reporter confirmed a workaround failed. Closed without a code fix, likely abandoned.
70%