You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's no problem with pymongo 4.8.0 but after intialize new project with 4.9.1, got this error :
failed to import ddtrace module 'ddtrace.contrib.pymongo' when patching on import
Traceback (most recent call last):
File "<redacted>/.venv/lib/python3.11/site-packages/ddtrace/_monkey.py", line 165, in on_import
imported_module = importlib.import_module(path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.rye/py/[email protected]/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<redacted>/.venv/lib/python3.11/site-packages/ddtrace/internal/module.py", line 309, in _exec_module
self.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "<redacted>/.venv/lib/python3.11/site-packages/ddtrace/contrib/pymongo/__init__.py", line 46, in <module>
from . import patch as _ # noqa: F401, I001
^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<redacted>/.venv/lib/python3.11/site-packages/ddtrace/internal/module.py", line 309, in _exec_module
self.loader.exec_module(module)
File "<redacted>/.venv/lib/python3.11/site-packages/ddtrace/contrib/pymongo/patch.py", line 1, in <module>
from ..internal.pymongo.patch import * # noqa: F401,F403
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<redacted>/.venv/lib/python3.11/site-packages/ddtrace/internal/module.py", line 309, in _exec_module
self.loader.exec_module(module)
File "<redacted>/.venv/lib/python3.11/site-packages/ddtrace/contrib/internal/pymongo/patch.py", line 39, in <module>
_VERIFY_VERSION_CLASS = pymongo.pool.SocketInfo if _VERSION < (4, 5) else pymongo.pool.Connection
^^^^^^^^^^^^
AttributeError: partially initialized module 'pymongo' has no attribute 'pool' (most likely due to a circular import)
Which version of dd-trace-py are you using?
2.12.2
Which version of pip are you using?
pip 24.0
Which libraries and their versions are you using?
`pip freeze`
pymongo>=4.8.0
How can we reproduce your problem?
patch_all with pymongo 4.9.1
What is the result that you get?
got error. see the summary
What is the result that you expected?
no error.
The text was updated successfully, but these errors were encountered:
After these changes applying the ddtrace pymongo integration started to raise an AttributeError. This prevented our pymongo integration from being enabled and logged the error above. I opened a PR to address this issue: #10718.
Summary of problem
There's no problem with pymongo 4.8.0 but after intialize new project with 4.9.1, got this error :
Which version of dd-trace-py are you using?
2.12.2
Which version of pip are you using?
pip 24.0
Which libraries and their versions are you using?
`pip freeze`
pymongo>=4.8.0How can we reproduce your problem?
patch_all
with pymongo 4.9.1What is the result that you get?
got error. see the summary
What is the result that you expected?
no error.
The text was updated successfully, but these errors were encountered: