"version: 0.2" returns confusing error message (trunk)
Metadata
Current evaluation
Unquoted YAML numeric versions such as 2.11 are parsed as floats and rejected with a misleading snap-version error; quoting works, but compatibility or clearer messaging remains unaddressed.
Suggested action: needs triage
Reason: The report provides an exact reproducer—unquoted version: 2.11 fails while the quoted value succeeds—and the sole follow-up confirms it occurs with older YAML without a base. Current validation still defines version as a string and says it must be enclosed in quotation marks, but no maintainer response, labels, or resolution are recorded, so the desired compatibility or messaging change needs triage.
Evaluated by: mr-cal-bot
Impact:
40
Quick Win:
19
Complexity:
42
Confidence:
90
Actionability:
84
Issue body
I'm using snapcraft trunk. Since https://github.com/snapcore/snapcraft/pull/2334 landed, my old snapcraft files cause this error:
Issues while validating snapcraft.yaml: The 'version' property does not match the required schema: 2.11 is not a valid snap version string. Snap versions consist of upper- and lower-case alphanumeric characters, as well as periods, colons, plus signs, tildes, and hyphens. They cannot begin with a period, colon, plus sign, tilde, or hyphen. They cannot end with a period, colon, or hyphen.
The message appears contradictory, as "2.11" does fulfil the requirements mentioned.
It was non-obvious to figure out that
version: 2.11
is incorrect, but
version: "2.11"
is considered correct.
If I stumble on this, many others will, as lot of existing docs refer to the non-quoted style:
https://github.com/ubuntu-core/snapcraft-examples/blob/master/05-hello-world-combined/snapcraft.yaml
https://docs.snapcraft.io/snapcraft-yaml-reference/4276
Can the old non-quoted style be made acceptable again? Just to keep backward compatibility?
At the very least, can you make the error message more suitable?
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha |
Impact:
40
Quick Win:
19
Complexity:
42
Confidence:
90
Actionability:
84
|
needs triage | Unquoted YAML numeric versions such as 2.11 are parsed as floats and rejected with a misleading snap-version error; quoting works, but compatibility or clearer messaging remains unaddressed. | |
| stealth/space-bunny-alpha |
Impact:
30
Quick Win:
15
Complexity:
40
Confidence:
90
Actionability:
84
|
close not a bug | Unquoted version 2.11 is YAML-parsed as a number, while snap versions must be strings; the current schema explicitly requires quoted versions, so the rejection is intended. | |
| stealth/space-bunny-alpha |
Impact:
38
Quick Win:
13
Complexity:
46
Confidence:
82
Actionability:
62
|
needs triage | Unquoted decimal versions are parsed as YAML numbers and rejected after #2334 enforced strings; backward compatibility or a clearer error was requested, but no maintainer triage is recorded. | |
| qwen/qwen3.8-27b |
Impact:
20
Quick Win:
15
Staleness:
95
Complexity:
25
Confidence:
65
Support Request:
15
|
close stale | Confusing error when unquoted version (e.g. 2.11) in snapcraft.yaml is parsed as a float by YAML instead of a string, introduced by PR #2334. Zero maintainer response in 7.6 years; project has since undergone major architectural changes. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
98
Complexity:
15
Confidence:
90
Support Request:
5
|
close stale | Reports a confusing YAML validation error for unquoted version strings like 0.2 in snapcraft.yaml. Issue is over 7 years old with no maintainer response or activity, and likely irrelevant to current project versions. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
98
Complexity:
20
Confidence:
90
Support Request:
10
|
close stale | Unquoted version strings like 2.11 trigger a confusing schema validation error due to YAML float parsing. The report is over 7 years old, lacks labels or maintainer comments, and remains unresolved. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
98
Complexity:
15
Confidence:
85
Support Request:
10
|
close stale | Unquoted version strings in snapcraft.yaml trigger a confusing schema validation error. The report is over 7 years old, has no maintainer response, and likely applies to obsolete project versions. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Caused By:
snapcore/snapcraft#2334
(confidence 94%)
The reporter explicitly says the regression began after PR #2334 landed.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1669291 'snap info' does not handle versions that end in 0 well | snapcraft (launchpad) | closed | Closed as a YAML/configuration caveat: unquoted 2.10 is parsed numerically, while snapd had resilient parsing covered by snapcore/snapd#4437. Quoting the version preserves it. | |
| #1806058 Version without quotation marks results in an error | snapcraft (launchpad) | closed | Closed as working as designed: unquoted version: 1.0 is parsed by YAML as a number, while Snapcraft requires a string; quotes force string typing. |