← Back to issue list

`charmcraft clean` doesn't clean

View original Github issue

Metadata

Project
charmcraft
Number
#1338
Type
issue
State
closed
Author
sed-i
Labels
—
Created
Updated
Closed

Current evaluation

Closed unresolved: LXD cleanup remained broken in Charmcraft 3, with the changed behavior attributed to craft-application#425, which also closed without a linked fix.

Resolution: closed stale

Reason: The maintainer’s final comment attributed Charmcraft 3’s cleanup failure to canonical/craft-application#425, but that issue was also closed without a resolving PR or commit. Follow-up canonical/charmcraft#2078 remains open.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Bug Description Ran out of space again :) Apparently, `charmcraft clean` does not clean up lxd instances. ### To Reproduce Pack a charm. Try to clean it. ### Environment Ubuntu 22.04.3 LTS Charmcraft 2.4.1 Running inside multipass VM ### charmcraft.yaml ```shell Any, really. E.g.: https://github.com/canonical/catalogue-k8s-operator/blob/main/charm/charmcraft.yaml ``` ### Relevant log output ```shell $ sudo ls /var/snap/lxd/common/lxd/storage-pools/default/containers charmcraft_base-instance-charmcraft-buildd-base-v10-07bde40a62a827cdc5a4 charmcraft_charmcraft-loki-k8s-27208-0-0-amd64 charmcraft_base-instance-charmcraft-buildd-base-v10-689fe40991089812a57b charmcraft_charmcraft-observability-libs-5-0-0-amd64 charmcraft_charmcraft-catalogue-k8s-46963-0-0-amd64 charmcraft_charmcraft-observability-libs-53-0-0-amd64 charmcraft_charmcraft-catalogue-k8s-63191-0-0-amd64 charmcraft_charmcraft-operator-framework-10744-0-0-amd64 charmcraft_charmcraft-flog-k8s-6-0-0-amd64 charmcraft_charmcraft-operator-framework-10791-0-0-amd64 charmcraft_charmcraft-grafana-agent-10907-0-0-amd64 charmcraft_charmcraft-prometheus-k8s-3471-0-0-amd64 charmcraft_charmcraft-grafana-agent-10907-1-0-amd64 charmcraft_charmcraft-self-signed-certificates-5-0-0-amd64 charmcraft_charmcraft-grafana-agent-17985-0-0-amd64 charmcraft_charmcraft-traefik-k8s-61-0-0-amd64 charmcraft_charmcraft-grafana-agent-17985-1-0-amd64 $ charmcraft clean Cleaning project 'catalogue-k8s'. Cleaned project 'catalogue-k8s'. $ sudo ls /var/snap/lxd/common/lxd/storage-pools/default/containers charmcraft_base-instance-charmcraft-buildd-base-v10-07bde40a62a827cdc5a4 charmcraft_charmcraft-loki-k8s-27208-0-0-amd64 charmcraft_base-instance-charmcraft-buildd-base-v10-689fe40991089812a57b charmcraft_charmcraft-observability-libs-5-0-0-amd64 charmcraft_charmcraft-catalogue-k8s-46963-0-0-amd64 charmcraft_charmcraft-observability-libs-53-0-0-amd64 charmcraft_charmcraft-catalogue-k8s-63191-0-0-amd64 charmcraft_charmcraft-operator-framework-10744-0-0-amd64 charmcraft_charmcraft-flog-k8s-6-0-0-amd64 charmcraft_charmcraft-operator-framework-10791-0-0-amd64 charmcraft_charmcraft-grafana-agent-10907-0-0-amd64 charmcraft_charmcraft-prometheus-k8s-3471-0-0-amd64 charmcraft_charmcraft-grafana-agent-10907-1-0-amd64 charmcraft_charmcraft-self-signed-certificates-5-0-0-amd64 charmcraft_charmcraft-grafana-agent-17985-0-0-amd64 charmcraft_charmcraft-traefik-k8s-61-0-0-amd64 charmcraft_charmcraft-grafana-agent-17985-1-0-amd64 ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed stale Closed unresolved: LXD cleanup remained broken in Charmcraft 3, with the changed behavior attributed to craft-application#425, which also closed without a linked fix.
stealth/space-bunny-alpha — closed stale Closed without a fix after a maintainer confirmed cleanup remained broken in Charmcraft 3 and traced the newer failure to craft-application#425; no resolving PR or commit was linked.
stealth/space-bunny-alpha — closed stale Closed without a fix after being attributed to craft-application#425; cleanup still failed in Charmcraft 3, and follow-up charmcraft#2078 remains open.
stealth/space-bunny-alpha — closed stale Closed unresolved: LXD cleanup still failed in Charmcraft 3 and was attributed to craft-application#425, which was also closed without a fix.
stealth/space-bunny-alpha — closed superseded No fix shipped: Charmcraft 3 still left LXD instances behind. Closure deferred the v2 concern to clean-all #1042 and the upstream host-only cleanup defect in craft-application#425.
qwen3.6-35b-a3b-mtp-q6 — — Unresolved. LXD instances persist after running the command. Behavior changed but remains broken in charmcraft 3. Deferred to upstream craft-application issue #425 for resolution.
qwen/qwen3.6-35b-a3b — — Superseded by upstream craft-application issue 425. The charmcraft clean command fails to remove LXD instances, with broken behavior persisting in charmcraft 3. Internally tracked as CRAFT-3254.
qwen/qwen3.6-35b-a3b — — Closed without resolution. The charmcraft clean command fails to remove LXD instances. Resolution is blocked by an upstream craft-application bug, leaving the issue unresolved.
qwen3.6-35b-a3b-mtp-q6 — — Closed without resolution. The charmcraft clean command still fails to remove LXD instances. Behavior changed in v3 but remains broken due to craft-application#425. Superseded by related issue #1042.

