Unhandled source type provides traceback
Metadata
Current evaluation
Unhandled source types now produce a proper Snapcraft error instead of a traceback, fixed by snapcore/snapcraft#1929 (5defd5d5e).
Resolution: closed resolved
Reason: PR snapcore/snapcraft#1929 was merged as commit 5defd5d5e, titled "sources: proper errors for invalid handlers." The maintainer explicitly linked it as the incoming fix.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Using a source without specifying the required source-type raises a ValueError, which results in a traceback:
$ snapcraft
Traceback (most recent call last):
File "/home/kyrofa/venv/snapcraft/bin/snapcraft", line 9, in <module>
load_entry_point('snapcraft', 'console_scripts', 'snapcraft')()
File "/home/kyrofa/venv/snapcraft/lib/python3.5/site-packages/pkg_resources/__init__.py", line 542, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/home/kyrofa/venv/snapcraft/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2569, in load_entry_point
return ep.load()
File "/home/kyrofa/venv/snapcraft/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2229, in load
return self.resolve()
File "/home/kyrofa/venv/snapcraft/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2235, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/home/kyrofa/src/snapcraft/snapcraft/cli/__main__.py", line 19, in <module>
run(prog_name='snapcraft')
File "/home/kyrofa/venv/snapcraft/lib/python3.5/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/home/kyrofa/venv/snapcraft/lib/python3.5/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/kyrofa/venv/snapcraft/lib/python3.5/site-packages/click/core.py", line 1043, in invoke
return Command.invoke(self, ctx)
File "/home/kyrofa/venv/snapcraft/lib/python3.5/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/kyrofa/venv/snapcraft/lib/python3.5/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/kyrofa/venv/snapcraft/lib/python3.5/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/kyrofa/src/snapcraft/snapcraft/cli/_runner.py", line 72, in run
ctx.forward(lifecyclecli.commands['snap'])
File "/home/kyrofa/venv/snapcraft/lib/python3.5/site-packages/click/core.py", line 553, in forward
return self.invoke(cmd, **kwargs)
File "/home/kyrofa/venv/snapcraft/lib/python3.5/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/kyrofa/src/snapcraft/snapcraft/cli/lifecycle.py", line 139, in snap
project_options, directory=directory, output=output)
File "/home/kyrofa/src/snapcraft/snapcraft/internal/lifecycle/_packer.py", line 45, in snap
execute('prime', project_options)
File "/home/kyrofa/src/snapcraft/snapcraft/internal/lifecycle/_runner.py", line 61, in execute
config = project_loader.load_config(project_options)
File "/home/kyrofa/src/snapcraft/snapcraft/internal/project_loader/__init__.py", line 25, in load_config
return Config(project_options)
File "/home/kyrofa/src/snapcraft/snapcraft/internal/project_loader/_config.py", line 131, in __init__
snapcraft_yaml=self.snapcraft_yaml_path)
File "/home/kyrofa/src/snapcraft/snapcraft/internal/project_loader/_parts_config.py", line 56, in __init__
self._process_parts()
File "/home/kyrofa/src/snapcraft/snapcraft/internal/project_loader/_parts_config.py", line 86, in _process_parts
self.load_part(part_name, plugin_name, properties)
File "/home/kyrofa/src/snapcraft/snapcraft/internal/project_loader/_parts_config.py", line 196, in load_part
confinement=self._confinement)
File "/home/kyrofa/src/snapcraft/snapcraft/internal/pluginhandler/__init__.py", line 94, in __init__
self._part_properties)
File "/home/kyrofa/src/snapcraft/snapcraft/internal/pluginhandler/__init__.py", line 130, in _get_source_handler
self._source, source_type=properties['source-type'])
File "/home/kyrofa/src/snapcraft/snapcraft/internal/sources/__init__.py", line 161, in get_source_handler
source_type = _get_source_type_from_uri(source)
File "/home/kyrofa/src/snapcraft/snapcraft/internal/sources/__init__.py", line 189, in _get_source_type_from_uri
raise ValueError('no handler to manage source ({})'.format(source))
ValueError: no handler to manage source (https://bitbucket.org/klembot/twinejs)
This should probably be a SnapcraftError instead.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Unhandled source types now produce a proper Snapcraft error instead of a traceback, fixed by snapcore/snapcraft#1929 (5defd5d5e). | |
| stealth/space-bunny-alpha | — | closed resolved | Unhandled source type raised a raw ValueError traceback; fixed by PR snapcore/snapcraft#1929, merged as commit 5defd5d5, which converts it into a SnapcraftError. | |
| stealth/space-bunny-alpha | — | closed resolved | Unhandled sources now raise proper SnapcraftError exceptions instead of ValueError tracebacks, fixed by merged PR canonical/snapcraft#1929 (5defd5d5). | |
| qwen/qwen3.6-35b-a3b | — | — | Closed. Missing source-type parameters triggered raw ValueErrors instead of SnapcraftErrors. No fix or PR was linked, indicating the report was likely abandoned or resolved in a later release without explicit tracking. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without documented resolution. The ValueError traceback for unhandled source types was not explicitly fixed or merged. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed. The raw ValueError causing unhandled tracebacks was replaced with a proper SnapcraftError to gracefully handle unsupported source types. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed by replacing the raw ValueError with a SnapcraftError to prevent tracebacks when processing unhandled source types, closing the issue. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
snapcore/snapcraft#1929
(confidence 100%)
Merged commit 5defd5d5e replaces the unhandled source-handler error with proper error handling.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1929 sources: proper errors for invalid handlers | snapcraft | merged | Merged PR #1929 as 5defd5d5e, adding SnapcraftError-derived errors for unhandled source handlers and resolving LP #1741952. |