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] Adds logging of messageExceptions in the fastapi exception handler. #18041

Merged
merged 7 commits into from
May 3, 2024

Conversation

dannon
Copy link
Member

@dannon dannon commented Apr 22, 2024

We're intentionally not doing a full log.exception with the traceback here, though we could. This exception will also be dispatched to Sentry if configured, this just makes logs less opaque when one sees a 500.

Ping @natefoo -- this will now show something like this, so you at least know what the error was from the logs.

galaxy.webapps.base.api ERROR 2024-04-22 17:36:23,219 [pN:main.1,p:10417,tN:MainThread] MessageException: PDF conversion service not available.
uvicorn.access INFO 2024-04-22 17:36:23,221 [pN:main.1,p:10417,tN:MainThread] 127.0.0.1:44056 - "GET /api/invocations/79966582feb6c081/report.pdf HTTP/1.1" 501

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.

@dannon
Copy link
Member Author

dannon commented Apr 23, 2024

Test failure is legit -- MessageException has a __str__ method that can actually return a dict, which is not great. I'll dig through and address one end or the other of that. Need to review all use of it, but it feels like we should clean up the typing here and enforce a string primary message input for these.

@jmchilton
Copy link
Member

xref https://github.com/galaxyproject/galaxy/pull/15868/files

@dannon
Copy link
Member Author

dannon commented Apr 23, 2024

xref https://github.com/galaxyproject/galaxy/pull/15868/files

Unfortunate to have wasted some time tracking down the same issues a year later. So... still draft?

lib/galaxy/exceptions/__init__.py Outdated Show resolved Hide resolved
lib/galaxy/exceptions/__init__.py Outdated Show resolved Hide resolved
lib/galaxy/exceptions/__init__.py Outdated Show resolved Hide resolved
@dannon dannon marked this pull request as ready for review April 24, 2024 15:35
@github-actions github-actions bot added this to the 24.1 milestone Apr 24, 2024
@mvdbeek
Copy link
Member

mvdbeek commented May 1, 2024

There's another conflict @dannon, and do you want to target 24.0 ? d8951c4 fixes a bug that leads to the default error message (Request failed., which isn't super helpful) being shown in

Workflow submission failed: {{ submissionError }}

@dannon
Copy link
Member Author

dannon commented May 1, 2024

@mvdbeek Sure, I'll rebase and retarget.

We're intentionally not doing a full log.exception with the traceback
here, though we could.  This exception will also be dispatched to Sentry
if configured, this just makes logs less opaque when one sees a 500.
@dannon dannon changed the base branch from dev to release_24.0 May 1, 2024 15:00
@dannon dannon changed the title Adds logging of messageExceptions in the fastapi exception handler. [24.0] Adds logging of messageExceptions in the fastapi exception handler. May 1, 2024
@mvdbeek mvdbeek merged commit 0a784e4 into galaxyproject:release_24.0 May 3, 2024
43 of 49 checks passed
@galaxyproject galaxyproject deleted a comment from github-actions bot May 3, 2024
@jdavcs jdavcs removed this from the 24.1 milestone May 23, 2024
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.

4 participants