← Back to issue list

"version: 0.2" returns confusing error message (trunk)

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1813925
Type
issue
State
open
Author
~gerboland
Labels
Created
Updated
Closed

Current evaluation

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.

Suggested action: close stale

Reason: Filed 2770 days ago with zero comments, no labels, and no maintainer engagement. The issue references PR #2334 from the 2.x era; the current codebase (snapcraft/models/, snapcraft/commands/, snapcraft/parts/) reflects a completely different architecture, making the specific error message and validation path no longer applicable.

Impact: 20 Quick Win: 15.0 Staleness: 95 Complexity: 25 Confidence: 65 Support Request: 15

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
qwen/qwen3.8-27b
Impact: 20
Quick Win: 15.0
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.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 10
Confidence: 90
Support Request: 10
close stale Unquoted YAML version strings like 2.11 are parsed as floats, triggering a confusing validation error. The issue is over 7 years old with no maintainer interaction and reflects a fundamental YAML parsing quirk rather than a current project bug.

Update history

No update history recorded yet.

Related work

  • Caused By: snapcore/snapcraft#2334 (confidence 90%)

    PR #2334 'schema: enforce string for versions' is explicitly cited in the issue body as the change that introduced this validation error.

Related issues

No related issues found above the similarity threshold.