RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 1785696 - Changes to how urllib3 was imported caused Timeout stacktrace
Summary: Changes to how urllib3 was imported caused Timeout stacktrace
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: python-requests
Version: 7.8
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: rc
: ---
Assignee: Charalampos Stratakis
QA Contact: RHEL CS Apps Subsystem QE
URL:
Whiteboard:
Depends On:
Blocks: 1802126 1811105 1811106 1811107 1811108
TreeView+ depends on / blocked
 
Reported: 2019-12-20 17:37 UTC by Jesus M. Rodriguez
Modified: 2023-09-07 21:19 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
: 1811105 1811106 1811107 1811108 (view as bug list)
Environment:
Last Closed: 2020-09-29 19:39:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
log from operator pod showing full stacktrace (111.24 KB, text/plain)
2019-12-20 17:37 UTC, Jesus M. Rodriguez
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:3886 0 None None None 2020-09-29 19:40:31 UTC

Description Jesus M. Rodriguez 2019-12-20 17:37:48 UTC
Created attachment 1646861 [details]
log from operator pod showing full stacktrace

Description of problem:
A recent change to python-requests caused previously working code to fail with ValueError: Timeout value connect was Timeout(connect=None, read=None, total=None), but it must be an int, float or None.

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

How reproducible:
Deploy a version of the ansible-service-broker operator that has python-requests-2.6.0-8 installed in its base image.

Actual results:

{"level":"error","ts":1576464180.9534247,"logger":"runner","msg":"Traceback (most recent call last):
  File \"/usr/lib/python2.7/site-packages/ansible_runner/__main__.py\", line 329, in main
    res = run(**run_options)                                                    
  File \"/usr/lib/python2.7/site-packages/ansible_runner/interface.py\", line 162, in run
    r.run()                                                                     
  File \"/usr/lib/python2.7/site-packages/ansible_runner/runner.py\", line 93, in run
    self.status_callback('starting')                                            
  File \"/usr/lib/python2.7/site-packages/ansible_runner/runner.py\", line 84, in status_callback
    ansible_runner.plugins[plugin].status_handler(self.config, status_data)     
  File \"/usr/lib/python2.7/site-packages/ansible_runner_http/events.py\", line 38, in status_handler
    urlpath=plugin_config['runner_path'])                                       
  File \"/usr/lib/python2.7/site-packages/ansible_runner_http/events.py\", line 18, in send_request
    return session.post(url_actual, headers=headers, json=(data))               
  File \"/usr/lib/python2.7/site-packages/requests/sessions.py\", line 529, in post
    return self.request('POST', url, data=data, json=json, **kwargs)            
  File \"/usr/lib/python2.7/site-packages/requests/sessions.py\", line 486, in request
    resp = self.send(prep, **send_kwargs)                                       
  File \"/usr/lib/python2.7/site-packages/requests/sessions.py\", line 598, in send
    r = adapter.send(request, **kwargs)                                         
  File \"/usr/lib/python2.7/site-packages/requests/adapters.py\", line 370, in send
    timeout=timeout                                                             
  File \"/usr/lib/python2.7/site-packages/urllib3/connectionpool.py\", line 587, in urlopen
    timeout_obj = self._get_timeout(timeout)                                     
  File \"/usr/lib/python2.7/site-packages/urllib3/connectionpool.py\", line 302, in _get_timeout
    return Timeout.from_float(timeout)                                           
  File \"/usr/lib/python2.7/site-packages/urllib3/util/timeout.py\", line 154, in from_float
    return Timeout(read=timeout, connect=timeout)                               
  File \"/usr/lib/python2.7/site-packages/urllib3/util/timeout.py\", line 94, in __init__
    self._connect = self._validate_timeout(connect, 'connect')                   
  File \"/usr/lib/python2.7/site-packages/urllib3/util/timeout.py\", line 127, in _validate_timeout
    \"int, float or None.\" % (name, value))                                    
ValueError: Timeout value connect was Timeout(connect=None, read=None, total=None), but it must be an int, float or None.


Expected results:
No traceback

Additional info:

Comment 2 Jesus M. Rodriguez 2019-12-20 17:42:48 UTC
The bug that caused our investigation was during the testing of the Ansible Operator: https://bugzilla.redhat.com/show_bug.cgi?id=1783829

We tracked it down to this specific change:
http://pkgs.devel.redhat.com/cgit/rpms/python-requests/commit/?h=rhel-7.7&id=c2b7d2c6fae9ea48268a2931980b7274c1d8e538

The above change was done to address azure bug: https://bugzilla.redhat.com/show_bug.cgi?id=1750839

In order to fix our bug so we could ship OpenShift 4.3, we had to pin the python-requests release to 2.6.0-7 which fixed our problems.

http://pkgs.devel.redhat.com/cgit/containers/openshift-enterprise-apb-base/tree/Dockerfile?h=rhaos-4.3-rhel-7#n8

Comment 4 Miro Hrončok 2019-12-20 20:25:54 UTC
any chance this is related to bz1785607?

Comment 5 Jesus M. Rodriguez 2020-01-13 15:33:13 UTC
(In reply to Miro Hrončok from comment #4)
> any chance this is related to bz1785607?

Anything's possible but I don't get an AttributeError.

Comment 7 Peter Schiffer 2020-01-27 01:18:17 UTC
I think I see the same error on CentOS 7.7:

# rpm -q python-requests
python-requests-2.6.0-8.el7_7.noarch

# COMPOSE_HTTP_TIMEOUT=240 docker-compose pull
Traceback (most recent call last):
  File "/bin/docker-compose", line 11, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/compose/cli/main.py", line 71, in main
    command()
  File "/usr/lib/python2.7/site-packages/compose/cli/main.py", line 124, in perform_command
    project = project_from_options('.', options)
  File "/usr/lib/python2.7/site-packages/compose/cli/command.py", line 41, in project_from_options
    compatibility=options.get('--compatibility'),
  File "/usr/lib/python2.7/site-packages/compose/cli/command.py", line 126, in get_project
    project_name, config_data, client, environment.get('DOCKER_DEFAULT_PLATFORM')
  File "/usr/lib/python2.7/site-packages/compose/project.py", line 100, in from_config
    service_networks = get_networks(service_dict, networks)
  File "/usr/lib/python2.7/site-packages/compose/network.py", line 320, in get_networks
    networks[network.true_name] = netdef
  File "/usr/lib/python2.7/site-packages/compose/network.py", line 125, in true_name
    self._set_legacy_flag()
  File "/usr/lib/python2.7/site-packages/compose/network.py", line 146, in _set_legacy_flag
    data = self.inspect(legacy=True)
  File "/usr/lib/python2.7/site-packages/compose/network.py", line 106, in inspect
    return self.client.inspect_network(self.legacy_full_name)
  File "/usr/lib/python2.7/site-packages/docker/utils/decorators.py", line 19, in wrapped
    return f(self, resource_id, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/docker/api/network.py", line 211, in inspect_network
    res = self._get(url, params=params)
  File "/usr/lib/python2.7/site-packages/docker/utils/decorators.py", line 46, in inner
    return f(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/docker/api/client.py", line 198, in _get
    return self.get(url, **self._set_request_timeout(kwargs))
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 498, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 486, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 598, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 370, in send
    timeout=timeout
  File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 582, in urlopen
    timeout_obj = self._get_timeout(timeout)
  File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 309, in _get_timeout
    return Timeout.from_float(timeout)
  File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/util/timeout.py", line 154, in from_float
    return Timeout(read=timeout, connect=timeout)
  File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/util/timeout.py", line 97, in __init__
    self._connect = self._validate_timeout(connect, 'connect')
  File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/util/timeout.py", line 127, in _validate_timeout
    "int or float." % (name, value))
ValueError: Timeout value connect was Timeout(connect=240, read=240, total=None), but it must be an int or float.


The command works once I downgrade to python-requests-2.6.0-7.el7_7.noarch.

Relevant info to this docker issue:
https://github.com/docker/docker-py/issues/1645
https://github.com/psf/requests/issues/4160

Comment 8 Lumír Balhar 2020-01-28 13:41:07 UTC
Peter, could you please test the build from comment#6.

Comment 9 Peter Schiffer 2020-01-28 14:01:36 UTC
I don't have priv. to see comment#6.

Comment 10 Petr Viktorin (pviktori) 2020-01-28 14:58:04 UTC
Sorry! We linked to a private build instead.
We'll send the RPM to you privately.

Comment 13 Matt Dainty 2020-03-02 12:26:44 UTC
This has broken some in-house code, pinning back to 2.6.0-7 fixes things for now.

Comment 23 Jan Houska 2020-05-25 13:56:47 UTC
VERIFIED:
all modules from comment 16 was successfully  loaded. 


version:
python-requests-2.6.0-10.el7.noarch

Comment 25 errata-xmlrpc 2020-09-29 19:39:41 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 (python-requests 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-2020:3886


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