open-telemetry / open-telemetry/opentelemetry-python

RecursionError: maximum recursion depth exceeded

Open
#4,532 9 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted
Dominant language
Python
Stars
2.6k
Forks
1k
Avg merge
4d 15h
Merged PRs (30d)
19

Description

Describe your environment

OS: (e.g, Ubuntu)
Python version: Python 3.12.9
SDK version: 1.30
API version: 1.30

What happened?
          ^^^^^^^^^^^^^
  File "/home/admin/.venv/lib/python3.12/site-packages/opentelemetry/instrumentation/urllib3/__init__.py", line 316, in instrumented_urlopen
    return wrapped(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/admin/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 787, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "/home/admin/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 464, in _make_request
    self._validate_conn(conn)
  File "/home/admin/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 1093, in _validate_conn
    conn.connect()
  File "/home/admin/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 741, in connect
    sock_and_verified = _ssl_wrap_socket_and_match_hostname(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/admin/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 873, in _ssl_wrap_socket_and_match_hostname
    context = create_urllib3_context(
              ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/admin/.venv/lib/python3.12/site-packages/urllib3/util/ssl_.py", line 293, in create_urllib3_context
    context.minimum_version = TLSVersion.TLSv1_2
    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/python3/lib/python3.12/ssl.py", line 545, in minimum_version
    super(SSLContext, SSLContext).minimum_version.__set__(self, value)
  File "/usr/local/python3/lib/python3.12/ssl.py", line 545, in minimum_version
    super(SSLContext, SSLContext).minimum_version.__set__(self, value)
  File "/usr/local/python3/lib/python3.12/ssl.py", line 545, in minimum_version
    super(SSLContext, SSLContext).minimum_version.__set__(self, value)
  [Previous line repeated 851 more times]
  File "/usr/local/python3/lib/python3.12/ssl.py", line 543, in minimum_version
    if value == TLSVersion.SSLv3:
                ^^^^^^^^^^^^^^^^
RecursionError: maximum recursion depth exceeded
Steps to Reproduce

when request or httpx will reproduce

Expected Result

post traces correct

Actual Result

RecursionError: maximum recursion depth exceeded

Additional context

No response

Would you like to implement a fix?

None

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at opentelemetry/instrumentation/urllib3/init.py around instrumented_urlopen, then reproduce the failure with a request or httpx call using the reported Python 3.12.9 and SDK 1.30 environment. Trace the repeated ssl.SSLContext.minimum_version calls and confirm that post traces complete without the RecursionError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.