Skip to content

MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors #1404

@pjonsson

Description

@pjonsson

Latest HEAD on develop (commit 89fdb0d) gives me these errors:

/app/lib/python3.12/site-packages/gunicorn/workers/ggevent.py:38: MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors, including RecursionError on Python 3.6. It may also silently lead to incorrect behaviour on Python 3.7. Please monkey-patch earlier. See https://github.com/gevent/gevent/issues/1016. Modules that had direct imports (NOT patched): ['urllib3.util (/app/lib/python3.12/site-packages/urllib3/util/__init__.py)', 'urllib3.util.ssl_ (/app/lib/python3.12/site-packages/urllib3/util/ssl_.py)', 'botocore.httpsession (/app/lib/python3.12/site-packages/botocore/httpsession.py)'].
  monkey.patch_all()
[2025-12-19 10:32:56,252] [WARNING] Environment variable $AWS_DEFAULT_REGION not set.  (This warning can be ignored if all data is stored locally.)
[2025-12-19 10:38:17,699] [WARNING] Credentials in environment have expired. Creating a DummySession.
[2025-12-19 10:38:18,524] [WARNING] Failed to resolve driver datacube.plugins.io.read::netcdf
[2025-12-19 10:38:18,524] [WARNING] Error was: ModuleNotFoundError("No module named 'netCDF4'")
[2025-12-19 10:38:18,541] [ERROR] Error opening source dataset: s3://bucket/12/18/dataset/b02.tif
[2025-12-19 10:38:18,542] [WARNING] Ignoring Exception: maximum recursion depth exceeded

The AWS_DEFAULT_REGION warning has always been there (don't use AWS S3), the netCDF warnings are new for 1.9.x, and the monkeypatch warning/dummy session/maximum recursion depth exceeded started happening after commit eda5f2b.

Since there is an error opening the dataset, I'm not getting any images in TerriaMap pointing to the WMS service of OWS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions