canonical / canonical/cloud-init

subscription-manager attach and attach-auto deprecated on RHEL

Open
#6,480 7 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Python
Stars
3.8k
Forks
1.1k
Avg merge
2d 23h
Merged PRs (30d)
18

Description

# Bug report

At least with subscription-manager version 1.30.10, attach and attach-auto dissapear

```
$ sudo subscription-manager version
server type: Red Hat Subscription Management
subscription management server: Unknown
subscription management rules: Unknown
subscription-manager: 1.30.10-1.el10
```

```
$ sudo subscription-manager --help
Usage: subscription-manager MODULE-NAME [MODULE-OPTIONS] [--help]

Primary Modules:

list List subscription and product information for this system
refresh Pull the latest subscription data from the server
register Register this system to the Customer Portal or another subscription management service
release Configure which operating system release to use
status Show status information for this system
unregister Unregister this system from the Customer Portal or another subscription management service

Other Modules:

clean Remove all local system and subscription data without affecting the server
config List, set, or remove the configuration parameters in use by this system
environments Display the environments available for a user
facts View or update the detected system information
identity Display the identity certificate for this system or request a new one
orgs Display the organizations against which a user can register a system
plugins View and configure with 'subscription-manager plugins'
repo-override Manage custom content repository settings
repos List the repositories which this system is entitled to use
syspurpose Convenient module for managing all system purpose settings
version Print version information
```

Red Hat has moved all the customer to use Simple Content Access (SCA) henceforth you don't have to attach any subscription to any system, just register the system and enable the required repositories.

## Steps to reproduce the problem
Using auto-attach = true fails, but I'm unsure how to register repos, just with attach-auto = false (or not setting at all)

running instance has repos configured, but GPG failed

```
$ sudo yum install -y tree
Updating Subscription Management repositories.
Last metadata expiration check: 0:08:24 ago on Sat Sep 20 22:27:54 2025.
Dependencies resolved.
===============================================================================================================================================================================================================================================
Package Architecture Version Repository Size
===============================================================================================================================================================================================================================================
Installing:
tree x86_64 2.1.0-8.el10 baseos 56 k

Transaction Summary
===============================================================================================================================================================================================================================================
Install 1 Package

Total download size: 56 k
Installed size: 108 k
Downloading Packages:
tree-2.1.0-8.el10.x86_64.rpm 1.8 MB/s | 56 kB 00:00
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 1.8 MB/s | 56 kB 00:00
Package tree-2.1.0-8.el10.x86_64.rpm is not signed
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'yum clean packages'.
Error: GPG check FAILED
```

## Environment details
- Cloud-init version: 24.4
- Operating System Distribution: RHEL 10.1
- Cloud provider, platform or installer type: openstack

## cloud-init logs
```
The yum/dnf plugins: /etc/dnf/plugins/subscription-manager.conf, /etc/dnf/plugins/product-id.conf were automatically enabled for the benefit of Red Hat Subscription Management. If not desired, use "subscription-manager config --rhsm.auto_enable_yum_plugins=0" to block this behavior.
2025-09-18 12:51:23,312 - subp.py[DEBUG]: Running command ['subscription-manager', 'attach', '--auto'] with allowed return codes [0] (shell=False, capture=True)
2025-09-18 12:51:23,743 - performance.py[DEBUG]: Running ['subscription-manager', 'attach', '--auto'] took 0.431 seconds
2025-09-18 12:51:23,744 - cc_rh_subscription.py[WARNING]: Auto-attach failed with: Unexpected error while running command.
Command: ['subscription-manager', 'attach', '--auto']
Exit code: 1
Reason: -
Stdout: Usage: subscription-manager MODULE-NAME [MODULE-OPTIONS] [--help]

Primary Modules:

list List subscription and product information for this system
refresh Pull the latest subscription data from the server
register Register this system to the Customer Portal or another subscription management service
release Configure which operating system release to use
status Show status information for this system
unregister Unregister this system from the Customer Portal or another subscription management service

Other Modules:

clean Remove all local system and subscription data without affecting the server
config List, set, or remove the configuration parameters in use by this system
environments Display the environments available for a user
facts View or update the detected system information
identity Display the identity certificate for this system or request a new one
orgs Display the organizations against which a user can register a system
plugins View and configure with 'subscription-manager plugins'
repo-override Manage custom content repository settings
repos List the repositories which this system is entitled to use
syspurpose Convenient module for managing all system purpose settings
version Print version information
Stderr:
2025-09-18 12:51:23,744 - cc_rh_subscription.py[WARNING]: Setting auto-attach failed
2025-09-18 12:51:23,744 - cc_rh_subscription.py[WARNING]: rh_subscription plugin did not complete successfully
2025-09-18 12:51:23,744 - handlers.py[DEBUG]: finish: modules-config/config-rh_subscription: SUCCESS: config-rh_subscription ran successfully and took 4.346 seconds
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.