Bug 2358888

Summary: Occasional crash with "IndexError: list index out of range" on `return "" if not self.layouts_variants else self.layouts_variants[0]` in localed.py
Product: [Fedora] Fedora Reporter: Adam Williamson <awilliam>
Component: anacondaAssignee: anaconda-maint
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 42CC: anaconda-maint, jkonecny, kkoukiou, robatino, w
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-04-10 16:03:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2291265    

Description Adam Williamson 2025-04-10 15:52:41 UTC
openQA is occasionally seeing Workstation live installs crash with this rather odd traceback:
```
WARNING:dasbus.server.handler:The call org.fedoraproject.Anaconda.Modules.Localization.GetCompositorSelectedLayout has failed with an exception:
Traceback (most recent call last):
  File "/usr/lib/python3.13/site-packages/dasbus/server/handler.py", line 455, in _method_callback
    result = self._handle_call(
        interface_name,
    ...<2 lines>...
        **additional_args
    )
  File "/usr/lib/python3.13/site-packages/dasbus/server/handler.py", line 265, in _handle_call
    return handler(*parameters, **additional_args)
  File "/usr/lib64/python3.13/site-packages/pyanaconda/modules/localization/localization_interface.py", line 299, in GetCompositorSelectedLayout
    return self.implementation.get_compositor_selected_layout()
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib64/python3.13/site-packages/pyanaconda/modules/localization/localization.py", line 417, in get_compositor_selected_layout
    return self.localed_compositor_wrapper.current_layout_variant
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/site-packages/pyanaconda/modules/localization/localed.py", line 320, in current_layout_variant
    return "" if not self.layouts_variants else self.layouts_variants[0]
                                                ~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
```
I'm not sure how self.layouts_variants can be a truth-y list(? - the error message at least implies that it *is* a list), yet not have an element at zero. I'm going to investigate, though, cos it's intriguing!

We could probably fix this by turning it into a try/except block, but I'd love to know why it happens.

I think this is happening to about 1-2% of installs, it mixes in with https://bugzilla.redhat.com/show_bug.cgi?id=2358880 so it's hard to be totally sure of the proportion. Together they affect maybe 5% in openQA. I *think* this is webUI-specific - I can't find any case of it happening to a non-webUI install yet.

Proposing as a Final blocker as a conditional violation of "The installer must be able to complete an installation using any supported locally connected storage interface" and any other "install must complete" criterion, in the rare case that this bug happens, install fails.

Comment 1 Jiri Konecny 2025-04-10 16:03:34 UTC

*** This bug has been marked as a duplicate of bug 2357836 ***