← 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
2024-10-02 04:29:57+00:00
Updated
2025-08-15 15:18:08+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

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

No evaluation history available.