No suitable 'build-on' environment found in any 'bases' configuration -- channel '20.04' does not match host '22.04'
Metadata
Current evaluation
Closed as not a bug. The author confirmed that charmcraft's destructive mode requires the host OS to match the configured build base. No code changes were made.
Suggested action: —
No scores available.
Issue body
I'm [getting](https://github.com/canonical/traefik-k8s-operator/actions/runs/3623744801/jobs/6111016852) an error in CI I haven't seen before:
```
Run canonical/charming-actions/upload-charm@2.1.1
/usr/bin/sudo snap install charmcraft --classic --channel latest/stable
charmcraft 2.1.0 from Canonical** installed
/usr/bin/sudo charmcraft pack --destructive-mode --quiet
No suitable 'build-on' environment found in any 'bases' configuration.
```
[charmcraft.yaml](https://github.com/canonical/traefik-k8s-operator/blob/main/charmcraft.yaml) seems to be ok.
Locally, when I run without `--destructive-mode`, it works.
However,
```
$ charmcraft pack --destructive-mode
No suitable 'build-on' environment found in 'bases[0]' configuration.
No suitable 'build-on' environment found in any 'bases' configuration.
Full execution log: '/home/ubuntu/snap/charmcraft/common/cache/charmcraft/log/charmcraft-20221205-165711.217460.log'
$ cat /home/ubuntu/snap/charmcraft/common/cache/charmcraft/log/charmcraft-20221205-165711.217460.log
2022-12-05 16:57:11.217 Starting charmcraft version 2.1.0
2022-12-05 16:57:11.221 System details: OSPlatform(system='ubuntu', release='22.04', machine='x86_64'); Environment: None
2022-12-05 16:57:11.221 Packing the charm.
2022-12-05 16:57:11.221 Reading '/home/ubuntu/code/traefik-k8s-operator/metadata.yaml'
2022-12-05 16:57:11.225 Validating metadata format
2022-12-05 16:57:11.232 Skipping 'bases[0].build-on[0]': channel '20.04' does not match host '22.04'.
2022-12-05 16:57:11.232 No suitable 'build-on' environment found in 'bases[0]' configuration.
2022-12-05 16:57:11.232 No suitable 'build-on' environment found in any 'bases' configuration.
2022-12-05 16:57:11.232 Full execution log: '/home/ubuntu/snap/charmcraft/common/cache/charmcraft/log/charmcraft-20221205-165711.217460.log'
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed as not a bug. The author confirmed that charmcraft's destructive mode requires the host OS to match the configured build base. No code changes were made. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed as invalid. Destructive mode requires the build target to match the host OS. The channel mismatch is expected behavior. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed as invalid by author. Destructive mode requires the host OS to match the build target. The host was Ubuntu 22.04 while the configuration specified 20.04, causing a mismatch. No code changes needed. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed as not a bug. The author determined that charmcraft destructive mode requires the build target to match the host OS version, explaining the 20.04 versus 22.04 mismatch. No code changes were needed. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1267 Can't build charm targeted at the current development release: `Skipping 'bases[8].build-on[0]': channel 'devel' does not match host '23.10'.` | charmcraft | closed | Building charms with channel devel failed due to a host channel mismatch. The issue was closed as fixed in Charmcraft 3. |