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

noble - filesystem: handle sorting disks without required metadata #2146

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

dbungert
Copy link
Collaborator

If there are at least two disks and one of them is missing any metadata used
during sorting installer will crash. Issue can be reproduced using already
available machine .json file: examples/machines/existing-partitions.json
in which /dev/vda does not have serial value.

This patch makes sure that all values used in sorting are initialized

2025-01-21 15:41:33,340 ERROR root:38 finish: subiquity/apply_autoinstall_config: FAIL: '<' not supported between instances of 'str' and 'NoneType'
2025-01-21 15:41:33,340 ERROR subiquity.server.server:503 top level error
Traceback (most recent call last):
  File "/home/rmalz/repos/subiquity/subiquity/server/server.py", line 1021, in start
    await self.apply_autoinstall_config()
  File "/home/rmalz/repos/subiquity/subiquitycore/context.py", line 165, in decorated_async
    return await meth(self, **kw)
  File "/home/rmalz/repos/subiquity/subiquity/server/server.py", line 575, in apply_autoinstall_config
    await controller.apply_autoinstall_config()
  File "/home/rmalz/repos/subiquity/subiquitycore/context.py", line 165, in decorated_async
    return await meth(self, **kw)
  File "/home/rmalz/repos/subiquity/subiquity/server/controllers/filesystem.py", line 484, in apply_autoinstall_config
    await self.convert_autoinstall_config(context=context)
  File "/home/rmalz/repos/subiquity/subiquitycore/context.py", line 165, in decorated_async
    return await meth(self, **kw)
  File "/home/rmalz/repos/subiquity/subiquity/server/controllers/filesystem.py", line 1745, in convert_autoinstall_config
    await self.run_autoinstall_guided(self.ai_data["layout"])
  File "/home/rmalz/repos/subiquity/subiquity/server/controllers/filesystem.py", line 1684, in run_autoinstall_guided
    disk = self.get_bootable_matching_disk(match)
  File "/home/rmalz/repos/subiquity/subiquity/server/controllers/filesystem.py", line 1594, in get_bootable_matching_disk
    matching_disks = self.get_bootable_matching_disks(match)
  File "/home/rmalz/repos/subiquity/subiquity/server/controllers/filesystem.py", line 1582, in get_bootable_matching_disks
    matching_disks = self.model.disks_for_match(disks, match)
  File "/home/rmalz/repos/subiquity/subiquity/models/filesystem.py", line 1800, in disks_for_match
    candidates, _ = self._matching_disks(disks, match)
  File "/home/rmalz/repos/subiquity/subiquity/models/filesystem.py", line 1791, in _matching_disks
    candidates = self._sorted_matches(candidates, m)
  File "/home/rmalz/repos/subiquity/subiquity/models/filesystem.py", line 1769, in _sorted_matches
    disks.sort(key=lambda d: d.sort_key)
TypeError: '<' not supported between instances of 'str' and 'NoneType'

Fixes: canonical#2050
(cherry picked from commit fbf6de2)
@ogayot ogayot changed the title filesystem: handle sorting disks without required metadata noble - filesystem: handle sorting disks without required metadata Jan 27, 2025
@ogayot ogayot merged commit 3a2f2cf into canonical:ubuntu/noble Jan 27, 2025
12 checks passed
@dbungert dbungert deleted the noble-sort-key branch January 27, 2025 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants