← Back to issue list

lxd: better surfacing of errors

View original Github issue

Metadata

Project
snapcraft
Number
#1647
Type
pull request
State
merged
Author
sergiusens
Labels
Created
Updated
Closed

Current evaluation

Merged. Resolves duplicate error printing in LXD by having callers return silent errors with proper exit codes, allowing callees to handle message display. Approved and merged after CI validation.

Suggested action:

No scores available.

Issue body

We do not want to print the same error twice, so the caller should produce a silent error with a proper exit code as the message related to the error would be displayed by the callee. Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com> - [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)? - [x] 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 unit`? ----- I do wish ContainerRunError would be more generalized and that these Container* exceptions live inside the lxd package, but oh well, this fixes the problem today.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged. Resolves duplicate error printing in LXD by having callers return silent errors with proper exit codes, allowing callees to handle message display. Approved and merged after CI validation.
qwen3.6-35b-a3b-mtp-q6 Merged to prevent duplicate error output in LXD operations. Callers now return silent errors with proper exit codes, allowing callees to handle message display. CI passed with noted integration test flakes.
qwen3.6-35b-a3b-mtp-q6 Merged to prevent duplicate error output in LXD operations. Callers now return silent errors with proper exit codes, allowing callees to display messages once. Passed CI checks and accepted.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#2095 lxd: proper error classes for container errors snapcraft merged Merged after approval. Refactored LXD container errors into dedicated classes, relocated them to the LXD module, and fixed architecture retrieval error handling. Added corresponding unit tests. Resolves Launchpad bugs #1734233 and #1734235.
76%
#1771 lxd: suppress traceback when lxc launch / init fails snapcraft merged Merged to suppress tracebacks when lxc launch or init fails, relying on lxc's native error output. Approved by one reviewer, modifying three files (+35/-15).
76%
#3112 spread: remove dead code for lxd setup and add debug prints snapcraft merged Merged removal of redundant elif dead code in LXD setup logic and addition of debug prints for LXD snap install failures. Approved by one reviewer, passed CI checks, and integrated.
74%
#1842 lxd: Change "Terminating" message to debug level snapcraft merged Merged changes that downgrade the LXD Terminating log message to debug level. Approved by three reviewers and passed CI, reducing unnecessary console output.
72%
#1403 lxd: Only remove container if one exists snapcraft merged Merged following two reviewer approvals and passing CI. The update resolves duplicate exceptions during failed LXD container creation by adding a conditional check before attempting container removal.
71%
#1516 lxd: LXD not installed when using remote snapcraft merged Merged fix for a bug where lxc installation was not correctly verified when using a LXD remote. Also corrected incomplete test scenario usage. Approved by two reviewers, modified two files.
70%
#1930 lxd: friendly errror with suggestions if network is broken snapcraft merged Merged improvements to LXD network error handling replace raw stack traces with user-friendly messages and troubleshooting hints. The update explicitly catches connection and encoding exceptions, updates tests, and resolves Launchpad bug #1719952.
70%