build providers: ignore missing LXD instance when cleaning project
Metadata
Current evaluation
Merged fix for SNAPCRAFT-1DB that catches the pylxd.NotFound exception during project cleanup, preventing failures when the LXD instance is manually deleted. Approved and passed CI.
Suggested action: —
No scores available.
Issue body
When cleaning a project, there may be no underlying container
if the user deleted it manually. Catch pylxd's NotFound exception.
Fixes SNAPCRAFT-1DB
Signed-off-by: Chris Patterson <chris.patterson@canonical.com>
- [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [ ] Have you successfully run `./runtests.sh static`?
- [ ] Have you successfully run `./runtests.sh tests/unit`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged fix for SNAPCRAFT-1DB that catches the pylxd.NotFound exception during project cleanup, preventing failures when the LXD instance is manually deleted. Approved and passed CI. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Resolves SNAPCRAFT-1DB by catching pylxd.NotFound exceptions during project cleanup, preventing failures when underlying LXD instances are manually deleted. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Resolved SNAPCRAFT-1DB by merging a fix that catches pylxd's NotFound exception during project cleanup, preventing crashes when LXD containers are manually deleted. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2647 build providers: catch LXD socket error | snapcraft | merged | Merged to catch LXD socket errors in build providers, resolving SNAPCRAFT-WA. Approved by reviewer, passed CI checks, and integrated with a 14-line addition and 6-line deletion across three files. Minor test coverage decrease noted but did not block merge. | |
| #2509 build providers: initial support for LXD | snapcraft | merged | Merged initial LXD build provider support for snapcraft, enabling the --use-lxd flag for lifecycle steps and cleaning. Passes CI. Reviewers noted minor dependency and container setup edge cases, which were clarified or deferred. | |
| #3180 build providers: nice message on bad base | snapcraft | merged | Merged implementation adding a new exception to handle invalid bases in LXD build providers, providing clearer error messages. Resolves SNAPCRAFT-1H2. Approved by one reviewer, passed CI, and modified 4 files (+77/-14). | |
| #1434 lxd: clean with no parts should only delete | snapcraft | merged | Merged. Updates snapcraft LXD handling so running clean without arguments only deletes container resources instead of executing commands inside them. Approved by one reviewer and merged. | |
| #4638 fix(application): use SNAPCRAFT_MANAGED_MODE everywhere | snapcraft | merged | Merged. Replaces CRAFT_MANAGED_MODE with SNAPCRAFT_MANAGED_MODE to fix log loss in nested LXD instances. Approved by two reviewers and passed CI. Does not address unrelated spread test failures. | |
| #3962 Setup snapd for snapcraft_legacy providers | snapcraft | merged | Merged a fix for failing spread tests caused by missing snapd sockets in LXD containers. The change adopts snapd initialization logic from craft-providers to properly start the service, resolving connection errors. Approved and passed CI. | |
| #1230 lxd: refactor Cleanbuilder into Containerbuild and add Project. | snapcraft | merged | Merged. Refactored Cleanbuilder into a Containerbuild base class and introduced a Project class to manage persistent LXD containers for snap builds. Approved after code review and test fixes. | |
| #2529 build providers: idempotent destroy for LXD | snapcraft | merged | Merged fix making LXD provider destroy idempotent. Resolves AttributeError crash during cleanup when container launch fails. Prevents NoneType sync errors and displays a clean error message instead. | |
| #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. | |
| #1984 fix(snap): check if LXD is actually installed | charmcraft | merged | Merged fix updating configure and remove hooks to verify LXD installation before proceeding. Prevents unwanted LXD snap installations on Ubuntu that cause delays. Approved by two reviewers, passed CI, and resolves #1982. |