Bug 2057472

Summary: pyanaconda.modules.common.errors.installation.SubscriptionTokenTransferError: RHSM entitlement keys (from /etc/pki/entitlement) are missing.
Product: Red Hat Enterprise Linux 9 Reporter: Timothée Ravier <travier>
Component: anacondaAssignee: Martin Kolman <mkolman>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.1CC: jkonecny, jstodola, mkolman
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard: abrt_hash:4658b62fcec65746fe6b356b302741d4cacdc7a51c1277960163771f026f914a;
Fixed In Version: anaconda-34.25.2.7-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2127072 (view as bug list) Environment:
Last Closed: 2023-05-09 07:35:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: anaconda-tb
none
File: anaconda.log
none
File: dbus.log
none
File: dnf.librepo.log
none
File: environ
none
File: hawkey.log
none
File: lorax-packages.log
none
File: lsblk_output
none
File: lvm.log
none
File: nmcli_dev_list
none
File: os_info
none
File: program.log
none
File: storage.log
none
File: syslog
none
File: packaging.log none

Description Timothée Ravier 2022-02-23 12:58:25 UTC
Description of problem:
Standard Workstation installation. Will include further information in a followup comment.

Version-Release number of selected component:
anaconda-34.25.0.26

The following was filed automatically by anaconda:
anaconda 34.25.0.26 exception report
Traceback (most recent call first):
  File "/usr/lib/python3.9/site-packages/dasbus/client/handler.py", line 497, in _handle_method_error
    raise exception from None
  File "/usr/lib/python3.9/site-packages/dasbus/client/handler.py", line 477, in _get_method_reply
    return self._handle_method_error(error)
  File "/usr/lib/python3.9/site-packages/dasbus/client/handler.py", line 444, in _call_method
    return self._get_method_reply(
  File "/usr/lib64/python3.9/site-packages/pyanaconda/modules/common/task/__init__.py", line 46, in sync_run_task
    task_proxy.Finish()
  File "/usr/lib64/python3.9/site-packages/pyanaconda/installation_tasks.py", line 527, in run_task
    sync_run_task(self._task_proxy)
  File "/usr/lib64/python3.9/site-packages/pyanaconda/installation_tasks.py", line 496, in start
    self.run_task()
  File "/usr/lib64/python3.9/site-packages/pyanaconda/installation_tasks.py", line 311, in start
    item.start()
  File "/usr/lib64/python3.9/site-packages/pyanaconda/installation_tasks.py", line 311, in start
    item.start()
  File "/usr/lib64/python3.9/site-packages/pyanaconda/installation_tasks.py", line 311, in start
    item.start()
  File "/usr/lib64/python3.9/site-packages/pyanaconda/installation.py", line 396, in run_installation
    queue.start()
  File "/usr/lib64/python3.9/threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib64/python3.9/site-packages/pyanaconda/threading.py", line 275, in run
    threading.Thread.run(self)
pyanaconda.modules.common.errors.installation.SubscriptionTokenTransferError: RHSM entitlement keys (from /etc/pki/entitlement) are missing.

Additional info:
addons:         com_redhat_kdump, org_fedora_oscap
cmdline:        /usr/bin/python3  /sbin/anaconda
cmdline_file:   BOOT_IMAGE=vmlinuz initrd=initrd.img inst.stage2=hd:LABEL=RHEL-9-1-0-BaseOS-x86_64 quiet
executable:     /sbin/anaconda
hashmarkername: anaconda
kernel:         5.14.0-58.el9.x86_64
product:        Red Hat Enterprise Linux 9
release:        Red Hat Enterprise Linux release 9.1 Beta (Plow)
release_type:   pre-release
type:           anaconda
version:        9.1

Comment 1 Timothée Ravier 2022-02-23 12:58:28 UTC
Created attachment 1862951 [details]
File: anaconda-tb

Comment 2 Timothée Ravier 2022-02-23 12:58:30 UTC
Created attachment 1862952 [details]
File: anaconda.log

Comment 3 Timothée Ravier 2022-02-23 12:58:31 UTC
Created attachment 1862953 [details]
File: dbus.log

Comment 4 Timothée Ravier 2022-02-23 12:58:32 UTC
Created attachment 1862954 [details]
File: dnf.librepo.log

Comment 5 Timothée Ravier 2022-02-23 12:58:34 UTC
Created attachment 1862955 [details]
File: environ

Comment 6 Timothée Ravier 2022-02-23 12:58:36 UTC
Created attachment 1862956 [details]
File: hawkey.log

Comment 7 Timothée Ravier 2022-02-23 12:58:37 UTC
Created attachment 1862957 [details]
File: lorax-packages.log

Comment 8 Timothée Ravier 2022-02-23 12:58:39 UTC
Created attachment 1862958 [details]
File: lsblk_output

Comment 9 Timothée Ravier 2022-02-23 12:58:40 UTC
Created attachment 1862959 [details]
File: lvm.log

Comment 10 Timothée Ravier 2022-02-23 12:58:42 UTC
Created attachment 1862960 [details]
File: nmcli_dev_list

Comment 11 Timothée Ravier 2022-02-23 12:58:43 UTC
Created attachment 1862961 [details]
File: os_info

Comment 12 Timothée Ravier 2022-02-23 12:58:45 UTC
Created attachment 1862962 [details]
File: program.log

Comment 13 Timothée Ravier 2022-02-23 12:58:47 UTC
Created attachment 1862963 [details]
File: storage.log

Comment 14 Timothée Ravier 2022-02-23 12:58:48 UTC
Created attachment 1862964 [details]
File: syslog

Comment 15 Timothée Ravier 2022-02-23 12:58:50 UTC
Created attachment 1862965 [details]
File: packaging.log

Comment 16 Timothée Ravier 2022-02-23 13:00:27 UTC
I registered this system using a personal free developer Red Hat account during the installation process, which might be the source of this issue.

Comment 17 Timothée Ravier 2022-02-23 15:07:55 UTC
I tried again without registering my system during the installation and it worked this I highly suspect that the bug is in this part.

Comment 18 Jiri Konecny 2022-03-04 10:51:36 UTC
Hi Martin, could you please take a look on this?

Comment 19 Martin Kolman 2022-03-18 18:11:16 UTC
(In reply to Timothée Ravier from comment #16)
> I registered this system using a personal free developer Red Hat account
> during the installation process, which might be the source of this issue.

So I've tried the same - using a free developer account on a latest RHEL 9 nightly image and all worked fine. Anaconda version on the image I used: 34.25.0.28

There have been some subscription related fixes in anaconda 34.25.0.27 & it now requires a new subscription-manager version which was released in the meantime.

So it might been either a subscription infra hiccup or possibly something that was fixed by the anaconda or subscription manager changes.

Could you perhaps try again using the same account on a newer installation image with anaconda >= 34.25.0.28 ? Anaconda version can be easily seen on the TTY1 once the installation image is booted. Thanks in advance! :)

Comment 20 Jiri Konecny 2022-03-24 13:04:36 UTC
Thanks a lot Martin for testing this.

Jan based on comment 19 this seems to be already resolved. Do you or the reporter want to do re-testing of this issue before we will close it?

Comment 21 Jan Stodola 2022-03-24 13:10:39 UTC
Timothée,
can you please confirm if you are still able to reproduce this bug using RHEL-9.1, RHEL-9.0 and/or RHEL-8.5?
If the problem still exists, could you please install the system without registering during the installation process, register the system after the system is installed and check if you are able to install any package from CDN? I just want to understand better if the problem is in anaconda, subscription-manager, or if the account is miss-configured somehow.

Comment 22 Timothée Ravier 2022-04-19 16:55:07 UTC
Will be doing a new installation to verify this is fixed.

Comment 23 Timothée Ravier 2022-04-19 17:40:34 UTC
I've completed an installation with 34.25.1.1-1 nd I've got the same issue. Will make an install without registering.

Comment 24 Timothée Ravier 2022-04-19 18:25:21 UTC
I've done a new installation and registered the system later and did not have errors during installation. I can not get a subscription working but this is maybe because I'm used the beta repos for installation?
I've also realized that my developer subscription had expired when I tried re-installing again. This might be part of the issue. However, failing before the installation is started would be better than after in this case if this is the real issue.

Comment 25 Jan Stodola 2022-05-18 15:15:43 UTC
Martine,
do you know if it's possible to detect an expired subscription? I would assume that it is not possible to register and use the CDN repository with an expired subscription at all... I do not have any expired subscription to confirm the behavior.

Comment 26 Martin Kolman 2022-05-27 14:41:26 UTC
(In reply to Jan Stodola from comment #25)
> Martine,
> do you know if it's possible to detect an expired subscription? I would
> assume that it is not possible to register and use the CDN repository with
> an expired subscription at all... I do not have any expired subscription to
> confirm the behavior.

So looking at the logs & comments I think this is what happens:

- a valid Red Hat account is used
- but the account does not have any subscriptions that can be attached
- a DVD installation image is used, so CDN is not required for the installation, which would need a valid subscription and would uncover something is wrong earlier

On a timeline:

1) user registers, username and password is valid
2) auto-attach runs - and succeeds in attaching 0 subscriptions (!)
3) installation is started from the package repo on the DVD
4) then when Anaconda attempts to transfer the subscription related certificates (so that the subscription can be used also after installation) it crashes as there are no certificates due to 0 subscriptions being attached

To fix this I think we need to better validate if subscription attempt was actually properly successful. I guess we could check if the expected certificates exist & fail installation if they don't, but ideally we should get this information via the RHSM DBus API or even open a RFE/bug for RHSM to fail the attach attempt if there are no valid subscriptions yet account creds are fine.

Comment 27 Jan Stodola 2022-06-21 14:37:02 UTC
*** Bug 2099419 has been marked as a duplicate of this bug. ***

Comment 30 Jan Stodola 2022-09-15 09:34:40 UTC
Also reported as a rhel-8 bug 2127072

Comment 32 Martin Kolman 2023-01-25 14:56:25 UTC
PR: https://github.com/rhinstaller/anaconda/pull/4527

Comment 34 Jan Stodola 2023-02-07 13:10:58 UTC
Tested with anaconda-34.25.2.7-1.el9, it was possible to finish the installation when an account with no subscriptions was used to register the system. The installer displayed an appropriate message.
Tested by manual graphical and kickstart text-mode installations.

Marking as Verified:Tested

Comment 37 Jan Stodola 2023-02-14 12:51:08 UTC
Checked that anaconda-34.25.2.7-1.el9 is in nightly compose RHEL-9.2.0-20230209.13

Moving to VERIFIED

Comment 39 errata-xmlrpc 2023-05-09 07:35:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (anaconda bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2223