← Back to issue list

charmcraft init --profile machine does not produce a valid charmcraft.yaml

View original Github issue

Metadata

Project
charmcraft
Number
#2167
Type
issue
State
closed
Author
erik78se
Labels
Created
Updated
Closed

Current evaluation

Closed and converted to a feature request. The machine profile template uses the legacy bases key, causing validation failures on newer versions. Resolution involves updating templates to use the platforms key.

Suggested action:

No scores available.

Issue body

### Bug Description charmcraft init --profile machine Does not produce a charmcraft.yaml that works ### To Reproduce charmcraft init --profile machine ### Environment charmcraft version = 3.4.2 ### charmcraft.yaml ```yaml gets produced ``` ### Relevant log output ```shell charmcraft init --profile machine 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 erik@frozen:~/opdb$ charmcraft fetch-lib charms.data_platform_libs.v0.data_interfaces Library charms.data_platform_libs.v0.data_interfaces version 0.41 downloaded. erik@frozen:~/opdb$ code . erik@frozen:~/opdb$ charmcraft pack Bad charmcraft.yaml content: - base requires 'platforms' definition: {'name': 'ubuntu', 'channel': '24.04'} (in field 'bases[0]') ```

Evaluation history

Date Model Scores Action Summary
qwen3.6-35b-a3b-mtp-q6 Closed and converted to a feature request. The machine profile template uses the legacy bases key, causing validation failures on newer versions. Resolution involves updating templates to use the platforms key.
qwen/qwen3.6-35b-a3b Closed as a feature request to migrate charmcraft templates from the bases key to platforms. Maintainers noted the default 22.04 template accepts bases, but updating templates to platforms is required for newer Ubuntu versions.
qwen/qwen3.6-35b-a3b Closed and converted to a feature request. Maintainers confirmed the generated YAML was valid for Ubuntu 22.04 but decided to update all templates to use the new platforms key instead of the deprecated bases key.
qwen3.6-35b-a3b-mtp-q6 Closed and converted to a feature request. The template generates for 22.04, which accepts bases, so the error likely stemmed from manually switching to 24.04. The team will update templates to use the platforms key instead.
qwen3.6-35b-a3b-mtp-q6 Closed as a feature request. Maintainers noted the template targets Ubuntu 22.04, which accepts the deprecated bases field, but proposed updating templates to use the new platforms key instead of treating this as a bug.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1139 `charmcraft init --profile machine` doesn't produce `config.yaml` charmcraft closed Fixed in PR #1149. The machine charm init template and output were updated to remove config.yaml and metadata.yaml from the default files, now directing users to only edit charmcraft.yaml.
77%
#328 charmcraft init produces error charm for machine charms charmcraft closed Closed without resolution. Maintainers acknowledged the core issue persists: charmcraft init still lacks a machine charm template or flag, leaving machine charm workflows unsupported despite claims that metadata changes fixed it.
77%
#2494 charmcraft pack wont produce a proper charm charmcraft open charmcraft init machine profile produced 22.04 base and ignored pyproject.toml deps (uv.lock needed). Base bumped to 24.04 in #2522; init output now explains uv lock in #2754. Docs/template improvements still open.
72%