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

Fix server error from DAB ValidationError with strings #15312

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

AlanCoding
Copy link
Member

@AlanCoding AlanCoding commented Jun 29, 2024

SUMMARY

Took me a while to process, msg_data is not what gets used in the response. It is only used for a log message. This threw errors when DAB code raise ValidationError('foo'), because of a baked-in assumption that when it gets a list (this is converted to a list of element 1) it is a list of dictionaries.

I'm not defending the specific error formatting in these cases, but that's a different subject. This fixes the server error that comes from logic to build a log message that doesn't even go in the response. However we format the error, we should not return a 500.

AAP-25540

MORE CONTEXT:

This is happening because we have a DAB view (role user assignment list) which re-parents itself under the main AWX generic API view. It's weird. This allows DAB views to inherit request finalization logic (like this) but also can expose corner cases from assumptions that were always true in AWX but not always true generally.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • API

@AlanCoding AlanCoding merged commit 98bbc83 into ansible:devel Jul 1, 2024
23 checks passed
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