taftsanders / satellite-leapp-check

A script to run on the Satellite or the upgrading client to validate clients have the required repositories for the LEAPP upgrade process
GNU General Public License v3.0
4 stars 3 forks source link

Issue when presenting the packages from content host #33

Closed waldirio closed 9 months ago

waldirio commented 10 months ago

Issue when presenting the packages from content host

[root@wallsat613 ~]# ./satellite_leapp_check -u admin -p redhat -v 8.6 -c waldirio-03646176-rhel7.d.sysmgmt.cee.redhat.com

This script is used in determining the availability of the correct repositories for a client for leapp upgrade
This script currently only supports RHEL 7 to 8 upgrade for x86_64 Intel architecture
Satellite is installed
❌ A request test to the Satellite at: https://wallsat613.d.sysmgmt.cee.redhat.com failed with the following error: 
An error occurred: HTTPSConnectionPool(host='wallsat613.d.sysmgmt.cee.redhat.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:877)'),))
✅ RHEL 7 version detected
❌ A request test to the Satellite at: https://wallsat613.d.sysmgmt.cee.redhat.com failed with the following error: 
An error occurred: HTTPSConnectionPool(host='wallsat613.d.sysmgmt.cee.redhat.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:877)'),))
❌ Organization ID 1 is missing Red Hat Enterprise Linux 7 Server - Extras RPMs x86_64
✅ Repository Enabled: Red Hat Enterprise Linux 7 Server - Extras (RPMs)
Please sync this repository before attempting to include it in any content view or accessing it via a client
✅ Repository Enabled: Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)
Please sync this repository before attempting to include it in any content view or accessing it via a client
✅ Repository Enabled: Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)
Please sync this repository before attempting to include it in any content view or accessing it via a client
❌ A request test to the Satellite at: https://wallsat613.d.sysmgmt.cee.redhat.com failed with the following error: 
An error occurred: HTTPSConnectionPool(host='wallsat613.d.sysmgmt.cee.redhat.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:877)'),))
✅ Organization ID 1 has the required repos enabled
Checking client's content view for repo availability
You are using the Default Organization View
Checking that the repos contain content
❌ A request test to the Satellite at: https://wallsat613.d.sysmgmt.cee.redhat.com failed with the following error: 
An error occurred: HTTPSConnectionPool(host='wallsat613.d.sysmgmt.cee.redhat.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:877)'),))
❌ A request test to the Satellite at: https://wallsat613.d.sysmgmt.cee.redhat.com failed with the following error: 
An error occurred: HTTPSConnectionPool(host='wallsat613.d.sysmgmt.cee.redhat.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:877)'),))
❌ A request test to the Satellite at: https://wallsat613.d.sysmgmt.cee.redhat.com failed with the following error: 
An error occurred: HTTPSConnectionPool(host='wallsat613.d.sysmgmt.cee.redhat.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:877)'),))
❌ A request test to the Satellite at: https://wallsat613.d.sysmgmt.cee.redhat.com failed with the following error: 
An error occurred: HTTPSConnectionPool(host='wallsat613.d.sysmgmt.cee.redhat.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:877)'),))
❌ A request test to the Satellite at: https://wallsat613.d.sysmgmt.cee.redhat.com failed with the following error: 
An error occurred: HTTPSConnectionPool(host='wallsat613.d.sysmgmt.cee.redhat.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:877)'),))
❌ The following repos were found to have 0 RPMs
Traceback (most recent call last):
  File "satellite_leapp_check.py", line 639, in <module>
  File "satellite_leapp_check.py", line 630, in main
  File "satellite_leapp_check.py", line 617, in parse_client
    get_hostname()
  File "satellite_leapp_check.py", line 347, in check_repos_for_content
    print("- Which means that the repository wasn't synced before the content view was published")
TypeError: must be str, not list
[576218] Failed to execute script 'satellite_leapp_check' due to unhandled exception!
[root@wallsat613 ~]# 
taftsanders commented 9 months ago

@waldirio I didn't appear to hit the same issue you did, but I cleaned up the output a bit more as I didn't like how the output wasn't more descriptive of the checks. Please try to run this again from the latest commit: https://raw.githubusercontent.com/taftsanders/satellite-leapp-check/33-issue-when-presenting-the-packages-from-content-host/satellite_leapp_check.py

taftsanders commented 9 months ago

It might be helpful to share with you what I got.

[root@wallsat613 taft]# python3 satellite_leapp_check.py -u admin -p redhat -v 8.6 -c waldirio-03646176-rhel7.d.sysmgmt.cee.redhat.com

Thanks for using satellite_leapp_check.
Please report all bugs or issues found to https://github.com/taftsanders/satellite-leapp-check/issues
This script is used in determining the availability of the correct repositories for a client for leapp upgrade
This script currently only supports RHEL 7 to 8 upgrade for x86_64 Intel architecture

satellite-installer package detected on executing server
Calling the Satellite API for information on the specified client
Searching for host waldirio-03646176-rhel7.d.sysmgmt.cee.redhat.com
✅ RHEL 7 version detected
✅ Organization ID 1 has the required repos enabled
Checking client's content view for repo availability
You are using the Default Organization View
Checking that the repos contain content
❌ The following repos were found to have 0 RPMs
        - Red Hat Enterprise Linux 8 for x86_64 - AppStream RPMs 8.6
