← Back to issue list

Successfully pack charm with incorrect charm.py file permission

View original Github issue

Metadata

Project
charmcraft
Number
#1931
Type
issue
State
open
Author
yhaliaw
Labels
—
Created
Updated
Closed
—

Current evaluation

Packing accepts a non-executable src/charm.py, causing Juju to fail at deploy. The report has a clear reproducer but no maintainer triage or recorded fix.

Suggested action: needs triage

Reason: The report gives exact reproduction steps and the resulting Juju error, while the current dispatch script invokes the entrypoint with Python and does not correct its mode. The issue has no labels, assignee, or maintainer comments, so it still needs triage to choose validation, warning, or normalization.

Evaluated by: mr-cal-bot

Impact: 48 Quick Win: 30 Complexity: 28 Confidence: 88 Actionability: 86

Issue body

### Bug Description Packing the charm with `src/charm.py` without execute permission will result in produced charm to fail with `unit.content-cache/0.install /var/lib/juju/agents/unit-content-cache-0/charm/dispatch: 3: exec: ./src/charm.py: Permission denied` when deployed with juju. charmcraft should either warn/error out or fix the file permission for `src/charm.py` when packing the charm. ### To Reproduce - Start with any working charm. - Set the `src/charm.py` to without execute permission, e.g., `chmod -x src/charm.py`. - Pack the charm with `charmcraft pack`, then deploy with `juju deploy {PATH_TO_CHARM_PACKED}`. ### Environment Host: Ubuntu 22.04 LTS Charm: deployed on LXD container and machine on 22.04 ### charmcraft.yaml ```yaml This issue is not related to the charmcraft.yaml ``` ### Relevant log output ```shell The error when juju deploy: `unit.content-cache/0.install /var/lib/juju/agents/unit-content-cache-0/charm/dispatch: 3: exec: ./src/charm.py: Permission denied` ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 48
Quick Win: 30
Complexity: 28
Confidence: 88
Actionability: 86
needs triage Packing accepts a non-executable src/charm.py, causing Juju to fail at deploy. The report has a clear reproducer but no maintainer triage or recorded fix.
qwen/qwen3.6-35b-a3b
Impact: 70
Quick Win: 45
Complexity: 20
Confidence: 85
Actionability: 80
keep open charmcraft pack preserves src/charm.py permissions; non-executable entrypoint causes runtime 'Permission denied' on Juju deploy. No fix implemented yet.
qwen/qwen3.8-27b
Impact: 45
Quick Win: 29
Staleness: 72
Complexity: 35
Confidence: 62
Support Request: 10
needs triage 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.
qwen/qwen3.6-35b-a3b
Staleness: 92
Complexity: 25
Confidence: 85
Support Request: 10
needs triage Charmcraft packs charms with src/charm.py lacking execute permission, causing deployment failures. Untriaged, no maintainer response, inactive for over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 20
Confidence: 70
Support Request: 5
close stale charmcraft packs charms without preserving or fixing execute permissions on src/charm.py, causing deployment failures. The report has been inactive for over a year with no maintainer response or labels.
qwen3.6-35b-a3b-mtp-q6
Staleness: 90
Complexity: 20
Confidence: 85
Support Request: 10
needs triage Charmcraft fails to enforce execute permissions on src/charm.py during packing, causing Juju deployment failures. Issue remains untriaged with no maintainer response.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/charmcraft#1972 (confidence 72%)

    The nearby dispatch fix addresses dispatch behavior, but available evidence does not show that it validates or fixes the entrypoint's executable permission.

Related issues

Issue Project State Summary Similarity
#879 pack command succeeds without copying charm charmcraft closed Charmcraft 2.1 fixed false pack success after charm failed in canonical/charmcraft#804 via PR #869 (7046f61d); the remaining Jinja2 failure is tracked in juju/charm-tools#646.
74%
#2233 charmcraft should complain if the charm contains a bundle charmcraft open Feature request: charmcraft pack should error/warn when the produced charm contains a bundle.yaml, since juju deploy then deploys the bundle instead of the charm. Clear repro, but no maintainer triage or labels.
70%