← Back to issue list

`SNAPCRAFT_UA_TOKEN` does not work on `base: core24`

View original Github issue

Metadata

Project
snapcraft
Number
#6140
Type
issue
State
open
Author
dilyn-corner
Labels
Status: Triaged Type: Bug
Created
Updated
Closed

Current evaluation

SNAPCRAFT_UA_TOKEN is ignored for base: core24 managed builds, so ESM archives are unavailable; triaged, and current code/docs intentionally use host Pro token with --pro for core24+ instead of the legacy UA token.

Suggested action: close not a bug

Reason: Current core24+ code in snapcraft/commands/lifecycle.py explicitly warns "Ignoring the 'SNAPCRAFT_UA_TOKEN' environment variable. The Pro token attached to the host will be used instead" and errors on --ua-token, and the 9.1 release notes deprecate ua-services for core24+ in favor of the new --pro=<services> option documented in pack-a-pro-snap.rst. The reported behavior is the intended design: core24+ Pro builds attach the host's Pro token rather than an env-var token, so the user's expectation of SNAPCRAFT_UA_TOKEN working on core24 is not supported; the supported path is a Pro-attached host plus --pro=esm-apps,esm-infra.

Impact: 50 Quick Win: 30.0 Staleness: 55 Complexity: 40 Confidence: 70 Support Request: 30

Issue body

