← Back to issue list

5.5.0 changes pack semantics if the project file has different metadata

View original Github issue

Metadata

Project
craft-application
Number
#821
Type
issue
State
open
Author
javierdelapuente
Labels
Status: Triaged Type: Bug
Created
Updated
Closed
—

Current evaluation

Metadata-only charmcraft.yaml edits were skipped as "Already packed," leaving stale .charm artifacts; Charmcraft PR #2890 is reported to fix repacking after the edit.

Suggested action: close resolved

Reason: The 2026-09-25 comment explicitly states that canonical/charmcraft#2890 fixes the issue and shows the second pack reporting "Packed" after metadata is edited. The earlier maintainer comment also identified the affected logic and requested a testcraft spread regression test.

Evaluated by: mr-cal-bot

Impact: 58 Quick Win: 31 Complexity: 45 Confidence: 96 Actionability: 98

Issue body

### Bug Description Before `3.5.2.post40+g5e0dd360` changing `charmcraft.yaml` and running `charmcraft pack` would result in a new .charm file. In `3.5.2.post40+g5e0dd360`, changing `charmcraft.yaml` and packing will not change the .charm file. A log message like the following will be issued: ``` ubuntu@paas-tests-iam:~/abc$ charmcraft pack Launching managed ubuntu 22.04 instance... :: Starting instance - (4.4s)chown: invalid user: ‘a+rwx’ Already packed: flask-framework_ubuntu-22.04-amd64.charm ``` and the .charm file will not change to the new changes in charmcraft.yaml. ### To Reproduce Install the latest edge as of today: ``` ubuntu@paas-tests-iam:~/abc$ sudo snap refresh charmcraft --channel=edge charmcraft (edge) 3.5.2.post40+g5e0dd360 from Canonical✓ refreshed ``` Init the charm directory: ``` ubuntu@paas-tests-iam:~/abc$ charmcraft init --profile flask-framework --name flask-framework Charmed operator package file and directory tree initialised. Now edit the following package files to provide fundamental charm metadata and other information: charmcraft.yaml src/charm.py README.md ``` Pack: ``` ubuntu@paas-tests-iam:~/abc$ charmcraft pack WARNING: Cannot get a keyring. Every store interaction that requires authentication will require you to log in again. Launching managed ubuntu 22.04 instance... :: Starting instance - (22.1s)chown: invalid user: ‘a+rwx’ Packed flask-framework_ubuntu-22.04-amd64.charm ``` The .cham is there: ``` ubuntu@paas-tests-iam:~/abc$ ls -lrht total 12M -rw-rw-r-- 1 ubuntu ubuntu 1.4K Jul 24 12:43 charmcraft.yaml -rw-rw-r-- 1 ubuntu ubuntu 31 Jul 24 12:43 requirements.txt -rw-rw-r-- 1 ubuntu ubuntu 766 Jul 24 12:43 pyproject.toml drwxrwxr-x 2 ubuntu ubuntu 4.0K Jul 24 12:43 src -rw-rw-r-- 1 ubuntu ubuntu 1.9K Jul 24 12:43 tox.ini drwxrwxr-x 3 ubuntu ubuntu 4.0K Jul 24 12:44 lib -rw-r--r-- 1 ubuntu ubuntu 12M Jul 24 12:46 flask-framework_ubuntu-22.04-amd64.charm ``` Edit the charmcraft.yaml file (adding for example a config option): ``` ubuntu@paas-tests-iam:~/abc$ echo "config:" >> charmcraft.yaml ubuntu@paas-tests-iam:~/abc$ echo " options:" >> charmcraft.yaml ubuntu@paas-tests-iam:~/abc$ echo " greeting:" >> charmcraft.yaml ubuntu@paas-tests-iam:~/abc$ echo ' default: "Hello, world!"' >> charmcraft.yaml ubuntu@paas-tests-iam:~/abc$ echo ' type: string' >> charmcraft.yaml ubuntu@paas-tests-iam:~/abc$ echo ' description: nothing' >> charmcraft.yaml ``` Pack again: ``` ubuntu@paas-tests-iam:~/abc$ charmcraft pack Launching managed ubuntu 22.04 instance... :: Starting instance - (4.4s)chown: invalid user: ‘a+rwx’ Already packed: flask-framework_ubuntu-22.04-amd64.charm ``` No change in the .charm file: ``` ubuntu@paas-tests-iam:~/abc$ ls -lrhta total 12M -rw-rw-r-- 1 ubuntu ubuntu 75 Jul 24 12:43 .gitignore -rw-rw-r-- 1 ubuntu ubuntu 31 Jul 24 12:43 requirements.txt -rw-rw-r-- 1 ubuntu ubuntu 766 Jul 24 12:43 pyproject.toml drwxrwxr-x 2 ubuntu ubuntu 4.0K Jul 24 12:43 src -rw-rw-r-- 1 ubuntu ubuntu 1.9K Jul 24 12:43 tox.ini drwxrwxr-x 3 ubuntu ubuntu 4.0K Jul 24 12:44 lib drwxrwxr-x 4 ubuntu ubuntu 4.0K Jul 24 12:46 . -rw-r--r-- 1 ubuntu ubuntu 12M Jul 24 12:46 flask-framework_ubuntu-22.04-amd64.charm -rw-rw-r-- 1 ubuntu ubuntu 1.5K Jul 24 12:49 charmcraft.yaml drwxr-x--- 11 ubuntu ubuntu 4.0K Jul 24 12:49 .. ``` Refreshing charmcraft to the latest version and running pack will overwrite the .charm file. ### Environment I have tried in a new 24.04 multipass machine. I think the relevant part is the release of charmcraft `3.5.2.post40+g5e0dd360` ### charmcraft.yaml ```yaml ubuntu@paas-tests-iam:~/abc$ cat charmcraft.yaml # This file configures Charmcraft. # See https://juju.is/docs/sdk/charmcraft-config for guidance. name: flask-framework type: charm bases: - build-on: - name: ubuntu channel: "22.04" run-on: - name: ubuntu channel: "22.04" # (Required) summary: A very short one-line summary of the Flask application. # (Required) description: | A comprehensive overview of your Flask application. extensions: - flask-framework # Uncomment the integrations used by your application # Integrations set to "optional: false" will block the charm # until the applications are integrated. # requires: # mysql: # interface: mysql_client # optional: false # limit: 1 # postgresql: # interface: postgresql_client # optional: false # limit: 1 # mongodb: # interface: mongodb_client # optional: false # limit: 1 # redis: # interface: redis # optional: false # limit: 1 # s3: # interface: s3 # optional: false # limit: 1 # saml: # interface: saml # optional: false # limit: 1 # rabbitmq: # interface: rabbitmq # optional: false # limit: 1 # tracing: # interface: tracing # optional: true # limit: 1 # smtp: # interface: smtp # optional: false # limit: 1 # openfga: # interface: openfga # optional: false # limit: 1 ``` ### Relevant log output ```shell Already packed: flask-framework_ubuntu-22.04-amd64.charm ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 58
Quick Win: 31
Complexity: 45
Confidence: 96
Actionability: 98
close resolved Metadata-only charmcraft.yaml edits were skipped as "Already packed," leaving stale .charm artifacts; Charmcraft PR #2890 is reported to fix repacking after the edit.
stealth/space-bunny-alpha
Impact: 58
Quick Win: 33
Complexity: 42
Confidence: 90
Actionability: 97
keep open Charmcraft can leave a stale .charm when only charmcraft.yaml metadata changes; `clean` is a workaround, and charmcraft#2890 reportedly fixes it.
qwen/qwen3.6-35b-a3b
Impact: 70
Quick Win: 34
Complexity: 40
Confidence: 75
Actionability: 80
keep open Pack command skips rebuilding when charmcraft.yaml metadata changes; triaged and moved to craft-application; workaround is to run clean.
qwen/qwen3.8-27b
Impact: 60
Quick Win: 27
Staleness: 55
Complexity: 55
Confidence: 70
Support Request: 5
keep open Charmcraft pack skips repacking when only charmcraft.yaml metadata (e.g. summary, config, platforms) changes, leaving a stale .charm. Triaged and moved to craft-application; workaround is clean. Conditional repacking support added in #1111.
qwen/qwen3.6-35b-a3b
Staleness: 85
Complexity: 55
Confidence: 85
Support Request: 10
keep open charmcraft pack skips rebuilding when charmcraft.yaml metadata changes, incorrectly reporting Already packed. Issue is triaged, moved to craft-application, and awaiting resolution.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 50
Confidence: 80
Support Request: 10
keep open Pack commands skip rebuilding when project metadata changes, outputting Already packed. Triaged, moved to craft-application, and has a clean command workaround, but has been inactive for over 345 days.

