Closed tronto20 closed 11 months ago
pydantic v2.4.0 released recently, and it seems to be causing an error.
error log:
... [2023-09-26 13:59:06 +0000] [1] [INFO] Using worker: uvicorn.workers.UvicornWorker [2023-09-26 13:59:06 +0000] [7] [INFO] Booting worker with pid: 7 [2023-09-26 13:59:08 +0000] [7] [ERROR] Exception in worker process Traceback (most recent call last): File "/opt/bitnami/python/lib/python3.11/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker worker.init_process() File "/opt/bitnami/python/lib/python3.11/site-packages/uvicorn/workers.py", line 66, in init_process super(UvicornWorker, self).init_process() File "/opt/bitnami/python/lib/python3.11/site-packages/gunicorn/workers/base.py", line 134, in init_process self.load_wsgi() File "/opt/bitnami/python/lib/python3.11/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi self.wsgi = self.app.wsgi() ^^^^^^^^^^^^^^^ File "/opt/bitnami/python/lib/python3.11/site-packages/gunicorn/app/base.py", line 67, in wsgi self.callable = self.load() ^^^^^^^^^^^ File "/opt/bitnami/python/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py", line 58, in load return self.load_wsgiapp() ^^^^^^^^^^^^^^^^^^^ File "/opt/bitnami/python/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp return util.import_app(self.app_uri) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/bitnami/python/lib/python3.11/site-packages/gunicorn/util.py", line 359, in import_app mod = importlib.import_module(module) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/bitnami/python/lib/python3.11/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap>", line 1206, in _gcd_import File "<frozen importlib._bootstrap>", line 1178, in _find_and_load File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 690, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 940, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/opt/bitnami/python/lib/python3.11/site-packages/titiler/application/main.py", line 16, in <module> from titiler.core.errors import DEFAULT_STATUS_CODES, add_exception_handlers File "/opt/bitnami/python/lib/python3.11/site-packages/titiler/core/__init__.py", line 5, in <module> from . import dependencies, errors, factory, routing # noqa ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/bitnami/python/lib/python3.11/site-packages/titiler/core/factory.py", line 13, in <module> from geojson_pydantic.features import Feature, FeatureCollection File "/opt/bitnami/python/lib/python3.11/site-packages/geojson_pydantic/__init__.py", line 3, in <module> from .features import Feature, FeatureCollection # noqa ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/bitnami/python/lib/python3.11/site-packages/geojson_pydantic/features.py", line 8, in <module> from geojson_pydantic.geometries import Geometry File "/opt/bitnami/python/lib/python3.11/site-packages/geojson_pydantic/geometries.py", line 317, in <module> GeometryCollection.model_rebuild() File "/opt/bitnami/python/lib/python3.11/site-packages/pydantic/main.py", line 470, in model_rebuild return _model_construction.complete_model_class( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/bitnami/python/lib/python3.11/site-packages/pydantic/_internal/_model_construction.py", line 498, in complete_model_class cls.__pydantic_core_schema__ = schema = validate_core_schema(schema) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/bitnami/python/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 631, in validate_core_schema return _validate_core_schema(schema) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pydantic_core._pydantic_core.SchemaError: Invalid Schema: definitions.definitions.6.model.schema.model-fields.fields.geometries.schema.function-after.schema.list.items_schema.tagged-union.choices.GeometryCollection {"loglevel": "info", "workers": 1, "bind": "0.0.0.0:8000", "graceful_timeout": 120, "timeout": 120, "keepalive": 5, "errorlog": "-", "accesslog": "-", "workers_per_core": 1.5, "use_max_workers": null, "host": "0.0.0.0", "port": "8000"} {"loglevel": "info", "workers": 1, "bind": "0.0.0.0:8000", "graceful_timeout": 120, "timeout": 120, "keepalive": 5, "errorlog": "-", "accesslog": "-", "workers_per_core": 1.5, "use_max_workers": null, "host": "0.0.0.0", "port": "8000"} Recursion error - cyclic reference detected [type=recursion_loop, input_value={'type': 'model', 'cls': ...lection:94654473002400'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.4/v/recursion_loop [2023-09-26 13:59:08 +0000] [7] [INFO] Worker exiting (pid: 7) ...
I fixed titiler.core.pyproject.toml and solved it.
dependencies = [ ... "pydantic<2.4.0", ... ]
Application must start successfully.
I used docker container built by dockerfiles/Dockerfile.gunicorn
I'm on it over https://github.com/developmentseed/geojson-pydantic/issues/146 š
should be fine now š
Problem description
pydantic v2.4.0 released recently, and it seems to be causing an error.
error log:
I fixed titiler.core.pyproject.toml and solved it.
Expected Output
Application must start successfully.
Environment Information
I used docker container built by dockerfiles/Dockerfile.gunicorn