Bug 2126981
Summary: | [RFE] Improved error messages with subscription-manager | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 9 | Reporter: | Pino Toscano <ptoscano> |
Component: | subscription-manager | Assignee: | Pino Toscano <ptoscano> |
Status: | CLOSED ERRATA | QA Contact: | Red Hat subscription-manager QE Team <rhsm-qe> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 9.0 | CC: | candlepin-bugs, fj-lsoft-tool-rh, jsefler, jvaldez, mfuruta, ptoscano, redakkan, rhsm-qe, rjerrido |
Target Milestone: | rc | Keywords: | FutureFeature, Triaged |
Target Release: | 9.2 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | subscription-manager-1.29.32-1.el9 | Doc Type: | Enhancement |
Doc Text: | Story Points: | --- | |
Clone Of: | 1971995 | Environment: | |
Last Closed: | 2023-05-09 08:18: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
Pino Toscano
2022-09-15 03:39:18 UTC
Preliminary testing with proxy servers, a local Candlepin with TESTDATA deployed, and component version 1.29.31+39... [root@kvm-04-guest02 ~]# rpm -q subscription-manager subscription-manager-1.29.31+39.g3e3e9aadd-1.git.0.7d023af.x86_64 [root@kvm-04-guest02 ~]# subscription-manager config --server.hostname=jsefler-cp0.usersys.redhat.com [root@kvm-04-guest02 ~]# subscription-manager config --server.prefix=/candlepin [root@kvm-04-guest02 ~]# subscription-manager config --server.port=8443 Using the "Improved subscription-manager error messages" design document as the structure for this pre-verification... > Pre-verifying improvements for old error message: Network error, unable to connect to server. Please see /var/log/rhsm/rhsm.log for more information [root@kvm-04-guest02 ~]# subscription-manager config --server.hostname=jsefler-cp0.usersys.redhat.com.BAD [root@kvm-04-guest02 ~]# subscription-manager register --username=testuser1 --org=admin Registering to: jsefler-cp0.usersys.redhat.com.BAD:8443/candlepin Password: Network error: Name or service not known (error code -2) <==== PRE-VERIFIED [root@kvm-04-guest02 ~]# echo $? 70 [root@kvm-04-guest02 ~]# subscription-manager config --server.hostname=jsefler-cp0.usersys.redhat.com [root@kvm-04-guest02 ~]# subscription-manager config --server.port=0 [root@kvm-04-guest02 ~]# subscription-manager register --username=testuser1 --org=admin Registering to: jsefler-cp0.usersys.redhat.com:0/candlepin Password: Connection error: Connection refused (error code 111) <==== PRE-VERIFIED [root@kvm-04-guest02 ~]# echo $? 70 [root@kvm-04-guest02 ~]# subscription-manager config --server.port=8443 > Pre-verifying improvements for old error message: Network error. Please check the connection details, or see /var/log/rhsm/rhsm.log for more information. RISK: I was unable to pre-verify the improved message "Unknown server reply (HTTP error code <error code>: <error message>)" because I could not figure out a way to force the server to reply with non-json. > Pre-verifying improvements for old error message: Proxy connection failed, please check your settings. [root@kvm-04-guest02 ~]# subscription-manager register --proxy=BAD Proxy error: unable to connect to BAD:3128: Name or service not known (error code -2) <==== PRE-VERIFIED [root@kvm-04-guest02 ~]# echo $? 69 [root@kvm-04-guest02 ~]# subscription-manager register --proxy=auto-services.usersys.redhat.com:9999 Proxy error: unable to connect to auto-services.usersys.redhat.com:9999: Connection refused (error code 111) <==== PRE-VERIFIED [root@kvm-04-guest02 ~]# echo $? 69 > Pre-verifying improvements for old error message: Unable to reach the server at <host>:<port>/<path> [root@kvm-04-guest02 ~]# subscription-manager register --proxy=auto-services.usersys.redhat.com:3127 --proxyuser=BAD Unable to reach the server at jsefler-cp0.usersys.redhat.com:8443/candlepin: Tunnel connection failed: 407 Proxy Authentication Required <==== PRE-VERIFIED [root@kvm-04-guest02 ~]# echo $? 69 > Pre-verifying improvements for old error message: Bad CA certificate: <file> [root@kvm-04-guest02 ~]# touch /etc/rhsm/ca/bad-cert.pem [root@kvm-04-guest02 ~]# subscription-manager register --username=testuser1 Registering to: jsefler-cp0.usersys.redhat.com:8443/candlepin Password: Bad CA certificate: /etc/rhsm/ca/bad-cert.pem: [X509: NO_CERTIFICATE_OR_CRL_FOUND] no certificate or crl found (_ssl.c:4293) <==== PRE-VERIFIED [root@kvm-04-guest02 ~]# echo $? 70 [root@kvm-04-guest02 ~]# rm -f /etc/rhsm/ca/bad-cert.pem > Pre-verifying improvements for old error message: System certificates corrupted. Please reregister. [root@kvm-04-guest02 ~]# touch /etc/pki/product/bad-cert.pem [root@kvm-04-guest02 ~]# subscription-manager list --installed Bad certificate: /etc/pki/product/bad-cert.pem: [PEM routines] no start line <==== PRE-VERIFIED [root@kvm-04-guest02 ~]# echo $? 70 [root@kvm-04-guest02 ~]# rm -f /etc/pki/product/bad-cert.pem Moving to VERIFIED based on automated test results in comment 6 and manually pre-verified results comment 1. (In reply to John Sefler from comment #1) > RISK: I was unable to pre-verify the improved message "Unknown server reply (HTTP error code <error code>: <error message>)" because I could not figure out a way to force the server to reply with non-json. In response to the RISK comment above, a fellow colleague encountered this scenario while using the main subscription-manager branch at commit level 5d188e588cc2a0c7315767c4afd379a3ac18b757 and demonstrated the improved error message as shown here... $ subscription_manager register --force Unregistering from: subscription.rhsm.stage.redhat.com:443/subscription Unknown server reply (HTTP error code 400: Bad Request): <html><13> <head><title>400 The SSL certificate error</title></head><13> <body><13> <center><h1>400 Bad Request</h1></center><13> <center>The SSL certificate error</center><13> <hr><center>openresty</center><13> </body><13> </html><13> 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 (subscription-manager 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:2493 |