Update history

Date Change
updated
updated

Related work

  • Likely Fixed By: canonical/charmcraft#2890 (confidence 98%)

    The linked comment reports the PR as the fix and includes corrected output after changing charmcraft.yaml.

Related issues

Issue Project State Summary Similarity
#1530 Changing charmcraft.yaml doesn't update the resulting charm's metadata.yaml charmcraft open The original stale metadata.yaml bug was fixed by merged PR #2874; a later Charmcraft 5.5.0 stale-repack variant remains tracked in craft-application#821.
81%
#2890 feat: skip repacking if project is not changed charmcraft merged Merged PR implementing metadata mediation for config.yaml and actions.yaml so charmcraft skips repacking unchanged projects; fixes #2858 and canonical/craft-application#821.
77%
#2498 fix: `charmcraft pack --project-dir` with metadata.yaml charmcraft closed Closed unmerged; superseded by #2644, which fixed metadata lookup for --project-dir and shipped in Charmcraft 4.2.1.
77%
#2493 Packing fails when using a separate metadata.yaml file and `--project-dir` argument charmcraft closed Fixed by PR #2644 (c87eca0d), which loads separate metadata.yaml from the correct project directory. The fix was slated for Charmcraft 4.2.1.
74%
#2705 docs(pack): refer to inline charmcraft.yaml metadata in pack help charmcraft merged Merged #2705 in commit b5334d9b, updating pack help to reference inline charmcraft.yaml metadata instead of the legacy metadata.yaml file.
74%
#777 Do not modify the charm's project when packing using the reactive plugin (CRAFT-928). charmcraft merged Merged PR #777 (CRAFT-928) via commit bac1d03b, preventing reactive packing from modifying the charm project and fixing #693's incorrect dirty versions.
74%
#1160 `charmcraft pack` does not recognize updated `charmcraft.yaml` file charmcraft open Tracked upstream: charmcraft pack ignores build-snaps channel changes in charmcraft.yaml unless clean is run. Root cause is craft-parts#496 (build-snaps missing from properties_of_interest), still unfixed; charmcraft only needs a craft-parts bump once patched.
73%
#2341 Packing a bundle produces a zip that is rejected by charmhub charmcraft open Charmcraft 3.4.6 packs bundles with metadata.yaml instead of bundle.yaml, causing Charmhub rejection. Bundle features removed in Charmcraft 4.0; maintainer requested charmcraft.yaml with no response.
72%
#699 Release 1.5 charmcraft merged Charmcraft 1.5 was released by merging canonical/charmcraft#699, which updated release metadata in two files.
71%
#2055 `no hooks nor dispatch file` after packing charmcraft closed Fixed by merged PR #2073 (commit a93a2d91): Charmcraft now rejects platform-based charm projects without parts instead of producing an invalid metadata-only charm.
71%