← Back to issue list

charmcraft errors out when mixing -p and -o flags

View original Github issue

Metadata

Project
charmcraft
Number
#2361
Type
issue
State
open
Author
PietroPasotti
Labels
Created
2025-07-03 11:06:16+00:00
Updated
2025-08-15 15:17:47+00:00
Closed

Current evaluation

charmcraft pack fails with a FileNotFoundError when combining the -p and -o flags, remaining unaddressed and needing triage with no comments or recent activity.

Suggested action: needs triage

Reason: The issue is a well-structured bug report but lacks labels, assignees, or any maintainer response. Despite its age, it remains a valid report requiring initial triage to verify current relevance, check for fixes in newer versions, and assign priority.

Staleness: 75 Complexity: 20 Confidence: 80 Support Request: 10

Issue body

### Bug Description in [this repo](https://github.com/canonical/tempo-operators) we have two charms, one under ./worker, one under ./coordinator I want to pack them in their respective subdirectories, without `cd`'ing, and the output charms to be in the respective subdirectories. however `charmcraft pack -p ./worker -o ./worker` fails with an error. ### To Reproduce - `git clone https://github.com/canonical/tempo-operators; cd tempo-operators` - `charmcraft pack -p ./worker -o ./worker` ### Environment installed: 3.5.2 (7023) juju info v0.1 ``` ┌──────────────┬───────────────────────────────────┐ │ jhack │ 0.4.4.0.20.26 │ │ python │ 3.10.12 (/bin/python3) │ │ juju-* snaps │ juju │ 3.6.7 - 31266 (3/stable) │ │ microk8s │ MicroK8s v1.31.7 revision 7968 │ │ lxd │ 6.4 │ │ multipass │ 1.15.1 │ │ multipassd │ 1.15.1 │ │ os │ Ubuntu 22.04.5 LTS │ │ kernel │ Linux 6.8.0-60-generic x86_64 │ └──────────────┴───────────────────────────────────┘ ``` ### charmcraft.yaml ```yaml likely irrelevant, but see: https://github.com/canonical/tempo-operators/blob/main/worker/charmcraft.yaml ``` ### Relevant log output ```shell 336 │ 2025-07-03 12:58:56.003 :: 2025-07-03 12:58:54.246 Packing charm tempo-coordinator-k8s_ubuntu@24.04-amd64.charm 337 │ 2025-07-03 12:58:56.003 :: 2025-07-03 12:58:55.631 Packed tempo-coordinator-k8s_ubuntu@24.04-amd64.charm 338 │ 2025-07-03 12:58:56.004 Executing on host: lxc --project charmcraft config device show local:charmcraft-tempo-coordinator-k8s-ubuntu--aa2fd111d0b32a60df53 339 │ 2025-07-03 12:58:56.093 Executing on host: lxc --project charmcraft config device remove local:charmcraft-tempo-coordinator-k8s-ubuntu--aa2fd111d0b32a60df53 disk-/root/.cache/pip 340 │ 2025-07-03 12:58:56.206 Executing on host: lxc --project charmcraft config device remove local:charmcraft-tempo-coordinator-k8s-ubuntu--aa2fd111d0b32a60df53 disk-/root/project 341 │ 2025-07-03 12:58:56.343 Executing on host: lxc --project charmcraft stop local:charmcraft-tempo-coordinator-k8s-ubuntu--aa2fd111d0b32a60df53 342 │ 2025-07-03 12:59:00.766 Executing on host: lxc --project charmcraft list local: --format=yaml 343 │ 2025-07-03 12:59:01.257 Executing on host: lxc --project charmcraft list local: --format=yaml 344 │ 2025-07-03 12:59:01.647 charmcraft internal error: FileNotFoundError(2, 'No such file or directory') 345 │ 2025-07-03 12:59:01.650 Traceback (most recent call last): 346 │ 2025-07-03 12:59:01.650 File "/snap/charmcraft/7023/usr/lib/python3.10/shutil.py", line 816, in move 347 │ 2025-07-03 12:59:01.650 os.rename(src, real_dst) 348 │ 2025-07-03 12:59:01.650 FileNotFoundError: [Errno 2] No such file or directory: '/home/pietro/canonical/tempo-operators/coordinator/tempo-coordinator-k8s_ubuntu@24.04-amd64.charm' -> '/home/pietro/canonical/tempo-operators/coordinator/tempo-coordinator-k8s_ubuntu@24.04-amd64.charm' 349 │ 2025-07-03 12:59:01.650 350 │ 2025-07-03 12:59:01.650 During handling of the above exception, another exception occurred: 351 │ 2025-07-03 12:59:01.650 Traceback (most recent call last): 352 │ 2025-07-03 12:59:01.650 File "/snap/charmcraft/7023/lib/python3.10/site-packages/craft_application/application.py", line 691, in run 353 │ 2025-07-03 12:59:01.650 return_code = self._run_inner() 354 │ 2025-07-03 12:59:01.650 File "/snap/charmcraft/7023/lib/python3.10/site-packages/craft_application/application.py", line 674, in _run_inner 355 │ 2025-07-03 12:59:01.650 self.run_managed(platform, build_for) 356 │ 2025-07-03 12:59:01.650 File "/snap/charmcraft/7023/lib/python3.10/site-packages/charmcraft/application/main.py", line 173, in run_managed 357 │ 2025-07-03 12:59:01.650 shutil.move( 358 │ 2025-07-03 12:59:01.650 File "/snap/charmcraft/7023/usr/lib/python3.10/shutil.py", line 836, in move 359 │ 2025-07-03 12:59:01.650 copy_function(src, real_dst) 360 │ 2025-07-03 12:59:01.650 File "/snap/charmcraft/7023/usr/lib/python3.10/shutil.py", line 434, in copy2 361 │ 2025-07-03 12:59:01.650 copyfile(src, dst, follow_symlinks=follow_symlinks) 362 │ 2025-07-03 12:59:01.650 File "/snap/charmcraft/7023/usr/lib/python3.10/shutil.py", line 254, in copyfile 363 │ 2025-07-03 12:59:01.650 with open(src, 'rb') as fsrc: 364 │ 2025-07-03 12:59:01.650 FileNotFoundError: [Errno 2] No such file or directory: '/home/pietro/canonical/tempo-operators/coordinator/tempo-coordinator-k8s_ubuntu@24.04-amd64.charm' 365 │ 2025-07-03 12:59:01.650 Full execution log: '/home/pietro/.local/state/charmcraft/log/charmcraft-20250703-125829.050512.log' ```

Evaluation history

Date Model Scores Action Summary
2026-06-15 14:13:26.796579+00:00 qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 20
Confidence: 80
Support Request: 10
needs triage charmcraft pack fails with a FileNotFoundError when combining the -p and -o flags, remaining unaddressed and needing triage with no comments or recent activity.
2026-06-15 14:11:19.399613+00:00 pending