Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[24.0] Fix optional types in Help Forum API #17832

Conversation

davelopez
Copy link
Contributor

Fixes:

Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]: [2024-03-25 13:30:21 +0100] [2734708] [ERROR] Exception in ASGI application
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]: Traceback (most recent call last):
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 412, in run_asgi
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     result = await app(  # type: ignore[func-returns-value]
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     return await self.app(scope, receive, send)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     await super().__call__(scope, receive, send)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/sentry_sdk/integrations/starlette.py", line 364, in _sentry_patched_asgi_app
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     return await middleware(scope, receive, send)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/sentry_sdk/integrations/asgi.py", line 146, in _run_asgi3
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     return await self._run_app(scope, receive, send, asgi_version=3)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/sentry_sdk/integrations/asgi.py", line 241, in _run_app
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     raise exc from None
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/sentry_sdk/integrations/asgi.py", line 234, in _run_app
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     return await self.app(
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:            ^^^^^^^^^^^^^^^
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     await self.middleware_stack(scope, receive, send)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/sentry_sdk/integrations/starlette.py", line 157, in _create_span_call
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     return await old_call(app, scope, new_receive, new_send, **kwargs)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     raise exc
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     await self.app(scope, receive, _send)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/sentry_sdk/integrations/starlette.py", line 157, in _create_span_call
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     return await old_call(app, scope, new_receive, new_send, **kwargs)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/starlette_context/middleware/raw_middleware.py", line 92, in __call__
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     await self.app(scope, receive, send_wrapper)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/sentry_sdk/integrations/starlette.py", line 256, in _sentry_exceptionmiddleware_call
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     await old_call(self, scope, receive, send)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/sentry_sdk/integrations/starlette.py", line 157, in _create_span_call
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     return await old_call(app, scope, new_receive, new_send, **kwargs)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     raise exc
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     await app(scope, receive, sender)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/starlette/routing.py", line 758, in __call__
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     await self.middleware_stack(scope, receive, send)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/starlette/routing.py", line 778, in app
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     await route.handle(scope, receive, send)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/starlette/routing.py", line 299, in handle
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     await self.app(scope, receive, send)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/starlette/routing.py", line 79, in app
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     raise exc
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     await app(scope, receive, sender)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/starlette/routing.py", line 74, in app
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     response = await func(request)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:                ^^^^^^^^^^^^^^^^^^^
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/sentry_sdk/integrations/fastapi.py", line 134, in _sentry_app
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     return await old_app(*args, **kwargs)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     raw_response = await run_endpoint_function(
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/fastapi/routing.py", line 193, in run_endpoint_function
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     return await run_in_threadpool(dependant.call, **values)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/starlette/concurrency.py", line 42, in run_in_threadpool
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     return await anyio.to_thread.run_sync(func, *args)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_sync
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     return await get_async_backend().run_sync_in_worker_thread(
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2144, in run_sync_in_worker_thread
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     return await future
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:            ^^^^^^^^^^^^
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 851, in run
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     result = context.run(func, *args)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:              ^^^^^^^^^^^^^^^^^^^^^^^^
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/sentry_sdk/integrations/fastapi.py", line 88, in _sentry_call
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     return old_call(*args, **kwargs)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:            ^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/server/lib/galaxy/webapps/galaxy/api/help.py", line 38, in search_forum
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     return self.service.search_forum(query)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/server/lib/galaxy/webapps/galaxy/services/help.py", line 44, in search_forum
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     return HelpForumSearchResponse(**response.json())
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   File "/opt/galaxy/venv/lib/python3.11/site-packages/pydantic/main.py", line 171, in __init__
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     self.__pydantic_validator__.validate_python(data, self_instance=self)
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]: pydantic_core._pydantic_core.ValidationError: 1 validation error for HelpForumSearchResponse
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]: topics
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:   Field required [type=missing, input_value={'posts': [], 'users': []...': [], 'group_ids': []}}, input_type=dict]
Mar 25 13:30:21 sn06.galaxyproject.eu gunicorn[2578811]:     For further information visit https://errors.pydantic.dev/2.6/v/missing

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

@davelopez davelopez added this to the 24.0 milestone Mar 25, 2024
@mvdbeek mvdbeek merged commit 5e770d5 into galaxyproject:release_24.0 Mar 25, 2024
49 of 51 checks passed
@davelopez davelopez deleted the 24.0_fix_optional_types_in_help_api branch March 25, 2024 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants