RemoteBuild raises uncaught MissingSchema error
Metadata
Current evaluation
RemoteBuild raises uncaught MissingSchema error when build_log_url is the string 'None' instead of None for cancelled builds
Suggested action: keep open
Reason: The issue is triaged and valid: the traceback shows `build.build_log_url` returns the string 'None' (not Python None) for cancelled builds, bypassing the `if not url:` guard in fetch_logs. A volunteer (arko92) has expressed interest in fixing it. The root cause likely involves Launchpad's API returning 'None' as a string for cancelled builds.
Evaluated by: mr-cal-bot
Impact:
30
Quick Win:
13
Complexity:
30
Confidence:
70
Actionability:
60
Issue body
### 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 https://github.com/canonical/snapcraft/issues/5960
### part yaml
```shell
```
### Relevant log output
```shell
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'
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b |
Impact:
30
Quick Win:
13
Complexity:
30
Confidence:
70
Actionability:
60
|
keep open | RemoteBuild raises uncaught MissingSchema error when build_log_url is the string 'None' instead of None for cancelled builds | |
| stealth/space-bunny-alpha |
Impact:
40
Quick Win:
21
Complexity:
30
Confidence:
80
Actionability:
74
|
keep open | Launchpad-cancelled remote builds can trigger an uncaught MissingSchema error during log retrieval; current source guards absent URLs, but the reported Snapcraft build still needs version verification and regression coverage. | |
| qwen/qwen3.6-35b-a3b |
Impact:
30
Quick Win:
22
Complexity:
10
Confidence:
80
Actionability:
80
|
keep open | RemoteBuild raises uncaught MissingSchema error when build_log_url is the string "None" for cancelled builds; current code's "if not url" check fails to catch it. | |
| qwen/qwen3.8-27b |
Impact:
45
Quick Win:
32
Staleness:
55
Complexity:
30
Confidence:
60
Support Request:
5
|
keep open | RemoteBuild crashes with uncaught MissingSchema when a build is cancelled in Launchpad UI, because fetch_logs tries to download a None build_log_url. Code now guards against empty URLs. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
60
Complexity:
30
Confidence:
85
Support Request:
10
|
keep open | RemoteBuild service crashes with an uncaught MissingSchema error when builds are cancelled from Launchpad. Triaged bug, currently inactive for ~6 months with no maintainer follow-up. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
80
Complexity:
25
Confidence:
80
Support Request:
10
|
keep open | RemoteBuild service crashes with an uncaught MissingSchema error when builds are cancelled, due to a None URL during log fetching. Triaged but inactive for 161 days. |
Update history
| Date | Change |
|---|---|
| updated |
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #5960 remote build: internal error when build is cancelled on launchpad | snapcraft | open | remote-build crashes with internal error MissingSchema when a build is cancelled on Launchpad (build_log_url is the string "None"); acknowledged by mr-cal, tracked upstream in craft-application#996 and Jira SNAPCRAFT-1281, still unfixed. |