question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Infinite recursion error when testing https sites

See original GitHub issue

Description of issue / feature request

When opening a connection to an HTTPs site, I’m triggering an infinite recursion error:

[2017-09-14 22:19:39,370] BOS-SC-JBil2/ERROR/stderr: File "/Users/jbilien/src/scout-load/virtualenv/lib/python3.6/site-packages/requests/sessions.py", line 521, in get
    return self.request('GET', url, **kwargs)
[2017-09-14 22:19:39,386] BOS-SC-JBil2/ERROR/stderr:
[2017-09-14 22:19:39,386] BOS-SC-JBil2/ERROR/stderr: File "/Users/jbilien/src/scout-load/virtualenv/lib/python3.6/site-packages/locust/clients.py", line 114, in request
    response = self._send_request_safe_mode(method, url, **kwargs)
[2017-09-14 22:19:39,387] BOS-SC-JBil2/ERROR/stderr:
[2017-09-14 22:19:39,387] BOS-SC-JBil2/ERROR/stderr: File "/Users/jbilien/src/scout-load/virtualenv/lib/python3.6/site-packages/locust/clients.py", line 158, in _send_request_safe_mode
    return requests.Session.request(self, method, url, **kwargs)
[2017-09-14 22:19:39,387] BOS-SC-JBil2/ERROR/stderr:
[2017-09-14 22:19:39,387] BOS-SC-JBil2/ERROR/stderr: File "/Users/jbilien/src/scout-load/virtualenv/lib/python3.6/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
[2017-09-14 22:19:39,387] BOS-SC-JBil2/ERROR/stderr:
[2017-09-14 22:19:39,387] BOS-SC-JBil2/ERROR/stderr: File "/Users/jbilien/src/scout-load/virtualenv/lib/python3.6/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
[2017-09-14 22:19:39,387] BOS-SC-JBil2/ERROR/stderr:
[2017-09-14 22:19:39,387] BOS-SC-JBil2/ERROR/stderr: File "/Users/jbilien/src/scout-load/virtualenv/lib/python3.6/site-packages/requests/adapters.py", line 440, in send
    timeout=timeout
[2017-09-14 22:19:39,387] BOS-SC-JBil2/ERROR/stderr:
[2017-09-14 22:19:39,387] BOS-SC-JBil2/ERROR/stderr: File "/Users/jbilien/src/scout-load/virtualenv/lib/python3.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
[2017-09-14 22:19:39,387] BOS-SC-JBil2/ERROR/stderr:
[2017-09-14 22:19:39,388] BOS-SC-JBil2/ERROR/stderr: File "/Users/jbilien/src/scout-load/virtualenv/lib/python3.6/site-packages/urllib3/connectionpool.py", line 346, in _make_request
    self._validate_conn(conn)
[2017-09-14 22:19:39,388] BOS-SC-JBil2/ERROR/stderr:
[2017-09-14 22:19:39,388] BOS-SC-JBil2/ERROR/stderr: File "/Users/jbilien/src/scout-load/virtualenv/lib/python3.6/site-packages/urllib3/connectionpool.py", line 850, in _validate_conn
    conn.connect()
[2017-09-14 22:19:39,388] BOS-SC-JBil2/ERROR/stderr:
[2017-09-14 22:19:39,388] BOS-SC-JBil2/ERROR/stderr: File "/Users/jbilien/src/scout-load/virtualenv/lib/python3.6/site-packages/urllib3/connection.py", line 314, in connect
    cert_reqs=resolve_cert_reqs(self.cert_reqs),
[2017-09-14 22:19:39,388] BOS-SC-JBil2/ERROR/stderr:
[2017-09-14 22:19:39,388] BOS-SC-JBil2/ERROR/stderr: File "/Users/jbilien/src/scout-load/virtualenv/lib/python3.6/site-packages/urllib3/util/ssl_.py", line 269, in create_urllib3_context
    context.options |= options
[2017-09-14 22:19:39,388] BOS-SC-JBil2/ERROR/stderr:
[2017-09-14 22:19:39,388] BOS-SC-JBil2/ERROR/stderr: File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 459, in options
    super(SSLContext, SSLContext).options.__set__(self, value)
[2017-09-14 22:19:39,388] BOS-SC-JBil2/ERROR/stderr:
[2017-09-14 22:19:39,388] BOS-SC-JBil2/ERROR/stderr: File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 459, in options
    super(SSLContext, SSLContext).options.__set__(self, value)
[2017-09-14 22:19:39,388] BOS-SC-JBil2/ERROR/stderr:
[2017-09-14 22:19:39,389] BOS-SC-JBil2/ERROR/stderr: File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 459, in options
    super(SSLContext, SSLContext).options.__set__(self, value)
[2017-09-14 22:19:39,389] BOS-SC-JBil2/ERROR/stderr:
[2017-09-14 22:19:39,389] BOS-SC-JBil2/ERROR/stderr: [Previous line repeated 316 more times]

A similar issue is being discussed at https://github.com/requests/requests/issues/3752 and https://github.com/gevent/gevent/issues/903. Suggestions to update to gevent 1.2 haven’t helped.

Environment settings (for bug reports)

  • OS: macOS 10.12.6
  • Python version: 3.6.2
  • Locust version: 8c4eeae4d1001f6b01cd5caf01273a0f2393405e

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
heymancommented, Sep 16, 2017

New version released to PyPI.

2reactions
heymancommented, Sep 16, 2017

Found the issue! #651 had changed so that we applied the gevent monkey patching after we import requests which caused the issue. This is fixed in master now, and I’m about to push out a new version on PyPI.

Read more comments on GitHub >

github_iconTop Results From Across the Web

error in grader test. Infinite recursion error - java
I am learning Spring MVC online. As part of my course, I have to develop a Cloud Video Service. Specifications are mentioned here....
Read more >
InternalError: too much recursion - JavaScript - MDN Web Docs
The JavaScript exception "too much recursion" or "Maximum call stack size exceeded" occurs when there are too many function calls, or a function...
Read more >
how to fix ''Out of memory. The likely cause is an infinite ...
I am trying to using the Contour Tracing estimation algorithm but I have no idea about this error. the input file is D...
Read more >
Automatic Detection of Infinite Recursion in AspectJ Programs
This paper aims at automatic detection of infinite recursion at compile time in aspect-oriented programs. Infinite recursion is a known problem with ...
Read more >
Java Recursion
Infinite recursion is when the function never stops calling itself. Every recursive function should have a halting condition, which is the condition where...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found