### Check existing issues - [x] I've verified that this bug isn't described by any existing issues. ### Bug description Describe the bug, including any relevant context or screenshots. When attempting to perform a build of a snap and setting `SNAPCRAFT_UA_TOKEN=<token>` to use any available ESM packages via an Ubuntu Pro subscription, the managed build environment never becomes pro-attached and as such the ESM archive is not available for fetching build or stage packages. A few workarounds may exist, including -- 1) Something the [ROS folx do](https://github.com/canonical/ros-content-sharing-snaps/blob/main/.github/workflows/monthly-builds-esm.yaml#L73-L124) in their CI 2) Pro-attaching the host LXD via [this](https://documentation.ubuntu.com/lxd/stable-5.21/howto/instances_ubuntu_pro_attach/) 3) Managing my own container and manually pro-attaching it, then building snaps there with `--destructive-mode` ### Steps to reproduce Provide step-by-step instructions to reproduce the bug. - Install snapcraft 8.x (tested on latest/edge) - Set `SNAPCRAFT_PRO_TOKEN=<token>` to a token available to you on ubuntu.com/pro - Attempt to build a snap with `snapcraft pack --use-lxd` Notice that no Pro attachment or entitlement messages appear in the build log, `pro` is not available in the container, and no ESM archives are added to a sources file. ### Environment Snapcraft 8.x on Ubuntu 25.10, building with `--use-lxd`. Reproduced on a variety of other environments, including CI. ### snapcraft.yaml This issue is not snap specific; the boilerplate would be sufficient. ### Log output ```shell dilyn …/core-nas/immich  24 $?  pro status No Ubuntu Pro services are available to this system. For a list of all Ubuntu Pro services, run 'pro status --all' Enable services with: pro enable <service> Account: dilyn.corner@canonical.com Subscription: Ubuntu Pro - free personal subscription dilyn …/core-nas/immich  24 $?  echo $SNAPCRAFT_UA_TOKEN xxx dilyn …/core-nas/immich  24 $? 2s  snapcraft pack --use-lxd Starting snapcraft, version 8.14.4 Logging execution to '/home/dilyn/.local/state/snapcraft/log/snapcraft-20260330-143313.446827.log' Launching managed ubuntu 24.04 instance... Creating new instance from remote Creating new base instance from remote Creating new instance from base instance Starting instance Starting snapcraft, version 8.14.4 Logging execution to '/tmp/snapcraft.log' Refreshing repositories Package repositories installed Initializing lifecycle Installing build-packages Interrupted. Failed to run snapcraft in instance Full execution log: '/home/dilyn/.local/state/snapcraft/log/snapcraft-20260330-143313.446827.log' ⏎ ``` Compared to a working attempt (`base: core22`): ```shell dilyn …/core-nas/immich  22 $!?  snapcraft pack --use-lxd Starting snapcraft, version 8.14.4 Logging execution to '/home/dilyn/.local/state/snapcraft/log/snapcraft-20260330-143440.559838.log' Skipping build-on: arm64 build-for: ['arm64'] because build-on doesn't match host arch: amd64 Running on amd64 for amd64 '--enable-manifest' is deprecated, and will be removed in core24. Launching instance... Starting instance Starting snapcraft, version 8.14.4 Logging execution to '/tmp/snapcraft.log' Skipping build-on: arm64 build-for: ['arm64'] because build-on doesn't match host arch: amd64 Running on amd64 for amd64 Initializing parts lifecycle Attaching specified UA token... Attach UA token :: Enabling Ubuntu Pro: ESM Apps :: Ubuntu Pro: ESM Apps enabled :: Enabling Ubuntu Pro: ESM Infra :: Ubuntu Pro: ESM Infra enabled :: This machine is now attached to 'Ubuntu Pro - free personal subscription' :: :: SERVICE ENTITLED STATUS DESCRIPTION :: anbox-cloud yes disabled Scalable Android in the cloud :: esm-apps yes enabled Expanded Security Maintenance for Applications :: esm-infra yes enabled Expanded Security Maintenance for Infrastructure :: fips-preview yes disabled Preview of FIPS crypto packages undergoing certification with NIST :: fips-updates yes disabled FIPS compliant crypto packages with stable security updates :: usg yes disabled Security compliance and audit tools :: :: NOTICES :: Operation in progress: pro attach :: :: For a list of all Ubuntu Pro services, run 'pro status --all' :: Enable services with: pro enable <service> :: :: Account: dilyn.corner@canonical.com :: Subscription: Ubuntu Pro - free personal subscription Attached specified UA token Installing package repositories... ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 50
Quick Win: 30.0
Staleness: 55
Complexity: 40
Confidence: 70
Support Request: 30
close not a bug SNAPCRAFT_UA_TOKEN is ignored for base: core24 managed builds, so ESM archives are unavailable; triaged, and current code/docs intentionally use host Pro token with --pro for core24+ instead of the legacy UA token.
qwen/qwen3.6-35b-a3b
Staleness: 60
Complexity: 50
Confidence: 85
Support Request: 5
keep open SNAPCRAFT_UA_TOKEN fails to attach Ubuntu Pro or ESM archives when building with base: core24 and --use-lxd, unlike core22. Currently triaged and awaiting investigation.
qwen3.6-35b-a3b-mtp-q6
Staleness: 60
Complexity: 60
Confidence: 85
Support Request: 5
keep open SNAPCRAFT_UA_TOKEN fails to attach Ubuntu Pro/ESM when building with base: core24 and --use-lxd. Triaged bug awaiting investigation.
qwen3.6-35b-a3b-mtp-q6
Staleness: 60
Complexity: 50
Confidence: 90
Support Request: 5
keep open SNAPCRAFT_UA_TOKEN fails to attach Ubuntu Pro or enable ESM repositories when building with base core24 in managed LXD. The pro command and ESM sources are missing. Triaged bug, open 77 days, awaiting assignment.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/snapcraft#6337 (confidence 75%)

    Commit 62417a9a7 'feat: error on ua-services for core24+ (#6337)' is part of the same core24 Pro redesign that supersedes the legacy UA token path.

  • Related To: canonical/snapcraft#6308 (confidence 70%)

    Commit 84f97242e 'feat: deprecate ua-services key for core24+ (#6308)' documents the migration from UA token mechanism to --pro for core24+.

Related issues

Issue Project State Summary Similarity
#4874 UA token builds are no longer supported for `base: core24` snaps snapcraft closed The --ua-token flag remains unsupported for core24 snaps. Core24 builds will instead use Pro LXD containers as a replacement. The issue is closed as a deferred enhancement while the new container approach is developed.
76%