Please sync the repositories listed above again.
[root@wallsat613 taft]# 

This failure was expected as the Satellite doesn't have the RHEL 8.6 Appstream synced:

[root@wallsat613 taft]# curl -sku admin:redhat https://$(hostname -f)/katello/api/content_view_versions/1 | python3 
-m json.tool | grep -B1 'AppStream RPMs 8.6'
            "id": 26,
            "name": "Red Hat Enterprise Linux 8 for x86_64 - AppStream RPMs 8.6",

[root@wallsat613 taft]# curl -sku admin:redhat https://$(hostname -f)/katello/api/repositories/26 | python3 -m json.tool | grep '"rpm":'
        "rpm": 0,
waldirio commented 9 months ago

Hello,

Thank you @taftsanders , testing it, I can see that the code is still not requiring the version as reported here #28

let me pass the version and move on. Waldirio

waldirio commented 9 months ago

Hey @taftsanders

When running the app, I got the output as presented below

[root@wallsat613 taft]# python3 satellite_leapp_check.py -u admin -p redhat -v 8.6 -c waldirio-1234-rhel7.d.sysmgmt.cee.redhat.com

Thanks for using satellite_leapp_check.
Please report all bugs or issues found to https://github.com/taftsanders/satellite-leapp-check/issues
This script is used in determining the availability of the correct repositories for a client for leapp upgrade
This script currently only supports RHEL 7 to 8 upgrade for x86_64 Intel architecture

satellite-installer package detected on executing server
Calling the Satellite API for information on the specified client
Searching for host waldirio-1234-rhel7.d.sysmgmt.cee.redhat.com
✅ RHEL 7 version detected
✅ Organization ID 1 has the required repos enabled
Checking client's content view for repo availability
You are using the Default Organization View
Checking that the repos contain content
❌ The following repos were found to have 0 RPMs
    - Red Hat Enterprise Linux 8 for x86_64 - AppStream RPMs 8.6
Please sync the repositories listed above again.
[root@wallsat613 taft]# 

Both repos, appstream and baseos were enabled and pending to sync, but above, we can see only one repo to be synced "Red Hat Enterprise Linux 8 for x86_64 - AppStream RPMs 8.6"

Ps.: I saw the same behavior when pointing to a different version, 8.8

I'm moving on with the tests. Waldirio

waldirio commented 9 months ago

Hey,

Here for reference

[root@wallsat613 taft]# python3 satellite_leapp_check.py -u admin -p redhat -v 8.8 -c waldirio-1234-rhel7.d.sysmgmt.cee.redhat.com

Thanks for using satellite_leapp_check.
Please report all bugs or issues found to https://github.com/taftsanders/satellite-leapp-check/issues
This script is used in determining the availability of the correct repositories for a client for leapp upgrade
This script currently only supports RHEL 7 to 8 upgrade for x86_64 Intel architecture

satellite-installer package detected on executing server
Calling the Satellite API for information on the specified client
Searching for host waldirio-1234-rhel7.d.sysmgmt.cee.redhat.com
✅ RHEL 7 version detected
❌ Organization ID 1 is missing Red Hat Enterprise Linux 8 for x86_64 - AppStream RPMs 8.8
✅ Repository Enabled: Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)
Please sync this repository before attempting to include it in any content view or accessing it via a client
✅ Repository Enabled: Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)
Please sync this repository before attempting to include it in any content view or accessing it via a client
✅ Organization ID 1 has the required repos enabled
Checking client's content view for repo availability
You are using the Default Organization View
Checking that the repos contain content
❌ The following repos were found to have 0 RPMs
    - Red Hat Enterprise Linux 8 for x86_64 - AppStream RPMs 8.8
Please sync the repositories listed above again.
[root@wallsat613 taft]# 
waldirio commented 9 months ago

Hey @taftsanders

After synced.

[root@wallsat613 taft]# python3 satellite_leapp_check.py -u admin -p redhat -v 8.6 -c waldirio-1234-rhel7.d.sysmgmt.cee.redhat.com

Thanks for using satellite_leapp_check.
Please report all bugs or issues found to https://github.com/taftsanders/satellite-leapp-check/issues
This script is used in determining the availability of the correct repositories for a client for leapp upgrade
This script currently only supports RHEL 7 to 8 upgrade for x86_64 Intel architecture

satellite-installer package detected on executing server
Calling the Satellite API for information on the specified client
Searching for host waldirio-03646176-rhel7.d.sysmgmt.cee.redhat.com
✅ RHEL 7 version detected
✅ Organization ID 1 has the required repos enabled
Checking client's content view for repo availability
You are using the Default Organization View
Checking that the repos contain content
✅ Congratulations!!! waldirio-1234-rhel7.d.sysmgmt.cee.redhat.com is ready to LEAPP
[root@wallsat613 taft]# 

LGTM. I believe you can merge this one and fix the other small one.

I'll test on diff versions this week.

Thank you! Waldirio

taftsanders commented 9 months ago

Got it! I'll work on #28 next