Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2046085

Summary: AttributeError: 'str' object has no attribute 'decode' when run bootstrap.py on RHEL-8.6.0-20220118.5
Product: Red Hat Satellite Reporter: qianzhan
Component: BootstrapAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Stephen Wadeley <swadeley>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.9.7CC: egolov, yanpliu
Target Milestone: Unspecified   
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: 2022-01-31 14:27:59 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 2022-01-26 09:05:10 UTC
Description of problem:
AttributeError: 'str' object has no attribute 'decode' when run bootstrap.py on RHEL-8.6.0-20220118.5

Version-Release number of selected component (if applicable):

candlepin-3.1.28-1.el7sat.noarch
katello-3.18.1-3.el7sat.noarch
tfm-rubygem-katello-3.18.1.46-1.el7sat.noarch
katello-client-bootstrap-1.7.5-1.el7sat.noarch

How reproducible:
always

Steps to Reproduce:
2022-01-26 16:49:08,232 [INFO]: ========== Begin of Running Test Case test_registration_with_bootstrap_script ==========
2022-01-26 16:50:19,831 [INFO]: Command run on: ent-02-vm-02.lab.eng.nay.redhat.com, purpose: check activation-key existence
2022-01-26 16:50:19,831 [INFO]: >>>Remote Run: hammer -u admin -p admin activation-key list --organization-label=Default_Organization
2022-01-26 16:50:26,258 [INFO]: <<<Return Code: 0
2022-01-26 16:50:26,258 [INFO]: <<<Output:
---|-------------|----------------|-----------------------|--------------------------
ID | NAME        | HOST LIMIT     | LIFECYCLE ENVIRONMENT | CONTENT VIEW             
---|-------------|----------------|-----------------------|--------------------------
2  | RH00069_key | 0 of Unlimited | Library               | Default Organization View
---|-------------|----------------|-----------------------|--------------------------

2022-01-26 16:50:26,258 [INFO]: activationkey RH00069_key already exist
2022-01-26 16:50:26,258 [INFO]: Command run on: ent-02-vm-02.lab.eng.nay.redhat.com, purpose: delete activation key
2022-01-26 16:50:26,258 [INFO]: >>>Remote Run: hammer -u admin -p admin activation-key delete --organization-label=Default_Organization --name=RH00069_key
2022-01-26 16:50:31,331 [INFO]: <<<Return Code: 0
2022-01-26 16:50:31,332 [INFO]: <<<Output:
Activation key deleted.

2022-01-26 16:50:31,332 [INFO]: It's successful to delete activation key RH00069_key
2022-01-26 16:50:31,332 [INFO]: Command run on: ent-02-vm-02.lab.eng.nay.redhat.com, purpose: create activation key
2022-01-26 16:50:31,332 [INFO]: >>>Remote Run: hammer -u admin -p admin activation-key create --name=RH00069_key --organization-label=Default_Organization --content-view='Default Organization View' --lifecycle-environment=Library
2022-01-26 16:50:36,863 [INFO]: <<<Return Code: 0
2022-01-26 16:50:36,864 [INFO]: <<<Output:
Activation key created.

