← 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 in LXD clusters when the shared cache directory is missing on the node hosting the instance. Maintainer acknowledged unsupported scenario, provided workarounds, and filed internal ticket CRAFT-4039.

Suggested action: keep open

Reason: The maintainer acknowledged the report, noted LXD clusters are unsupported, provided workarounds, and the Jira bot created internal ticket CRAFT-4039. craft-providers commit d4e3f462 (#756) appears to change this failure into a warning, but no charmcraft release or commit confirms the fix has landed, so the issue should remain open.

Evaluated by: mr-cal-bot

Impact: 40 Quick Win: 15 Complexity: 45 Confidence: 70 Actionability: 70

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
~deepseek/deepseek-pro-latest
Impact: 40
Quick Win: 15
Complexity: 45
Confidence: 70
Actionability: 70
keep open Charmcraft pack fails in LXD clusters when the shared cache directory is missing on the node hosting the instance. Maintainer acknowledged unsupported scenario, provided workarounds, and filed internal ticket CRAFT-4039.
stealth/space-bunny-alpha
Impact: 48
Quick Win: 16
Complexity: 58
Confidence: 94
Actionability: 80
keep open Valid Charmcraft failure when an LXD cluster schedules a build where the local shared pip-cache path is absent; maintainers acknowledged it and supplied workarounds.
qwen/qwen3.6-35b-a3b
Impact: 40
Quick Win: 15
Complexity: 50
Confidence: 75
Actionability: 75
keep open Charmcraft fails in LXD clusters when shared cache directory doesn't exist on all nodes. Maintainer acknowledged as unsupported scenario with workarounds provided.
qwen/qwen3.8-27b
Impact: 40
Quick Win: 18
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.

Update history

No update history recorded yet.

Related work

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

    craft-providers commit d4e3f462 changed shared cache mount failures to warn and proceed; current base.py catches ProviderError, which LXDError extends, matching this failure path.

Related issues

Issue Project State Summary Similarity
#560 Charmcraft pack is giving error frequently charmcraft closed The failure was traced to external LXD networking blocking access to archive.ubuntu.com during snapd installation; no Charmcraft fix was merged, and the reported firewall workaround did not help.
70%
#2816 `charmcraft pack` fails on Resolute charmcraft open charmcraft pack fails on Ubuntu Resolute 26.04 hosts when using a Jammy 20.04 build base: snapd inside the LXD build instance cannot reload snap-confine AppArmor profiles; no maintainer response yet.
70%