snapcraft init with parts fails with required options
Metadata
Current evaluation
Running snapcraft init with parts requiring options triggers a jsonschema validation error. The report was closed without comments or documented resolution, indicating it was abandoned or superseded by newer versions.
Suggested action: —
No scores available.
Issue body
When running snapcraft init with a part specified, there's no way right I can see to specify the required options. Rather than prefilling these options with some sort of placeholder, we get an exception:
example:
$ snapcraft init make
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/snapcraft/lifecycle.py", line 65, in init
self._load_code(plugin_name, properties)
File "/usr/lib/python3/dist-packages/snapcraft/lifecycle.py", line 91, in _load_code
options = _make_options(properties, plugin.schema())
File "/usr/lib/python3/dist-packages/snapcraft/lifecycle.py", line 247, in _make_options
jsonschema.validate(properties, schema)
File "/usr/lib/python3/dist-packages/jsonschema/validators.py", line 432, in validate
cls(schema, args, *kwargs).validate(instance)
File "/usr/lib/python3/dist-packages/jsonschema/validators.py", line 117, in validate
raise error
jsonschema.exceptions.ValidationError: 'source' is a required property
Failed validating 'required' in schema:
{'$schema': 'http://json-schema.org/draft-04/schema#',
'properties': {'source': {'type': 'string'},
'source-branch': {'default': '', 'type': 'string'},
'source-tag': {'default': '', 'type:': 'string'},
'source-type': {'default': '', 'type': 'string'}},
'required': ['source'],
'type': 'object'}
On instance:
{}
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/snapcraft", line 33, in
snapcraft.main.main()
File "/usr/lib/python3/dist-packages/snapcraft/main.py", line 147, in main
args.func(args)
File "/usr/lib/python3/dist-packages/snapcraft/cmds.py", line 58, in init
part = lifecycle.load_plugin(part_name, part_name)
File "/usr/lib/python3/dist-packages/snapcraft/lifecycle.py", line 274, in load_plugin
return PluginHandler(plugin_name, part_name, properties)
File "/usr/lib/python3/dist-packages/snapcraft/lifecycle.py", line 68, in init
part_name, e.message))
snapcraft.lifecycle.PluginError: properties failed to load for make: 'source' is a required property
--
Imported from https://github.com/ubuntu-core/snapcraft/issues/81
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Running snapcraft init with parts requiring options triggers a jsonschema validation error. The report was closed without comments or documented resolution, indicating it was abandoned or superseded by newer versions. | |
| qwen/qwen3.6-35b-a3b | — | — | A crash occurs when snapcraft init fails due to missing required plugin options. The report was closed without comments or resolution after over ten years, indicating it was abandoned or superseded by newer versions. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #81 snapcraft init with parts fails with required options | snapcraft | closed | Migrated to Launchpad bug tracker https://bugs.launchpad.net/snapcraft/+bug/1516775. Closed and superseded by upstream tracking due to the missing required options handling in snapcraft init. | |
| #1897337 snapcraft build <part> ignores the part | snapcraft (launchpad) | closed | The snapcraft build command ignoring specified parts was closed without a fix or resolution. No comments or patches were provided, indicating the report was abandoned without addressing the filtering behavior. | |
| #1802312 Error message with empty parts is misleading | snapcraft (launchpad) | open | Misleading snapcraft error when 'parts' is empty in snapcraft.yaml: the message conflates a schema type error with a part-name validation error. Filed ~7.8 years ago by an external contributor, no labels, no maintainer response, no comments. | |
| #1799925 snapcraft gives conflicting advice for cleaning parts | snapcraft (launchpad) | closed | Closed without a fix. Snapcraft incorrectly advised running snapcraft clean with part and step flags, which were unsupported. The author worked around it with a full clean. The report appears abandoned or superseded by later updates. |