GRAAL-Research / deepparse

Deepparse is a state-of-the-art library for parsing multinational street addresses using deep learning
https://deepparse.org/
GNU Lesser General Public License v3.0
299 stars 30 forks source link

Sentry could not be initialized in the new 0.9.10 docker image #231

Closed valentinschabschneider closed 4 months ago

valentinschabschneider commented 4 months ago

Describe the bug

When using the new ghcr.io/graal-research/deepparse:0.9.10 docker image the following error occurs.

app-1  | Traceback (most recent call last):
app-1  |   File "/usr/local/bin/uvicorn", line 8, in <module>
app-1  |     sys.exit(main())
app-1  |              ^^^^^^
app-1  |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
app-1  |     return self.main(*args, **kwargs)
app-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1078, in main
app-1  |     rv = self.invoke(ctx)
app-1  |          ^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
app-1  |     return ctx.invoke(self.callback, **ctx.params)
app-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
app-1  |     return __callback(*args, **kwargs)
app-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 410, in main
app-1  |     run(
app-1  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 578, in run
app-1  |     server.run()
app-1  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 61, in run
app-1  |     return asyncio.run(self.serve(sockets=sockets))
app-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
app-1  |     return runner.run(main)
app-1  |            ^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
app-1  |     return self._loop.run_until_complete(task)
app-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
app-1  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 68, in serve
app-1  |     config.load()
app-1  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/config.py", line 473, in load
app-1  |     self.loaded_app = import_from_string(self.app)
app-1  |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 21, in import_from_string
app-1  |     module = importlib.import_module(module_str)
app-1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
app-1  |     return _bootstrap._gcd_import(name[level:], package, level)
app-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
app-1  |   File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
app-1  |   File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
app-1  |   File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
app-1  |   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
app-1  |   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
app-1  |   File "/deepparse/app/app.py", line 24, in <module>
app-1  |     configure_sentry()
app-1  |   File "/deepparse/app/sentry.py", line 12, in configure_sentry
app-1  |     sentry_sdk.init(
app-1  |   File "/usr/local/lib/python3.11/site-packages/sentry_sdk/hub.py", line 132, in _init
app-1  |     client = Client(*args, **kwargs)  # type: ignore
app-1  |              ^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/site-packages/sentry_sdk/client.py", line 142, in __init__
app-1  |     self.options = get_options(*args, **kwargs)  # type: Dict[str, Any]
app-1  |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/site-packages/sentry_sdk/client.py", line 89, in _get_options
app-1  |     raise TypeError("Unknown option %r" % (key,))
app-1  | TypeError: Unknown option 'max_request_body_size'

To Reproduce Run the provided docker-compose.yml with the ghcr.io/graal-research/deepparse:0.9.10 image.

Expected behavior The container starts normally

github-actions[bot] commented 4 months ago

Thank you for you interest in improving Deepparse.

valentinschabschneider commented 4 months ago

My guess is that the sentry package version also needs to be updated in setup.py.

davebulaval commented 4 months ago

A mismatched version in the setup seems to have caused the problem, fixed in 0.9.11.