Bug 2001476
Summary: | 'str' object has no attribute 'decode' When register RHEL-8.5.0-20210902.5 against Satellite6.8/Satellite6.9/Satellite6.10 by bootstrap.py | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | qianzhan |
Component: | Bootstrap | Assignee: | Evgeni Golov <egolov> |
Status: | CLOSED ERRATA | QA Contact: | Stephen Wadeley <swadeley> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.10.0 | CC: | egolov, hhorak, mmccune, mvanderw, saydas, sraut, zhunting |
Target Milestone: | 6.10.0 | Keywords: | Triaged |
Target Release: | Unused | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2021-11-16 14:13:42 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
qianzhan
2021-09-06 08:11:00 UTC
This bug happens on Satellite6.8, Satellite6.9 and Satellite6.10: https://main-jenkins-csb-rhsmintegration.apps.ocp4.prod.psi.redhat.com/job/rhsm-integration-runtest/241/testReport/tests.cli.test_basic_subscription/TestBasicSubscription/test_registration_with_bootstrap_script/ https://main-jenkins-csb-rhsmintegration.apps.ocp4.prod.psi.redhat.com/job/rhsm-integration-runtest/243/testReport/tests.cli.test_basic_subscription/TestBasicSubscription/test_registration_with_bootstrap_script/ https://main-jenkins-csb-rhsmintegration.apps.ocp4.prod.psi.redhat.com/job/rhsm-integration-runtest/242/testReport/tests.cli.test_basic_subscription/TestBasicSubscription/test_registration_with_bootstrap_script/ Hey, thanks for the report! Would you have the bandwidth to test the patch in https://github.com/Katello/katello-client-bootstrap/pull/348? THanks! (In reply to Evgeni Golov from comment #2) > Hey, > > thanks for the report! > > Would you have the bandwidth to test the patch in > https://github.com/Katello/katello-client-bootstrap/pull/348? > > THanks! 1. Try bootstrap.py before any changes: [root@hpe-dl380pgen8-02-vm-1 ~]# grep "p_name = package" -A10 bootstrap.py p_name = package['name'].decode('ascii') p_version = package['version'].decode('ascii') if rpm.labelCompare(('0', p_version, '1'), required_version) < 0: err = "%s %s is too old" % (p_name, p_version) else: err = None return (err is None, err) def setup_yum_repo(url, gpg_key): [root@hpe-dl380pgen8-02-vm-1 ~]# [root@hpe-dl380pgen8-02-vm-1 ~]# grep "package_name = package" -A10 bootstrap.py package_name = package['name'].decode('ascii') if package_name in rpm_sat: print_error("%s RPM found. bootstrap.py should not be used on a Katello/Spacewalk/Satellite host." % (package_name)) sys.exit(1) def prepare_rhel5_migration(): """ Execute specific preparations steps for RHEL 5. Older releases of RHEL 5 did not have a version of rhn-classic-migrate-to-rhsm which supported activation keys. This function allows those systems to get a proper [root@hpe-dl380pgen8-02-vm-1 ~]# python3 /root/bootstrap.py --login=admin --password=admin --server=ent-01-vm-03.lab.eng.nay.redhat.com --location='Default Location' --organization='Default Organization' --hostgroup=hg --activationkey=RH00069_key --add-domain --force Foreman Bootstrap Script This script is designed to register new systems or to migrate an existing system to a Foreman server with Katello Traceback (most recent call last): File "/root/bootstrap.py", line 1334, in <module> check_rpm_installed() File "/root/bootstrap.py", line 1018, in check_rpm_installed package_name = package['name'].decode('ascii') AttributeError: 'str' object has no attribute 'decode' [root@hpe-dl380pgen8-02-vm-1 ~]# 2. Change the bootstrap.py according to Comment 2: [root@hpe-dl380pgen8-02-vm-1 ~]# grep "p_name = package" -A10 bootstrap.py #p_name = package['name'].decode('ascii') #p_version = package['version'].decode('ascii') try: p_name = package['name'].decode('ascii') p_version = package['version'].decode('ascii') except AttributeError: p_name = package['name'] p_version = package['version'] if rpm.labelCompare(('0', p_version, '1'), required_version) < 0: err = "%s %s is too old" % (p_name, p_version) else: err = None return (err is None, err) def setup_yum_repo(url, gpg_key): [root@hpe-dl380pgen8-02-vm-1 ~]# grep "package_name = package" -A10 bootstrap.py #package_name = package['name'].decode('ascii') try: package_name = package['name'].decode('ascii') except AttributeError: package_name = package['name'] if package_name in rpm_sat: print_error("%s RPM found. bootstrap.py should not be used on a Katello/Spacewalk/Satellite host." % (package_name)) sys.exit(1) def prepare_rhel5_migration(): """ Execute specific preparations steps for RHEL 5. Older releases of RHEL 5 did not have a version of rhn-classic-migrate-to-rhsm which supported activation keys. This function allows those systems to get a proper 3. Run bootstrap.py after changes in step 2: [root@hpe-dl380pgen8-02-vm-1 ~]# python3 /root/bootstrap.py --login=admin --password=admin --server=ent-01-vm-03.lab.eng.nay.redhat.com --location='Default Location' --organization='Default Organization' --hostgroup=hg --activationkey=RH00069_key --add-domain --force Foreman Bootstrap Script This script is designed to register new systems or to migrate an existing system to a Foreman server with Katello [NOTIFICATION], [2021-09-06 05:49:53], [This system is not registered to RHN. Attempting to register via subscription-manager] [NOTIFICATION], [2021-09-06 05:49:53], [Checking subscription manager prerequisites] [RUNNING], [2021-09-06 05:49:54], [/usr/bin/yum -y remove subscription-manager-gnome] Updating Subscription Management repositories. No match for argument: subscription-manager-gnome No packages marked for removal. Dependencies resolved. Nothing to do. Complete! [SUCCESS], [2021-09-06 05:49:58], [/usr/bin/yum -y remove subscription-manager-gnome], completed successfully. [NOTIFICATION], [2021-09-06 05:49:58], [subscription-manager is installed already. Attempting update] [RUNNING], [2021-09-06 05:49:58], [/usr/bin/yum -y update subscription-manager 'subscription-manager-migration-*'] Updating Subscription Management repositories. Red Hat Enterprise Linux 8 for x86_64 - BaseOS 0.0 B/s | 0 B 00:04 Errors during downloading metadata for repository 'rhel-8-for-x86_64-baseos-beta-rpms': - Curl error (35): SSL connect error for https://ent-01-vm-03.lab.eng.nay.redhat.com/pulp/repos/Default_Organization/Library/content/beta/rhel8/8/x86_64/baseos/os/repodata/repomd.xml [error:1408F10B:SSL routines:ssl3_get_record:wrong version number] Error: Failed to download metadata for repo 'rhel-8-for-x86_64-baseos-beta-rpms': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried [WARNING], [2021-09-06 05:50:07], NON-FATAL: [/usr/bin/yum -y update subscription-manager 'subscription-manager-migration-*'] failed to execute properly. [RUNNING], [2021-09-06 05:50:07], [/usr/bin/yum -y update yum openssl python] Updating Subscription Management repositories. Red Hat Enterprise Linux 8 for x86_64 - BaseOS 0.0 B/s | 0 B 00:01 Errors during downloading metadata for repository 'rhel-8-for-x86_64-baseos-beta-rpms': - Curl error (35): SSL connect error for https://ent-01-vm-03.lab.eng.nay.redhat.com/pulp/repos/Default_Organization/Library/content/beta/rhel8/8/x86_64/baseos/os/repodata/repomd.xml [error:1408F10B:SSL routines:ssl3_get_record:wrong version number] Error: Failed to download metadata for repo 'rhel-8-for-x86_64-baseos-beta-rpms': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried [WARNING], [2021-09-06 05:50:13], NON-FATAL: [/usr/bin/yum -y update yum openssl python] failed to execute properly. [NOTIFICATION], [2021-09-06 05:50:13], [Removing old Katello agent and certs] [RUNNING], [2021-09-06 05:50:13], [/usr/bin/yum -y remove 'katello-ca-consumer-*' katello-agent gofer katello-host-tools katello-host-tools-fact-plugin] Updating Subscription Management repositories. No match for argument: katello-agent No match for argument: gofer No match for argument: katello-host-tools No match for argument: katello-host-tools-fact-plugin Dependencies resolved. ======================================================================================== Package Arch Version Repo Size ======================================================================================== Removing: katello-ca-consumer-ent-01-vm-03.lab.eng.nay.redhat.com noarch 1.0-1 @@System 21 k Transaction Summary ======================================================================================== Remove 1 Package Freed space: 21 k Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Erasing : katello-ca-consumer-ent-01-vm-03.lab.eng.nay.redhat. 1/1 Running scriptlet: katello-ca-consumer-ent-01-vm-03.lab.eng.nay.redhat. 1/1 Verifying : katello-ca-consumer-ent-01-vm-03.lab.eng.nay.redhat. 1/1 Installed products updated. Removed: katello-ca-consumer-ent-01-vm-03.lab.eng.nay.redhat.com-1.0-1.noarch Complete! [SUCCESS], [2021-09-06 05:50:28], [/usr/bin/yum -y remove 'katello-ca-consumer-*' katello-agent gofer katello-host-tools katello-host-tools-fact-plugin], completed successfully. [SUCCESS], [2021-09-06 05:50:28], [Removing /etc/rhsm/ca/katello-server-ca.pem], completed successfully. [NOTIFICATION], [2021-09-06 05:50:28], [System appears to be registered via another entitlement server. Attempting unregister] [NOTIFICATION], [2021-09-06 05:50:28], [Cleaning old yum metadata] [RUNNING], [2021-09-06 05:50:28], [/usr/bin/yum -y clean metadata dbcache] Updating Subscription Management repositories. Cache was expired 119 files removed [SUCCESS], [2021-09-06 05:50:29], [/usr/bin/yum -y clean metadata dbcache], completed successfully. [NOTIFICATION], [2021-09-06 05:50:29], [Unregistering] [RUNNING], [2021-09-06 05:50:29], [/usr/sbin/subscription-manager unregister] Unregistering from: subscription.rhsm.redhat.com:443/subscription Network error. Please check the connection details, or see /var/log/rhsm/rhsm.log for more information. [WARNING], [2021-09-06 05:50:30], NON-FATAL: [/usr/sbin/subscription-manager unregister] failed to execute properly. [RUNNING], [2021-09-06 05:50:30], [/usr/sbin/subscription-manager clean] All local data removed [SUCCESS], [2021-09-06 05:50:31], [/usr/sbin/subscription-manager clean], completed successfully. [NOTIFICATION], [2021-09-06 05:50:31], [Writing custom cURL configuration to allow download via HTTPS without certificate verification] [NOTIFICATION], [2021-09-06 05:50:31], [Retrieving Client CA Certificate RPMs] [RUNNING], [2021-09-06 05:50:31], [rpm -Uvh https://ent-01-vm-03.lab.eng.nay.redhat.com/pub/katello-ca-consumer-latest.noarch.rpm] Retrieving https://ent-01-vm-03.lab.eng.nay.redhat.com/pub/katello-ca-consumer-latest.noarch.rpm Verifying... ######################################## Preparing... ######################################## Updating / installing... katello-ca-consumer-ent-01-vm-03.lab.e######################################## [SUCCESS], [2021-09-06 05:50:34], [rpm -Uvh https://ent-01-vm-03.lab.eng.nay.redhat.com/pub/katello-ca-consumer-latest.noarch.rpm], completed successfully. [NOTIFICATION], [2021-09-06 05:50:34], [Deleting cURL configuration] [SUCCESS], [2021-09-06 05:50:34], [Removing /tmp/tmp17pivcah], completed successfully. [NOTIFICATION], [2021-09-06 05:50:34], [Writing FQDN katello-fact] [RUNNING], [2021-09-06 05:50:45], [Disassociating host id 21 for host hpe-dl380pgen8-02-vm-1.hpe2.lab.eng.bos.redhat.com] [RUNNING], [2021-09-06 05:50:47], [Deleting host id 21 for host hpe-dl380pgen8-02-vm-1.hpe2.lab.eng.bos.redhat.com] [RUNNING], [2021-09-06 05:50:50], [Calling Foreman API to create a host entry associated with the group & org] [SUCCESS], [2021-09-06 05:50:52], [Successfully created host hpe-dl380pgen8-02-vm-1.hpe2.lab.eng.bos.redhat.com], completed successfully. [NOTIFICATION], [2021-09-06 05:50:53], [Calling subscription-manager] [RUNNING], [2021-09-06 05:50:53], [/usr/sbin/subscription-manager config --server.server_timeout=900] [SUCCESS], [2021-09-06 05:50:54], [/usr/sbin/subscription-manager config --server.server_timeout=900], completed successfully. [RUNNING], [2021-09-06 05:50:54], [/usr/sbin/subscription-manager register --org 'Default_Organization' --name 'hpe-dl380pgen8-02-vm-1.hpe2.lab.eng.bos.redhat.com' --activationkey 'RH00069_key' --serverurl=https://ent-01-vm-03.lab.eng.nay.redhat.com:443/rhsm --baseurl=https://ent-01-vm-03.lab.eng.nay.redhat.com/pulp/repos --force] The system has been registered with ID: 3bbfe5c3-a760-4669-9362-f6b22d249f42 The registered system name is: hpe-dl380pgen8-02-vm-1.hpe2.lab.eng.bos.redhat.com Installed Product Current Status: Product Name: Red Hat Enterprise Linux for x86_64 Beta Status: Subscribed [SUCCESS], [2021-09-06 05:51:31], [/usr/sbin/subscription-manager register --org 'Default_Organization' --name 'hpe-dl380pgen8-02-vm-1.hpe2.lab.eng.bos.redhat.com' --activationkey 'RH00069_key' --serverurl=https://ent-01-vm-03.lab.eng.nay.redhat.com:443/rhsm --baseurl=https://ent-01-vm-03.lab.eng.nay.redhat.com/pulp/repos --force], completed successfully. [RUNNING], [2021-09-06 05:51:31], [/usr/bin/systemctl enable rhsmcertd] [SUCCESS], [2021-09-06 05:51:31], [/usr/bin/systemctl enable rhsmcertd], completed successfully. [RUNNING], [2021-09-06 05:51:31], [/usr/bin/systemctl restart rhsmcertd] [SUCCESS], [2021-09-06 05:51:31], [/usr/bin/systemctl restart rhsmcertd], completed successfully. [NOTIFICATION], [2021-09-06 05:51:31], [Installing the Katello Host Tools] [RUNNING], [2021-09-06 05:51:31], [/usr/bin/yum -y install katello-host-tools] Updating Subscription Management repositories. Red Hat Enterprise Linux 8 for x86_64 - BaseOS 0.0 B/s | 0 B 00:04 Errors during downloading metadata for repository 'rhel-8-for-x86_64-baseos-beta-rpms': - Curl error (35): SSL connect error for https://ent-01-vm-03.lab.eng.nay.redhat.com/pulp/repos/Default_Organization/Library/content/beta/rhel8/8/x86_64/baseos/os/repodata/repomd.xml [error:1408F10B:SSL routines:ssl3_get_record:wrong version number] Error: Failed to download metadata for repo 'rhel-8-for-x86_64-baseos-beta-rpms': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried [ERROR], [2021-09-06 05:51:40], EXITING: [/usr/bin/yum -y install katello-host-tools] failed to execute properly. looks like it's working? not sure where the SSL error comes from, but that's certainly a different topic to look into PR was merged 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 (Moderate: Satellite 6.10 Release), 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/RHSA-2021:4702 Created attachment 1849306 [details]
katello-client-bootstrap-1.7.7-1.el7sat.noarch.rpm
*** Satellite 6.9 Hotfix Available *** 1) Download katello-client-bootstrap-1.7.7-1.el7sat.noarch.rpm from this bugzilla to your Satellite 2) Install: # rpm -Uvh katello-client-bootstrap-1.7.7-1.el7sat.noarch.rpm 3) resume operations *** Bug 2046085 has been marked as a duplicate of this bug. *** |