Update history

No update history recorded yet.

Related work

  • Caused By: canonical/craft-application#425 (confidence 99%)

    A Charmcraft maintainer explicitly identified this issue as the cause of the changed cleanup behavior in Charmcraft 3.

  • Related To: canonical/charmcraft#1042 (confidence 98%)

    The reporter linked this bug to the broader open proposal for a purge or clean-all command.

  • Related To: canonical/charmcraft#2078 (confidence 95%)

    A later open issue reports that clean still fails to remove instances belonging to all platforms.

Related issues

Issue Project State Summary Similarity
#2078 `charmcraft clean` does not clean all platforms for charm charmcraft open Open, reproducible cleanup bug: charmcraft clean uses current project platforms to derive build instances, leaving containers for removed platforms; no resolving fix is linked.
74%
#660 `charmcraft pack` fails with error writing to lxd unix socket charmcraft closed A transient LXD socket timeout stopped packing; `charmcraft clean` restored operation, the error did not recur, and the reporter closed the report without a code fix.
74%
#1420 fix: use craft-application clean command charmcraft closed PR #1420 (switch clean to craft-application) was closed unmerged, with no matching commit in charmcraft/commands/clean.py history. The same cleanup landed later via merged PR #1571 (commit 053d5a2d), which deleted the redundant clean command.
73%
#1594 Running `charmcraft pack` fails and returns `Instance setup failed. Check LXD logs for more details` charmcraft closed Closed as an environment conflict, not a Charmcraft defect: Docker had changed networking in a way that interfered with LXD, and the reporter confirmed that uninstalling Docker and restarting fixed it.
73%
#511 `charmcraft pack` fails running `apt update` charmcraft closed Closed with no Charmcraft code change: maintainers determined the `apt update` failure came from a broken host/LXD (fan bridge) networking setup, not a Charmcraft bug; guidance posted to Charmhub Discourse and the LXD forum.
73%
#506 Build a charmed failed charmcraft closed LXD 3.x lacked project support causing 'unknown flag: --project'. No Charmcraft fix; maintainers asked for lxc/os info (Aug 2021), reporter never replied, issue closed stale Jan 2024.
71%
#2795 docs: improve `charmcraft clean` command documentation charmcraft closed Closed unmerged; maintainer @lengau rejected the proposed charmcraft clean documentation as subpar, and no documentation commit or replacement PR landed.
71%
#746 `charmcraft pack` for existing environment does not remove files that have been deleted charmcraft closed Closed as a duplicate of charmcraft#710 by maintainer facundobatativa (facundobatista) on 2022-04-13. #710 remains open, with the root cause tracked upstream in craft-parts#851.
71%
#646 Failed to inject host Charmcraft snap into target environment charmcraft closed Report of charmcraft 1.4.0 failing to inject the host snap into the LXD build env. Closed without a code fix: a user fixed it with `charmcraft clean --verbose` and lengau closed it in Jan 2024 as not reproducible on current versions.
71%
#736 `charmcraft` lxc container starts failing with `FileNotFoundError` during iterative design charmcraft closed Closed as unreproducible on Charmcraft 2.7/3; the maintainer requested a current reproducer. No fix PR or commit was linked.
70%