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

NAS-132669 / 25.04 / Make parse_message ensure that the message is a dict #15377

Merged
merged 4 commits into from
Jan 13, 2025

Conversation

themylogin
Copy link
Contributor

The following traceback occurred when the message was []:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/aiohttp/web_protocol.py", line 477, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/aiohttp/web_app.py", line 559, in _handle
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/aiohttp/web_middlewares.py", line 105, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/aiohttp/web_urldispatcher.py", line 210, in handler_wrapper
    result = await result
             ^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/api/base/server/ws_handler/base.py", line 32, in __call__
    await self.process(origin, ws)
  File "/usr/lib/python3/dist-packages/middlewared/api/base/server/ws_handler/rpc.py", line 211, in process
    message = parse_message(app.authenticated, msg.data)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/utils/limits.py", line 74, in parse_message
    if (method := message.get('method')) in MSG_SIZE_EXTENDED_METHODS:
                  ^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'get'

@themylogin themylogin requested a review from a team January 13, 2025 16:32
@themylogin
Copy link
Contributor Author

time 1:00

@bugclerk
Copy link
Contributor

@bugclerk bugclerk changed the title Make parse_message ensure that the message is a dict NAS-132669 / 25.04 / Make parse_message ensure that the message is a dict Jan 13, 2025
Copy link
Contributor

@yocalebo yocalebo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While the attribute error is good to know, I'd rather indicate that JSON-RPC supports batch messages but we're not supporting that at the moment.

@themylogin themylogin requested a review from yocalebo January 13, 2025 17:12
Copy link
Contributor

@yocalebo yocalebo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@themylogin themylogin merged commit e70d39b into master Jan 13, 2025
2 checks passed
@themylogin themylogin deleted the NAS-132669 branch January 13, 2025 17:53
@bugclerk
Copy link
Contributor

This PR has been merged and conversations have been locked.
If you would like to discuss more about this issue please use our forums or raise a Jira ticket.

@truenas truenas locked as resolved and limited conversation to collaborators Jan 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants