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-129354 / 24.10 / Make sure vendor key exists before trying string operation #13827

Merged
merged 1 commit into from
Jun 2, 2024

Conversation

Qubad786
Copy link
Contributor

@Qubad786 Qubad786 commented Jun 2, 2024

Problem

[2024/06/02 12:00:37] (ERROR) DiskService.update():32 - update_smartctl_args_for_disks failed
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/middlewared/plugins/disk_/smartctl.py", line 27, in update
    await asyncio_map(
  File "/usr/lib/python3/dist-packages/middlewared/utils/asyncio_.py", line 19, in asyncio_map
    return await asyncio.gather(*futures)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/utils/asyncio_.py", line 16, in func
    return await real_func(arg)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/common/smart/smartctl.py", line 30, in get_smartctl_args
    if device["vendor"].lower().strip() == "nvme":
       ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'lower'

Solution

Make sure vendor key has an actual value before treating it as a string.

@Qubad786 Qubad786 added the jira label Jun 2, 2024
@Qubad786 Qubad786 requested a review from a team June 2, 2024 19:05
@bugclerk
Copy link
Contributor

bugclerk commented Jun 2, 2024

@bugclerk bugclerk changed the title Make sure vendor key exists before trying string operation NAS-129354 / 24.10 / Make sure vendor key exists before trying string operation Jun 2, 2024
@truenas truenas deleted a comment from bugclerk Jun 2, 2024
@Qubad786 Qubad786 merged commit c6a5250 into master Jun 2, 2024
3 checks passed
@Qubad786 Qubad786 deleted the mrehan/fix-nvme-vendor-issue branch June 2, 2024 23:19
@bugclerk
Copy link
Contributor

bugclerk commented Jun 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 Jun 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