2022-01-26 16:50:36,864 [INFO]: It's successful to create activationkey RH00069_key
2022-01-26 16:50:36,864 [INFO]: Command run on: ent-02-vm-02.lab.eng.nay.redhat.com, purpose: get subscription id via hammer
2022-01-26 16:50:36,864 [INFO]: >>>Remote Run: hammer -u admin -p admin subscription refresh-manifest --organization-label=Default_Organization;hammer -u admin -p admin subscription list --organization-label=Default_Organization | grep "Red Hat Beta"
2022-01-26 16:51:18,945 [INFO]: <<<Return Code: 0
2022-01-26 16:51:18,945 [INFO]: <<<Output:
5  | 8ac213ac7e948ea3017e94d058f50d26 | Red Hat Beta Access                                                              | Physical | 12159849 | 6383108 | Self-Support | 2021/12/25 05:00:00 | 2022/12/25 04:59:59 | 10       | 0       
Task 55b8803d-4eb3-4bb3-8ab8-c977923d0d79 running: 0.0/1, 0%, elapsed: 00:00:00
Task 55b8803d-4eb3-4bb3-8ab8-c977923d0d79 running: 0.17/1, 17%, 0.1/s, elapsed: 00:00:02, ETA: 00:00:10
Task 55b8803d-4eb3-4bb3-8ab8-c977923d0d79 running: 0.17/1, 17%, 0.0/s, elapsed: 00:00:04, ETA: 00:00:21
Task 55b8803d-4eb3-4bb3-8ab8-c977923d0d79 running: 0.33/1, 33%, 0.0/s, elapsed: 00:00:07, ETA: 00:00:14
Task 55b8803d-4eb3-4bb3-8ab8-c977923d0d79 running: 0.33/1, 33%, 0.0/s, elapsed: 00:00:10, ETA: 00:00:19
Task 55b8803d-4eb3-4bb3-8ab8-c977923d0d79 running: 0.33/1, 33%, 0.0/s, elapsed: 00:00:13, ETA: 00:00:24
Task 55b8803d-4eb3-4bb3-8ab8-c977923d0d79 running: 0.33/1, 33%, 0.0/s, elapsed: 00:00:16, ETA: 00:00:29
Task 55b8803d-4eb3-4bb3-8ab8-c977923d0d79 running: 0.33/1, 33%, 0.0/s, elapsed: 00:00:18, ETA: 00:01:09
Task 55b8803d-4eb3-4bb3-8ab8-c977923d0d79 running: 0.33/1, 33%, 0.0/s, elapsed: 00:00:21, ETA: 00:01:09
Task 55b8803d-4eb3-4bb3-8ab8-c977923d0d79 running: 0.33/1, 33%, 0.0/s, elapsed: 00:00:23
Task 55b8803d-4eb3-4bb3-8ab8-c977923d0d79 running: 0.5/1, 50%, 0.0/s, elapsed: 00:00:26, ETA: 00:00:43
Task 55b8803d-4eb3-4bb3-8ab8-c977923d0d79 running: 0.83/1, 83%, 0.0/s, elapsed: 00:00:28, ETA: 00:00:05
Task 55b8803d-4eb3-4bb3-8ab8-c977923d0d79 success: 1.0/1, 100%, 0.0/s, elapsed: 00:00:31
Task 55b8803d-4eb3-4bb3-8ab8-c977923d0d79 success: 1.0/1, 100%, 0.0/s, elapsed: 00:00:31

2022-01-26 16:51:18,946 [INFO]: It's successful to get subscription id via hammer
2022-01-26 16:51:18,946 [INFO]: Command run on: ent-02-vm-02.lab.eng.nay.redhat.com, purpose: add sku to activation key
2022-01-26 16:51:18,947 [INFO]: >>>Remote Run: hammer -u admin -p admin activation-key add-subscription --name=RH00069_key --organization-label=Default_Organization --quantity=1 --subscription-id=5
2022-01-26 16:51:25,234 [INFO]: <<<Return Code: 0
2022-01-26 16:51:25,234 [INFO]: <<<Output:
Subscription added to activation key.

2022-01-26 16:51:25,235 [INFO]: It's successful to add sku to activation key
2022-01-26 16:51:25,235 [INFO]: Command run on: ent-02-vm-02.lab.eng.nay.redhat.com, purpose: set activationkey autoattach
2022-01-26 16:51:25,235 [INFO]: >>>Remote Run: hammer -u admin -p admin activation-key update --auto-attach=true --name=RH00069_key --organization-label=Default_Organization
2022-01-26 16:51:31,135 [INFO]: <<<Return Code: 0
2022-01-26 16:51:31,135 [INFO]: <<<Output:
Activation key updated.

