`charmcraft pack -o` fails: `FileNotFoundError`
Metadata
Current evaluation
A FileNotFoundError with charmcraft pack -o was abandoned and closed without resolution. No fix was implemented, and a recent comment confirms the bug persists.
Suggested action: —
No scores available.
Issue body
### Bug Description
`charmcraft pack` does not seem to work when provided with the `-o` option to control the output directory. It fails with the following cryptic message: `charmcraft internal error: FileNotFoundError(2, 'No such file or directory')`.
### To Reproduce
1. Checkout https://github.com/juju/juju
2. Run `charmcraft pack -p ./testcharms/charms/lxd-profile -o ./testcharms/charms`
### Environment
OS: Ubuntu 22.04.5 LTS
Charmcraft 3.2.1 installed from snap
### charmcraft.yaml
```yaml
type: "charm"
bases:
- build-on:
- name: "ubuntu"
channel: "20.04"
architectures: ["amd64", "arm64"]
run-on:
- name: "ubuntu"
channel: "22.04"
architectures:
- amd64
- arm64
- s390x
- name: "ubuntu"
channel: "20.04"
architectures:
- amd64
- arm64
- s390x
- name: "ubuntu"
channel: "18.04"
architectures:
- amd64
- arm64
- s390x
- name: "ubuntu"
channel: "16.04"
architectures:
- amd64
- arm64
- s390x
parts:
tiny-bash:
plugin: dump
source: .
prime:
- README
- config.yaml
- hooks
- icon.svg
- lxd-profile.yaml
- metadata.yaml
```
### Relevant log output
```shell
$ charmcraft pack -p ./testcharms/charms/lxd-profile -o ./testcharms/charms
WARNING: Charmcraft does not validate that charms with multiple given architectures are architecture agnostic.
charmcraft internal error: FileNotFoundError(2, 'No such file or directory')
Failed to execute charmcraft in instance.
Full execution log: '/home/jordan/.local/state/charmcraft/log/charmcraft-20240930-095541.119122.log'
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen3.6-35b-a3b-mtp-q6 | — | — | A FileNotFoundError with charmcraft pack -o was abandoned and closed without resolution. No fix was implemented, and a recent comment confirms the bug persists. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. A recent comment confirms the bug persists, indicating the issue was likely marked stale or abandoned. The -o flag continues to trigger a FileNotFoundError during charm packing. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. No fix or workaround was provided, and the issue persists as confirmed by a recent user reporting the same FileNotFoundError when using the -o flag with charmcraft pack. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without a fix or resolution. A recent comment confirms the FileNotFoundError when using the -o flag remains unresolved, indicating the bug was abandoned. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without resolution. The charmcraft pack -o FileNotFoundError remains unfixed. A recent comment confirms the bug persists, and no patch or merge was provided. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #736 `charmcraft` lxc container starts failing with `FileNotFoundError` during iterative design | charmcraft | closed | Closed without a fix. Maintainer could not reproduce the LXC container corruption causing FileNotFoundError during charmcraft pack on newer versions. Reopen if reproducible on Charmcraft 2.7 or 3. | |
| #1931 Successfully pack charm with incorrect charm.py file permission | charmcraft | open | charmcraft pack succeeds even when src/charm.py lacks the execute bit, producing a charm that fails at deploy with 'Permission denied'. Requested a warning/error or auto-fix at pack time. No maintainer activity; an entrypoint linter now exists but only runs via charmcraft analyze, not pack. | |
| #922 Unable to pack charms on a GCP instance | charmcraft | closed | Closed as not a Charmcraft bug. The error stems from a pip and setuptools version mismatch. Maintainers provided a workaround: adding setuptools to charm-python-packages in charmcraft.yaml to force an update and resolve the build failure. | |
| #2361 charmcraft errors out when mixing -p and -o flags | charmcraft | closed | Resolved in PR #2600. charmcraft pack no longer fails with a FileNotFoundError when combining -p and -o flags. Regression tests were added in PR #2735. | |
| #879 pack command succeeds without copying charm | charmcraft | closed | Closed. The pack command failure stems from outdated setuptools and pip in the charm tool, tracked externally, and charmcraft failing to detect build errors, already resolved in version 2.1. | |
| #907 `charmcraft pack` does not handle updating a file's execution permissions without a `charmcraft clean` | charmcraft | open | charmcraft pack ignores local file permission changes (e.g., chmod +x on src/charm.py) until a full charmcraft clean, causing confusing lint errors. Maintainer reproduced and filed upstream craft-parts#311; still unfixed. |