← Back to issue list

RemoteBuild raises uncaught MissingSchema error

View original Github issue

Metadata

Project
craft-application
Number
#996
Type
issue
State
open
Author
mr-cal
Labels
Status: Triaged Type: Bug
Created
Updated
Closed

Current evaluation

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.

Suggested action: keep open

Reason: The issue is triaged (labels Status: Triaged, Type: Bug) and filed by a maintainer, but the only comment is the Jira-sync bot (CRAFT-4994) with no human resolution. The current fetch_logs code already skips builds where build_log_url is falsy, which appears to address the crash, but I could not confirm via git history that this guard was added specifically to fix this issue, so it may still need verification/closure.

Impact: 45 Quick Win: 31.5 Staleness: 55 Complexity: 30 Confidence: 60 Support Request: 5

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.8-27b
Impact: 45
Quick Win: 31.5
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.
qwen3.6-35b-a3b-mtp-q6
Staleness: 55
Complexity: 30
Confidence: 85
Support Request: 0
keep open RemoteBuild raises an uncaught MissingSchema error when builds are cancelled via the Launchpad UI. Status is triaged and awaiting a fix to gracefully catch the exception and handle cancelled builds.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/snapcraft#5960 (confidence 70%)

    Downstream snapcraft report referenced in the issue body as the reproduction source.

Related issues

Issue Project State Summary Similarity
#5960 remote build: internal error when build is cancelled on launchpad snapcraft open Remote build crashes with MissingSchema when a build is cancelled on Launchpad: fetch_logs tries to download a log URL that is the string 'None'. Triaged by maintainer, upstream fix tracked in craft-application#996.
87%