Core24 accepts integer version, Core22 does not and gives obscure error
Metadata
Current evaluation
Core22 crashes with a Pydantic traceback for an unquoted numeric version that Core24 accepts; the report remains open and untriaged.
Suggested action: needs triage
Reason: The report provides an exact two-line reproducer and full traceback; the current lifecycle passes the raw YAML version into craft_parts ProjectInfo before project unmarshalling, so the integer triggers ProjectVar string validation. Choosing whether to coerce numeric versions or emit an earlier user-facing validation error requires maintainer triage, and the issue has no labels, assignee, or acknowledged resolution.
Evaluated by: mr-cal-bot
Impact:
38
Quick Win:
21
Complexity:
34
Confidence:
92
Actionability:
84
Issue body
I had this snapcraft.yaml, which built fine:
--->
name: llvm-chromium
version: 20
base: core24
...
<---
Changing base to core22 causes the very same build to fail right away, which is already confusing enough, but then the error is also cryptic:
--->
Traceback (most recent call last):
File "/snap/snapcraft/12614/bin/snapcraft", line 8, in <module>
sys.exit(main())
File "/snap/snapcraft/12614/lib/python3.10/site-packages/snapcraft/application.py", line 498, in main
return cli.run()
File "/snap/snapcraft/12614/lib/python3.10/site-packages/snapcraft/cli.py", line 252, in run
_run_dispatcher(dispatcher, global_args)
File "/snap/snapcraft/12614/lib/python3.10/site-packages/snapcraft/cli.py", line 225, in _run_dispatcher
dispatcher.run()
File "/snap/snapcraft/12614/lib/python3.10/site-packages/craft_cli/dispatcher.py", line 487, in run
return self._loaded_command.run(self._parsed_command_args)
File "/snap/snapcraft/12614/lib/python3.10/site-packages/snapcraft/commands/core22/lifecycle.py", line 139, in run
parts_lifecycle.run(self.name, parsed_args)
File "/snap/snapcraft/12614/lib/python3.10/site-packages/snapcraft/parts/lifecycle.py", line 96, in run
_expand_environment(
File "/snap/snapcraft/12614/lib/python3.10/site-packages/snapcraft/parts/lifecycle.py", line 748, in _expand_environment
info = craft_parts.ProjectInfo(
File "/snap/snapcraft/12614/lib/python3.10/site-packages/craft_parts/infos.py", line 148, in __init__
self._project_vars = {k: ProjectVar(value=v) for k, v in pvars.items()}
File "/snap/snapcraft/12614/lib/python3.10/site-packages/craft_parts/infos.py", line 148, in <dictcomp>
self._project_vars = {k: ProjectVar(value=v) for k, v in pvars.items()}
File "/snap/snapcraft/12614/lib/python3.10/site-packages/pydantic/main.py", line 193, in __init__
self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for ProjectVar
value
Input should be a valid string [type=string_type, input_value=20, input_type=int]
For further information visit https://errors.pydantic.dev/2.8/v/string_type
<---
After much scratching my head I noticed the "20" and then solved the problem by also editing
version: "20"
with quotes. Core24 was accepting version: 20 without quotes though.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha |
Impact:
38
Quick Win:
21
Complexity:
34
Confidence:
92
Actionability:
84
|
needs triage | Core22 crashes with a Pydantic traceback for an unquoted numeric version that Core24 accepts; the report remains open and untriaged. | |
| stealth/space-bunny-alpha |
Impact:
32
Quick Win:
19
Complexity:
28
Confidence:
88
Actionability:
84
|
needs triage | Core22 passes the raw YAML version to craft-parts, so an unquoted numeric version causes an opaque pydantic traceback while core24 succeeds; the consistency and error-reporting issue remains open. | |
| stealth/space-bunny-alpha |
Impact:
35
Quick Win:
30
Complexity:
10
Confidence:
98
Actionability:
94
|
close resolved | Core22 rejected an unquoted numeric snap version with a raw Pydantic traceback while Core24 accepted it; craft-parts now coerces project-variable numbers to strings. | |
| qwen3.6-35b-a3b-mtp-q6 |
Impact:
30
Quick Win:
24
Staleness:
85
Complexity:
20
Confidence:
80
Support Request:
10
|
close stale | Integer version in snapcraft.yaml causes pydantic validation error with core22 base. Fixed in craft-parts via coerce_numbers_to_str. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
90
Complexity:
40
Confidence:
85
Support Request:
5
|
needs triage | Inconsistency where snapcraft core24 accepts integer version in snapcraft.yaml but core22 fails with a cryptic Pydantic validation error. Unlabelled and untouched for over 1.5 years. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
65
Complexity:
40
Confidence:
85
Support Request:
10
|
needs triage | Inconsistency between Core24 and Core22 base handling of unquoted integer versions in snapcraft.yaml, causing a cryptic validation error for Core22. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
92
Complexity:
25
Confidence:
85
Support Request:
10
|
needs triage | Inconsistent version field handling between core22 and core24 bases. core22 rejects integer versions with a cryptic Pydantic error, while core24 accepts them. Issue is untriaged and inactive for over a year. |
Update history
| Date | Change |
|---|---|
| created |
Related issues
No related issues found above the similarity threshold.