Totally misleading error on non-string version
Metadata
Current evaluation
Fixed misleading validation for non-string versions via merged PR snapcore/snapcraft#2497 (commit 6daaf2804), which added clearer type- and length-specific errors.
Resolution: closed resolved
Reason: The linked PR #2497 was merged as commit 6daaf2804 and improved validation messages for non-string version values and invalid lengths.
Evaluated by: mr-cal-bot
No scores available.
Issue body
I had this in my snapcraft.yaml:
version: 8.1
the error it gave me was:
Issues while validating snapcraft.yaml: The 'version' property does not match the required schema: 8.1 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.
However, my 8.1 totally matched what was described there!!!
Turns out (I guess) that the problem was that it was a number, I changed it to
version: "8.1"
and it seems to work ok now.
So, snapcraft should first check if it's a string or not, and error out with something like "The 'version' property needs to be a string, found a float".
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed misleading validation for non-string versions via merged PR snapcore/snapcraft#2497 (commit 6daaf2804), which added clearer type- and length-specific errors. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed misleading version validation errors in merged PR #2497 (commit 6daaf2804), distinguishing incorrect types and invalid lengths. | |
| stealth/space-bunny-alpha | — | closed stale | Closed without a documented fix or follow-up; unquoted version 8.1 was parsed as a number and produced a misleading validation error. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. The suggested explicit type validation for numeric version values was not implemented, leaving the misleading schema error unaddressed. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. The suggested improvement for clearer error handling when non-string versions are provided in snapcraft.yaml was not implemented. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without implementation. The error stems from YAML schema validation requiring explicit string typing. No code changes or error message improvements were made. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without resolution. The user resolved the issue locally by quoting the version value, as the schema requires a string rather than a number. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
snapcore/snapcraft#2497
(confidence 100%)
Merged PR implementing the requested clearer validation for version values.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2497 Improved error message for 'version' specific cases (type error and bad length) | snapcraft | merged | Merged PR #2497 in commit 6daaf2804, improving validation errors for non-string version values and versions with invalid lengths. |