Bug 1924613 - python2-urllib3 breaking some ansible modules
Summary: python2-urllib3 breaking some ansible modules
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Operator SDK
Version: 3.11.0
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ---
: 3.11.z
Assignee: Jesus M. Rodriguez
QA Contact: Cuiping HUO
URL:
Whiteboard:
Depends On: 1944916
Blocks: 1897273 1920894
TreeView+ depends on / blocked
 
Reported: 2021-02-03 10:26 UTC by Roman Bobek
Modified: 2024-03-25 18:06 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-08-04 11:18:17 UTC
Target Upstream Version:
Embargoed:
jesusr: needinfo-


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2021:2928 0 None None None 2021-08-04 11:18:31 UTC

Internal Links: 1927355 1944916

Description Roman Bobek 2021-02-03 10:26:53 UTC
Description of problem:
After updating python2-urllib3 to the latest version available in the OpenShift 3.11. repository (python2-urllib3-1.26.2-1.el7.noarch) the k8s_info module is failing:

$  ansible -m k8s_info -a 'kind=namespaces'  localhost
/usr/lib/python2.7/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.26.2) or chardet (3.0.4) doesn't match a supported version!
  RequestsDependencyWarning)
localhost | FAILED! => {
    "changed": false,
[...]

Version-Release number of selected component (if applicable):
- python2-urllib3-1.26.2-1.el7.noarch

How reproducible:
- Allways

Steps to Reproduce:
1. update/install the OCP 3.11 to get the python2-urllib3-1.26.2-1.el7.noarch package from the 'rhel-7-server-ose-3.11-rpms' repository
2. run the k8s_info modul

Actual results:
- 'urllib3 (1.26.2) or chardet (3.0.4) doesn't match a supported version!' error message reported
- module is failing

Expected results:
- module will proceed and give us results

Workaround:
- downgrade the python2-urllib3 package to 'python2-urllib3-1.24.3-1.el7.noarch'

Comment 2 Russell Teague 2021-02-04 18:17:10 UTC
The reported error is not related to openshift-ansible.


Looks like python-requests>=2.20 would be needed.
https://github.com/psf/requests/blob/v2.20.0/setup.py#L47

@jesusr,
It looks like you recently tagged in the newer version of python-urllib3.
https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=1469298

Could you look into getting python-requests updated for rhaos-3.11-rhel-7?

Comment 9 Jesus M. Rodriguez 2021-03-30 22:52:08 UTC
I have done the following to address this bug:

* reverted back to python2-urllib3 1.24.3 [1] which was the most recent 3.11 release before bumping to 1.26.2.
* backported upstream patch to fix CVE-2020-26137 [2] which was why we updated to 1.26.2 in the first place
* bumped the Epoch of python2-urllib3 1.24.3 to 1 to force it to downgrade the 1.26.2 on existing servers
* created a bug [3] against python2-requests to support upgrading to newer urllib3.

[1] brew build for 1.24.3-2 https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=35834480
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1883800
[3] https://bugzilla.redhat.com/show_bug.cgi?id=1944916

Comment 11 Cuiping HUO 2021-04-02 06:20:11 UTC
Verify failed. the latest package is python2-urllib3-1.26.2-2.el7.noarch.

#subscription-manager register --username=XXX
Password: 
The system has been registered with ID: 9e424092-b506-452a-ae02-535b1ed2c284
The registered system name is: ip-172-18-8-255.ec2.internal


# subscription-manager repos --enable="rhel-7-server-ose-3.11-rpms"
Repository 'rhel-7-server-ose-3.11-rpms' is enabled for this system.


#yum update 
...
Replaced:
  python-urllib3.noarch 0:1.10.2-7.el7                                                                                                                                                                                       

Complete!

# rpm -qa | grep urllib3
python2-urllib3-1.26.2-2.el7.noarch

# ansible -m k8s_info -a 'kind=namespaces'  localhost
 [WARNING]: Could not match supplied host pattern, ignoring: all

 [WARNING]: provided hosts list is empty, only localhost is available

/usr/lib/python2.7/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.26.2) or chardet (3.0.4) doesn't match a supported version!
  RequestsDependencyWarning)
localhost | FAILED! => {
    "msg": "The module k8s_info was not found in configured module paths. Additionally, core modules are missing. If this is a checkout, run 'git pull --rebase' to correct this problem."
}

Comment 15 Jesus M. Rodriguez 2021-06-15 19:12:02 UTC
With Bug 1944916 rebuilt, this bug should now be fixed in the next release.

Comment 18 Cuiping HUO 2021-06-22 08:39:09 UTC
Verify failed. 

cluster version: v3.11.439 with python2-urllib3-1.24.3-2.el7.noarch

# subscription-manager register --username=xxx
Registering to: subscription.rhsm.redhat.com:443/subscription
Password: 
The system has been registered with ID: db369aea-1f15-480c-b9b9-9f2b65f7230e
The registered system name is: ip-172-18-9-52.ec2.internal

# subscription-manager repos --enable="rhel-7-server-ose-3.11-rpms"
Repository 'rhel-7-server-ose-3.11-rpms' is enabled for this system.


#yum update 
...
Installing:
 kernel                                        x86_64        3.10.0-1160.31.1.el7                 rhel-7-server-rpms                    50 M
 python2-chardet                               noarch        3.0.4-7.el7ost                       aos                                  186 k
     replacing  python-chardet.noarch 2.2.1-3.el7
 python2-requests                              noarch        2.19.1-4.el7ost                      aos                                  123 k
     replacing  python-requests.noarch 2.6.0-9.el7_8
 python2-urllib3                               noarch        1:1.24.3-2.el7                       aos                                  170 k
     replacing  python-urllib3.noarch 1.10.2-7.el7


]# rpm -qa | grep urllib3
python2-urllib3-1.24.3-2.el7.noarch

# ansible -m k8s_info -a 'kind=namespaces'  localhost
 [WARNING]: Could not match supplied host pattern, ignoring: all

 [WARNING]: provided hosts list is empty, only localhost is available

/usr/lib/python2.7/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.24.3) or chardet (3.0.4) doesn't match a supported version!
  RequestsDependencyWarning)
localhost | FAILED! => {
    "msg": "The module k8s_info was not found in configured module paths. Additionally, core modules are missing. If this is a checkout, run 'git pull --rebase' to correct this problem."
}

Comment 20 Jesus M. Rodriguez 2021-07-13 16:03:39 UTC
This is fixed and should've been in the errata.

Comment 22 Cuiping HUO 2021-07-20 14:53:30 UTC
verified. No RequestsDependencyWarning and Failed as expected.

cluster version: v3.11.465 with python2-urllib3-1.24.3-2.el7.noarch


# rpm -qa | grep python2-requests
python2-requests-2.19.1-5.el7.noarch

# rpm -qa | grep urllib3
python2-urllib3-1.24.3-2.el7.noarch

# ansible -m k8s_info -a 'kind=namespaces'  localhost
 [WARNING]: Could not match supplied host pattern, ignoring: all
 [WARNING]: provided hosts list is empty, only localhost is available
localhost | FAILED! => {
    "msg": "The module k8s_info was not found in configured module paths. Additionally, core modules are missing. If this is a checkout, run 'git pull --rebase' to correct this problem."

Comment 25 errata-xmlrpc 2021-08-04 11:18:17 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 (OpenShift Container Platform 3.11.487 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-2021:2928


Note You need to log in before you can comment on or make changes to this bug.