2022-01-26 16:51:31,135 [INFO]: Command run on: ent-02-vm-02.lab.eng.nay.redhat.com, purpose: check activationkey autoattach
2022-01-26 16:51:31,135 [INFO]: >>>Remote Run: hammer -u admin -p admin activation-key info --name=RH00069_key --organization-label=Default_Organization
2022-01-26 16:51:36,050 [INFO]: <<<Return Code: 0
2022-01-26 16:51:36,051 [INFO]: <<<Output:
Name:                  RH00069_key
ID:                    3
Description:           
Host Limit:            Unlimited
Auto Attach:           true
Release Version:       
Lifecycle Environment: Library
Content View:          Default Organization View
Host Collections:      

System Purpose:        
    Service Level:  
    Purpose Usage:  
    Purpose Role:   
    Purpose Addons:


2022-01-26 16:51:36,051 [INFO]: It's successful to check activationkey autoattach status: true
2022-01-26 16:51:36,051 [INFO]: Command run on: ent-02-vm-02.lab.eng.nay.redhat.com, purpose: hammer hostgroup list
2022-01-26 16:51:36,052 [INFO]: >>>Remote Run: hammer -u admin -p admin hostgroup list
2022-01-26 16:51:41,651 [INFO]: <<<Return Code: 0
2022-01-26 16:51:41,652 [INFO]: <<<Output:
---|------|-------|------------------|--------------------|------
ID | NAME | TITLE | OPERATING SYSTEM | PUPPET ENVIRONMENT | MODEL
---|------|-------|------------------|--------------------|------
1  | hg   | hg    | RHEL 7           |                    |      
---|------|-------|------------------|--------------------|------

2022-01-26 16:51:41,652 [INFO]: Hostgroup exists, no need to create it.
2022-01-26 16:51:41,652 [INFO]: Command run on: kvm-08-guest29.hv2.lab.eng.bos.redhat.com, purpose: Install bootstrap.py
2022-01-26 16:51:41,653 [INFO]: >>>Remote Run: curl -o /root/bootstrap.py http://ent-02-vm-02.lab.eng.nay.redhat.com/pub/bootstrap.py; chmod +x bootstrap.py
2022-01-26 16:51:53,292 [INFO]: <<<Return Code: 0
2022-01-26 16:51:53,292 [INFO]: <<<Output:
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 71338  100 71338    0     0  49921      0  0:00:01  0:00:01 --:--:-- 49886

2022-01-26 16:51:53,292 [INFO]: It's successful to install bootstrap.py
2022-01-26 16:51:53,292 [INFO]: Command run on: kvm-08-guest29.hv2.lab.eng.bos.redhat.com, purpose: Install bootstrap.py
2022-01-26 16:51:53,292 [INFO]: >>>Remote Run: python3 /root/bootstrap.py --login=admin --password=admin --server=ent-02-vm-02.lab.eng.nay.redhat.com --location='Default Location' --organization='Default Organization' --hostgroup=hg --activationkey=RH00069_key --add-domain --force
2022-01-26 16:52:10,560 [INFO]: <<<Return Code: 1
2022-01-26 16:52:10,561 [INFO]: <<<Output:
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'



Actual results:
AttributeError happens when running bootstrap.

Expected results:
No error happen when running bootstrap.

Additional info:

Comment 1 Evgeni Golov 2022-01-26 14:02:32 UTC
IMHO a dupe of BZ#2001476

Comment 2 Brad Buckingham 2022-01-26 14:19:50 UTC
Hello,

Is this a duplicate of bug 2001476 as mentioned in comment 1?

Thanks!

Comment 3 qianzhan 2022-01-28 02:30:56 UTC
(In reply to Brad Buckingham from comment #2)
> Hello,
> 
> Is this a duplicate of bug 2001476 as mentioned in comment 1?
> 
> Thanks!

Yes, the same issue. But this bug is just existing on Satellite6.9, not sat6.10/sat7.0`

Comment 4 Brad Buckingham 2022-01-31 14:27:59 UTC

*** This bug has been marked as a duplicate of bug 2001476 ***