Repository navigation
Open
Labels
Description
Bug Description
The remote builder service doesn't handle builds being cancelled from Launchpad's UI and raises an internal error.
I'm not sure the scope of work to gracefully manage cancelled builds, but craft-application should at least catch the exception.
To Reproduce
See downstream report canonical/snapcraft#5960
part yaml
Relevant log output
2026-01-17 02:17:26.571 Stopped: amd64, arm64, armhf, s390x; Building: riscv64
2026-01-17 02:17:58.213 Stopped: amd64, arm64, armhf, s390x; Building: riscv64
2026-01-17 02:18:29.557 Stopped: amd64, arm64, armhf, s390x; Building: riscv64
2026-01-17 02:19:01.806 Stopped: amd64, arm64, armhf, s390x; Building: riscv64
2026-01-17 02:19:34.359 Stopped: amd64, arm64, armhf, s390x; Building: riscv64
2026-01-17 02:20:06.421 Stopped: amd64, arm64, armhf, riscv64, s390x
2026-01-17 02:20:06.421 Fetching build artifacts...
2026-01-17 02:20:08.162 Fetching 5 build logs...
2026-01-17 02:20:08.167 snapcraft internal error: MissingSchema("Invalid URL 'None': No scheme supplied. Perhaps you meant https://None?")
2026-01-17 02:20:08.171 Traceback (most recent call last):
2026-01-17 02:20:08.171 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_application/application.py", line 663, in run
2026-01-17 02:20:08.171 return_code = self._run_inner()
2026-01-17 02:20:08.171 ^^^^^^^^^^^^^^^^^
2026-01-17 02:20:08.171 File "/snap/snapcraft/16570/lib/python3.12/site-packages/snapcraft/application.py", line 183, in _run_inner
2026-01-17 02:20:08.171 return_code = super()._run_inner()
2026-01-17 02:20:08.171 ^^^^^^^^^^^^^^^^^^^^
2026-01-17 02:20:08.171 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_application/application.py", line 640, in _run_inner
2026-01-17 02:20:08.171 return_code = dispatcher.run() or os.EX_OK
2026-01-17 02:20:08.171 ^^^^^^^^^^^^^^^^
2026-01-17 02:20:08.171 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_cli/dispatcher.py", line 564, in run
2026-01-17 02:20:08.171 return self._loaded_command.run(self._parsed_command_args)
2026-01-17 02:20:08.171 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-01-17 02:20:08.171 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_application/commands/base.py", line 222, in run
2026-01-17 02:20:08.171 result = self._run(parsed_args, **kwargs) or result
2026-01-17 02:20:08.171 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-01-17 02:20:08.171 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_application/commands/remote.py", line 165, in _run
2026-01-17 02:20:08.171 returncode = self._monitor_and_complete(builds=builds)
2026-01-17 02:20:08.171 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-01-17 02:20:08.171 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_application/commands/remote.py", line 227, in _monitor_and_complete
2026-01-17 02:20:08.171 logs = builder.fetch_logs(pathlib.Path.cwd())
2026-01-17 02:20:08.171 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-01-17 02:20:08.171 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_application/services/remotebuild.py", line 194, in fetch_logs
2026-01-17 02:20:08.171 self.request.download_files_with_progress(log_downloads)
2026-01-17 02:20:08.171 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_application/services/request.py", line 103, in download_files_with_progress
2026-01-17 02:20:08.171 sizes = [next(dl) for dl in downloads]
2026-01-17 02:20:08.171 ^^^^^^^^
2026-01-17 02:20:08.171 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_application/services/request.py", line 68, in download_chunks
2026-01-17 02:20:08.171 with self.get(url, stream=True) as download:
2026-01-17 02:20:08.171 ^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-01-17 02:20:08.171 File "/snap/snapcraft/16570/lib/python3.12/site-packages/requests/sessions.py", line 602, in get
2026-01-17 02:20:08.171 return self.request("GET", url, **kwargs)
2026-01-17 02:20:08.171 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-01-17 02:20:08.171 File "/snap/snapcraft/16570/lib/python3.12/site-packages/requests/sessions.py", line 575, in request
2026-01-17 02:20:08.171 prep = self.prepare_request(req)
2026-01-17 02:20:08.171 ^^^^^^^^^^^^^^^^^^^^^^^^^
2026-01-17 02:20:08.171 File "/snap/snapcraft/16570/lib/python3.12/site-packages/requests/sessions.py", line 484, in prepare_request
2026-01-17 02:20:08.171 p.prepare(
2026-01-17 02:20:08.171 File "/snap/snapcraft/16570/lib/python3.12/site-packages/requests/models.py", line 367, in prepare
2026-01-17 02:20:08.171 self.prepare_url(url, params)
2026-01-17 02:20:08.171 File "/snap/snapcraft/16570/lib/python3.12/site-packages/requests/models.py", line 438, in prepare_url
2026-01-17 02:20:08.171 raise MissingSchema(
2026-01-17 02:20:08.171 requests.exceptions.MissingSchema: Invalid URL 'None': No scheme supplied. Perhaps you meant https://None?
2026-01-17 02:20:08.171 Full execution log: '/home/ubuntu/.local/state/snapcraft/log/snapcraft-20260117-010959.810411.log'
Activity
syncronize-issues-to-jira commentedon Jan 28, 2026
Thank you for reporting your feedback to us!
The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-4994.
arko92 commentedon Oct 24, 2026
Hi @mr-cal , I'd be interested in working on this issue if it's still available.
I'd like to investigate where the
MissingSchemaexception originates in the remote-build workflow and determine whether it should be addressed through URL validation, error handling, or an upstream fix.My plan is to first trace the failing execution path, add a focused regression test, and then propose a minimal fix consistent with the existing error-handling patterns.
I should be able to validate the Python-side changes locally, though I may need to rely on CI for any tests requiring external build infrastructure.
Let me know if I can take this issue to work on. Thanks!
Arko