← Back to issue list

cli: retrieve error data from provider

View original Github issue

Metadata

Project
snapcraft
Number
#2455
Type
pull request
State
merged
Author
cmatsuoka
Labels
—
Created
Updated
Closed

Current evaluation

Merged #2455 as commit 9d353a630, adding provider error-data retrieval so traceback details from unhandled build-provider crashes are exposed and temporary files cleaned up.

Resolution: closed resolved

Reason: PR #2455 was approved and merged into master as commit 9d353a630. The change lets the inner Snapcraft instance save formatted error data for the outer instance to retrieve and report.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Upon facing an unhandled exception, snapcraft generates traceback data and stores it in the filesystem. If running in a build provider, the filesystem location is not accessible from host, and to give user access to error details we need to retrieve this data from the managed provider. This fix addresses this issue by letting inner instance to save error data in a known location, which is retrieved by outer instance before proceeding. LP: #1793082 Signed-off-by: Claudio Matsuoka <claudio.matsuoka@canonical.com> **Note:** this patch refactors CLI error handling to deal with formatted trace data from provider. Raw traceback data can't be easily pickled up for transferring, hence the pre-formatting. It's also hard to test since this version must also be injected in the build provider, but I strongly recommend it to be tested before merging. I ran my tests by manually setting up this version inside the multipass instance. Expected behavior is as follows: - Crashes happening inside the build provider are silent, but generate traceback data that's handled by the managing (outer) instance. - When running non-interactively (no tty), the traceback data should also be printed. - No temporary files used for traceback data retrieval should be present after building. - Non-crashing builds should (obviously) not produce error data. - Legacy modes are handled by legacy snapcraft and should not be affected by this change. - When running without build providers (destructive mode), error data should be presented as usual. ----- - [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [x] If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on [bug reports](https://bugs.launchpad.net/snapcraft)? - [ ] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)? - [x] Have you successfully run `./runtests.sh static`? - [x] Have you successfully run `./runtests.sh tests/unit`? -----

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged #2455 as commit 9d353a630, adding provider error-data retrieval so traceback details from unhandled build-provider crashes are exposed and temporary files cleaned up.
stealth/space-bunny-alpha — closed resolved Merged PR #2455 as commit 9d353a630, allowing the outer CLI to retrieve preformatted crash data from build providers and report provider-side errors.
qwen/qwen3.6-35b-a3b — — Merged. Refactors CLI error handling to retrieve formatted traceback data from build providers, ensuring crash details are accessible to users in managed environments. Approved by reviewer and passed CI.
qwen3.6-35b-a3b-mtp-q6 — — Merged. Fixes inaccessible traceback data during provider crashes by having the inner instance save formatted errors to a temp file, retrieved by the outer instance. Updated to use tblib, TTY detection via env vars, and PID-suffixed files.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#2508 Build provider errors snapcraft merged Merged PR #2508 in commit 8d8f411b3, enhancing build-provider error handling across two files (+353/-85 lines).
71%