Thanks for using the TrueNAS Community Edition issue tracker! TrueNAS Enterprise users receive direct support for their reports from our support portal.

fix disk.sync_all edge-case crash

Description

25.04 PR: https://github.com/truenas/middleware/pull/14847

I was made aware of an internal system that had been upgraded to 24.10.0 and disks weren't showing up. After investigation I found that `disk.sync_all` was crashing with this error:
```
File "/usr/lib/python3/dist-packages/middlewared/plugins/enclosure.py", line 367, in _init_
enclosure = Enclosure(num, data, stat, product_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/middlewared/plugins/enclosure.py", line 415, in _init_
self._parse(data)
File "/usr/lib/python3/dist-packages/middlewared/plugins/enclosure.py", line 426, in _parse
self.map_disks_to_enclosure_slots(is_hseries)
File "/usr/lib/python3/dist-packages/middlewared/plugins/enclosure.py", line 549, in map_disks_to_enclosure_slots
self.append(info)
File "/usr/lib/python3/dist-packages/middlewared/plugins/enclosure.py", line 620, in append
if element.name not in self.__elementsbyname:
^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'name'
```
This is happening because this internal system is connected to an EOL piece of hardware that we haven't sold in many, many years. The error is an edge-case so we'll fix it because `disk.sync_all` hasn't been converted to using the new enclosure code.

Problem/Justification

None

Impact

None

Activity

Show:

Bug Clerk November 1, 2024 at 5:42 PM

This issue has now been closed. Comments made after this point may not be viewed by the TrueNAS Teams. Please open a new issue if you have found a problem or need to re-engage with the TrueNAS Engineering Teams.

Bug Clerk November 1, 2024 at 5:41 PM

This issue has now been closed. Comments made after this point may not be viewed by the TrueNAS Teams. Please open a new issue if you have found a problem or need to re-engage with the TrueNAS Engineering Teams.

Bug Clerk November 1, 2024 at 5:40 PM

Bug Clerk November 1, 2024 at 5:40 PM

Complete
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Time remaining

0m

Components

Priority

Katalon Platform

Created November 1, 2024 at 5:29 PM
Updated November 5, 2024 at 9:03 PM
Resolved November 1, 2024 at 5:41 PM