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-128717 / 24.10 / Add missing level to MemorySizeMismatchAlertClass #13647

Merged
merged 1 commit into from
May 2, 2024

Conversation

bmeagherix
Copy link
Contributor

@bmeagherix bmeagherix commented May 2, 2024

Class was created in PR #13285, but no level was set.

This caused the following error in CI tests:

FAILED api2/test_050_alert.py::test_02_get_alert_list_categories - AssertionError: {
   "message": "'NotImplementedType' object has no attribute 'name'",
   "traceback": "Traceback (most recent call last):\n  File \"/usr/lib/python3/dist-packages/middlewared/restful.py\", line 849, in do\n    result = await self.middleware.call_with_audit(methodname, serviceobj, methodobj, method_args,\n             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/lib/python3/dist-packages/middlewared/main.py\", line 1477, in call_with_audit\n    result = await self._call(method, serviceobj, methodobj, params, app=app,\n             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/lib/python3/dist-packages/middlewared/main.py\", line 1428, in _call\n    return await methodobj(*prepared_call.args)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/lib/python3/dist-packages/middlewared/schema/processor.py\", line 187, in nf\n    return await func(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/lib/python3/dist-packages/middlewared/schema/processor.py\", line 47, in nf\n    res = await f(*args, **kwargs)\n          ^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/lib/python3/dist-packages/middlewared/plugins/alert.py\", line 312, in list_categories\n    return [\n           ^\n  File \"/usr/lib/python3/dist-packages/middlewared/plugins/alert.py\", line 317, in <listcomp>\n    [\n  File \"/usr/lib/python3/dist-packages/middlewared/plugins/alert.py\", line 321, in <listcomp>\n    \"level\": alert_class.level.name,\n             ^^^^^^^^^^^^^^^^^^^^^^\nAttributeError: 'NotImplementedType' object has no attribute 'name'\n"

(then iterated over the AlertClass.classes to find the culprit.)

@bmeagherix bmeagherix added the jira label May 2, 2024
@bugclerk bugclerk changed the title Add missing level to MemorySizeMismatchAlertClass NAS-128717 / 24.10 / Add missing level to MemorySizeMismatchAlertClass May 2, 2024
@bugclerk
Copy link
Contributor

bugclerk commented May 2, 2024

@bmeagherix bmeagherix requested a review from yocalebo May 2, 2024 00:13
@bmeagherix
Copy link
Contributor Author

@yocalebo Chose you (specifically) for review to see whether you agree with the level added (WARNING).

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.

Surprised this hasn't been caught in 2 months 😳

@bmeagherix bmeagherix merged commit bb19f9a into master May 2, 2024
2 of 3 checks passed
@bmeagherix bmeagherix deleted the add_missing_alert_level branch May 2, 2024 00:18
@bugclerk
Copy link
Contributor

bugclerk commented May 2, 2024

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 May 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants