← Back to issue list

`charmcraft pack` fails on Resolute

View original Github issue

Metadata

Project
charmcraft
Number
#2816
Type
issue
State
open
Author
jameinel
Labels
—
Created
Updated
Closed
—

Current evaluation

charmcraft pack fails on Ubuntu Resolute 26.04 hosts when using a Jammy 20.04 build base: snapd inside the LXD build instance cannot reload snap-confine AppArmor profiles; no maintainer response yet.

Suggested action: needs triage

Reason: The report is well-evidenced with a concrete repro (`charmcraft pack` on juju-controller with a Jammy base) and container-side logs showing `apparmor_parser: Unable to replace "/usr/lib/snapd/snap-confine". Profile doesn't conform to protocol`, but it has zero comments, no labels, and no assignee, so it has never been assessed by a maintainer. The root cause appears to sit outside charmcraft (snapd/apparmor_parser inside the LXD instance vs. the host kernel), and the reporter's diagnosis is explicitly speculative ("From some searching..."), so a triage decision on whether this is a charmcraft bug, an unsupported host/base combination, or an upstream snapd/LXD matter is still needed. Repository inspection was not possible (tools returned "No pinned SHA available for project 'charmcraft'"), which caps confidence.

Evaluated by: mr-cal-bot

Impact: 55 Quick Win: 11 Complexity: 68 Confidence: 60 Actionability: 63

Issue body

### Check existing issues - [x] I've verified that this bug isn't described by any existing issues. ### Bug description It seems that there is an app-armor conflict between a Jammy container and a Resolute host when trying to `charmcraft pack`. When running I get this failure from charmcraft: ``` I'm trying to build the juju-controller charm, which wants a Jammy container. I just did ``` charmcraft pack ``` Using charmcraft 3. ### Steps to reproduce ``` git clone https://github.com/juju/juju-controller cd juju-controller sudo snap install charmcraft --classic --channel 3.x/stable charmcraft pack ``` Fails with: ``` charmcraft pack Failed to enable snapd service. * Command that failed: 'lxc --project charmcraft exec local:base-instance-charmcraft-buildd-base-v7--20d64a5acd5c317c9c8d -- env CRAFT_MANAGED_MODE=1 CHARMCRAFT_MANAGED_MODE=1 DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true DEBIAN_PRIORITY=critical systemctl restart snapd.service' * Command exit code: 1 * Command standard error output: b'Job for snapd.service failed because the control process exited with error code.\nSee "systemctl status snapd.service" and "journalctl -xe" for details.\n' Full execution log: '/home/jameinel/.local/state/charmcraft/log/charmcraft-20260807-123357.396086.log' ``` Using lxc to investigate the container, I see this failure: ``` -- The unit tmp-syscheck\x2dmountpoint\x2d1453099174.mount has successfully entered the 'dead' state. Aug 07 16:24:53 charmcraft-juju-controller-ubuntu-2004-amd64-4074305 snapd[3063]: daemon.go:353: adjusting startup timeout by 30s (pessimistic estimate of 30s plus 5s pe r snap) Aug 07 16:24:53 charmcraft-juju-controller-ubuntu-2004-amd64-4074305 snapd[3063]: backends.go:58: AppArmor status: apparmor is enabled and all features are available Aug 07 16:24:53 charmcraft-juju-controller-ubuntu-2004-amd64-4074305 snapd[3063]: cannot run daemon: state startup errors: [cannot reload snap-confine apparmor profile: cannot load apparmor profiles: exit status 185 Aug 07 16:24:53 charmcraft-juju-controller-ubuntu-2004-amd64-4074305 snapd[3063]: apparmor_parser output: Aug 07 16:24:53 charmcraft-juju-controller-ubuntu-2004-amd64-4074305 snapd[3063]: /sbin/apparmor_parser: Unable to replace "mount-namespace-capture-helper". Profile doe sn't conform to protocol Aug 07 16:24:53 charmcraft-juju-controller-ubuntu-2004-amd64-4074305 snapd[3063]: /sbin/apparmor_parser: Unable to replace "/usr/lib/snapd/snap-confine". Profile doesn' t conform to protocol Aug 07 16:24:53 charmcraft-juju-controller-ubuntu-2004-amd64-4074305 snapd[3063]: ] Aug 07 16:24:53 charmcraft-juju-controller-ubuntu-2004-amd64-4074305 systemd[1]: snapd.service: Main process exited, code=exited, status=1/FAILUR E -- Subject: Unit process exited -- Defined-By: systemd -- Support: http://www.ubuntu.com/support -- -- An ExecStart= process belonging to unit snapd.service has exited. -- -- The process' exit code is 'exited' and its exit status is 1. Aug 07 16:24:53 charmcraft-juju-controller-ubuntu-2004-amd64-4074305 systemd[1]: snapd.service: Failed with result 'exit-code'. ``` From some searching "profile doesn't conform to protocol" seems that Jammy AppArmor is not compatible with Resolute. ### Environment Host is Ubuntu Resolute 26.04, container is Jammy 20.04. ### charmcraft.yaml ```yaml If the issue is specific to a project, share its `charmcraft.yaml`. This field automatically renders as YAML, so you don't need to add special formatting. ``` ### Log output ```shell -- Subject: A start job for unit snapd.service has begun execution -- Defined-By: systemd -- Support: http://www.ubuntu.com/support -- -- A start job for unit snapd.service has begun execution. -- -- The job identifier is 1492. Aug 07 16:24:53 charmcraft-juju-controller-ubuntu-2004-amd64-4074305 snapd[3063]: overlord.go:274: Acquiring state lock file Aug 07 16:24:53 charmcraft-juju-controller-ubuntu-2004-amd64-4074305 snapd[3063]: overlord.go:279: Acquired state lock file Aug 07 16:24:53 charmcraft-juju-controller-ubuntu-2004-amd64-4074305 snapd[3063]: daemon.go:250: started snapd/2.67.1+20.04 (series 16; classic) ubuntu/20.04 (amd64) lin ux/7.0.0-29-generic. Aug 07 16:24:53 charmcraft-juju-controller-ubuntu-2004-amd64-4074305 systemd[1]: tmp-syscheck\x2dmountpoint\x2d1453099174.mount: Succeeded. -- Subject: Unit succeeded -- Defined-By: systemd -- Support: http://www.ubuntu.com/support -- -- The unit tmp-syscheck\x2dmountpoint\x2d1453099174.mount has successfully entered the 'dead' state. Aug 07 16:24:53 charmcraft-juju-controller-ubuntu-2004-amd64-4074305 snapd[3063]: daemon.go:353: adjusting startup timeout by 30s (pessimistic estimate of 30s plus 5s pe r snap) Aug 07 16:24:53 charmcraft-juju-controller-ubuntu-2004-amd64-4074305 snapd[3063]: backends.go:58: AppArmor status: apparmor is enabled and all features are available Aug 07 16:24:53 charmcraft-juju-controller-ubuntu-2004-amd64-4074305 snapd[3063]: cannot run daemon: state startup errors: [cannot reload snap-confine apparmor profile: cannot load apparmor profiles: exit status 185 Aug 07 16:24:53 charmcraft-juju-controller-ubuntu-2004-amd64-4074305 snapd[3063]: apparmor_parser output: Aug 07 16:24:53 charmcraft-juju-controller-ubuntu-2004-amd64-4074305 snapd[3063]: /sbin/apparmor_parser: Unable to replace "mount-namespace-capture-helper". Profile doe sn't conform to protocol Aug 07 16:24:53 charmcraft-juju-controller-ubuntu-2004-amd64-4074305 snapd[3063]: /sbin/apparmor_parser: Unable to replace "/usr/lib/snapd/snap-confine". Profile doesn' t conform to protocol Aug 07 16:24:53 charmcraft-juju-controller-ubuntu-2004-amd64-4074305 snapd[3063]: ] Aug 07 16:24:53 charmcraft-juju-controller-ubuntu-2004-amd64-4074305 systemd[1]: snapd.service: Main process exited, code=exited, status=1/FAILUR E -- Subject: Unit process exited -- Defined-By: systemd -- Support: http://www.ubuntu.com/support -- -- An ExecStart= process belonging to unit snapd.service has exited. -- -- The process' exit code is 'exited' and its exit status is 1. Aug 07 16:24:53 charmcraft-juju-controller-ubuntu-2004-amd64-4074305 systemd[1]: snapd.service: Failed with result 'exit-code'. -- Subject: Unit failed -- Defined-By: systemd -- Support: http://www.ubuntu.com/support -- -- The unit snapd.service has entered the 'failed' state with result 'exit-code'. Aug 07 16:24:53 charmcraft-juju-controller-ubuntu-2004-amd64-4074305 systemd[1]: Failed to start Snap Daemon. ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 55
Quick Win: 11
Complexity: 68
Confidence: 60
Actionability: 63
needs triage charmcraft pack fails on Ubuntu Resolute 26.04 hosts when using a Jammy 20.04 build base: snapd inside the LXD build instance cannot reload snap-confine AppArmor profiles; no maintainer response yet.
stealth/space-bunny-alpha
Impact: 58
Quick Win: 7
Complexity: 78
Confidence: 47
Actionability: 55
needs triage Packing a Jammy-base charm on a Resolute 26.04 host fails: snapd in the build container rejects host AppArmor profiles (apparmor_parser exit 185), so charmcraft cannot enable snapd. Untriaged, no maintainer response; likely upstream snapd/AppArmor incompatibility.
stealth/space-bunny-alpha
Impact: 65
Quick Win: 8
Complexity: 78
Confidence: 89
Actionability: 55
needs triage Packing a Jammy-base charm fails on a Resolute host when snapd in the build container rejects AppArmor profiles, with no maintainer response or resolution yet.
qwen3.6-35b-a3b-mtp-q6
Impact: 50
Quick Win: 20
Staleness: 40
Complexity: 60
Confidence: 70
Support Request: 10
needs triage charmcraft pack fails on Ubuntu Resolute 26.04 host with Jammy container due to AppArmor protocol incompatibility. Untriaged, no maintainer response.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 65
Confidence: 90
Support Request: 15
needs triage charmcraft pack fails on Ubuntu Resolute 26.04 due to AppArmor protocol incompatibility when launching Jammy containers. Unlabelled, awaiting maintainer triage.

Update history

Date Change
created

Related work

  • Related To: charmcraft#1104 (confidence 62%)

    Prior charmcraft issue where `charmcraft pack` failed on a non-LTS Ubuntu host release (Lunar); closed by merged PR #1130 adding non-LTS base support plus an interim-release warning — a likely precedent for how a new-host-release packaging failure gets handled.

Related issues

Issue Project State Summary Similarity
#560 Charmcraft pack is giving error frequently charmcraft closed The failure was traced to external LXD networking blocking access to archive.ubuntu.com during snapd installation; no Charmcraft fix was merged, and the reported firewall workaround did not help.
75%
#92 Suddenly getting charmcraft internal error with charmcraft pack craft-providers closed Resolved upstream in LXD 4.23 revision 22525+, which corrected overly strict device-name validation; `snap revert lxd` was a temporary workaround.
73%
#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.
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.
72%
#2631 Multiple `charmcraft pack` fail on mismatching platforms charmcraft open Consecutive charmcraft pack runs with different platform sets fail: second charm (24.04 only) launches a 22.04 instance and errors 'Platform not found'. Regression from 4.0.1, still present in 4.3.1, no maintainer response.
70%
#388 Charmcraft pack cannot run in a CI? charmcraft closed charmcraft's strictly-confined snap blocked CI builds (pip deps install failing). Fixed by switching the snap to classic confinement (PR #288, commit d49e85e3); reporter confirmed the edge classic snap resolved their CI.
70%
#2107 lxc - Missing source path "/root/snap/charmcraft/common/cache/charmcraft/charmcraft-buildd-base-v7/BuilddBaseAlias.JAMMY/pip" charmcraft open Charmcraft pack fails in LXD clusters when the shared cache directory is missing on the node hosting the instance. Maintainer acknowledged unsupported scenario, provided workarounds, and filed internal ticket CRAFT-4039.
70%
#1202 `charmcraft` installs newer version in LXC container & doesn't respect pinned snap revision charmcraft closed Automatic LXC snap refreshes were fixed in PR #1219 by upgrading craft-providers and adding a regression test verifying that refreshes remain held forever.
70%