snapcraft icon indicating copy to clipboard operation
snapcraft copied to clipboard

UA token builds are no longer supported for `base: core24` snaps

Open dilyn-corner opened this issue 8 months ago • 10 comments

Bug Description

When building a base: core24 snap with snapcraft --ua-token <token>, an error message is emitted:

Error: unrecognized arguments: --ua-token

No error is emitted when using the environment variable instead.

No reference to Ubuntu Advantage, UA, or Pro exists in any of the help text options of snapcraft (that I have tried) in core24 projects, but is still visible in core22 projects. Indeed, several flags are missing for core24 projects, such as --enable-experimental-plugins.

To Reproduce

Install snapcraft 8.x (tested revisions 12000 and 12024) and attempt to build the provided snapcraft.yaml with and without --ua-token <token> or with SNAPCRAFT_UA_TOKEN=<token> set and unset.

Environment

Ubuntu 23.10, building with --use-lxd.

snapcraft.yaml

name: my-snap-name # you probably want to 'snapcraft register <name>'
base: core22 # the base snap is the execution environment for this snap
version: '0.1' # just for humans, typically '1.2+git' or '1.3.2'
summary: Single-line elevator pitch for your amazing snap # 79 char long summary
description: |
  This is my-snap's description. You have a paragraph or two to tell the
  most important story about your snap. Keep it under 100 words though,
  we live in tweetspace and your description wants to look good in the snap
  store.

grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots

parts:
  my-part:
    # See 'snapcraft plugins'
    plugin: nil

Relevant log output

Building the aforementioned snap with `base: core22` yields:

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: [email protected]
:: Subscription: Ubuntu Pro - free personal subscription


No such output is observed with `base: core24`

Additional context

ubuntu-advantage-tools is not installed in the container. Installing it and checking pro status yields:

snapcraft-gotop-on-amd64-for-amd64-131222 ../project# pro status
SERVICE          AVAILABLE  DESCRIPTION
anbox-cloud      yes        Scalable Android in the cloud
esm-apps         yes        Expanded Security Maintenance for Applications
esm-infra        yes        Expanded Security Maintenance for Infrastructure
landscape        yes        Management and administration tool for Ubuntu
livepatch        yes        Canonical Livepatch service
realtime-kernel  yes        Ubuntu kernel with PREEMPT_RT patches integrated

For a list of all Ubuntu Pro services, run 'pro status --all'

This machine is not attached to an Ubuntu Pro subscription.
See https://ubuntu.com/pro

dilyn-corner avatar Jun 25 '24 06:06 dilyn-corner