"Try again" mechanism for snaplist comes with no guarantee that snaps will be installed

Bug #1989179 reported by Olivier Gayot
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
subiquity (Ubuntu)
Fix Released
Undecided
Olivier Gayot

Bug Description

When reaching the snaps selection section, some scenarios will cause Subiquity to show the following message:

▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
 Featured Server Snaps [ Help ]
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Sorry, loading snaps from the store failed.

                 [ Try again ]
                 [ Continue ]

If the error was caused by something temporary, the list of snaps might load successfully after hitting "Try again". And if it does, the user can then select snaps to install.

The problem is that when subiquity shows this "Try again" window, the server has already marked the snaplist model configured. Therefore, the installation may or may not have already generated the cloud-config configuration by the time the user selects the snaps they want to get installed.

If the cloud-config was already generated, the snaps selected by the user are ignored and do not get installed by cloud-init.

Technical details:
GET /snaplist will mark the snaplist model configured if the result is FAILED.

subiquity/server/controllers/snaplist.py

    async def GET(self, wait: bool = False) -> SnapListResponse:
        if self.loader.failed or not self.app.base_model.network.has_network:
            await self.configured()
            return SnapListResponse(status=SnapCheckState.FAILED)
        if not self.loader.snap_list_fetched and not wait:
            return SnapListResponse(status=SnapCheckState.LOADING)
        await self.loader.get_snap_list_task().wait()
        if self.loader.failed or not self.app.base_model.network.has_network:
            await self.configured()
            return SnapListResponse(status=SnapCheckState.FAILED)
        return SnapListResponse(
            status=SnapCheckState.DONE,
            snaps=self.model.get_snap_list(),
            selections=self.model.selections)

IMO it makes sense to allow the user/client to retry (or at least decide what to do) when this type of error (generally caused by the network) is encountered. If we want to keep a retry mechanism in place, we should not mark the models configured automatically - especially the last one.

Olivier Gayot (ogayot)
Changed in subiquity (Ubuntu):
assignee: nobody → Olivier Gayot (ogayot)
status: New → In Progress
Revision history for this message
Olivier Gayot (ogayot) wrote :
Olivier Gayot (ogayot)
Changed in subiquity (Ubuntu):
status: In Progress → Fix Committed
Olivier Gayot (ogayot)
Changed in subiquity (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Dan Bungert (dbungert) wrote :

We believe this issue has been resolved in Subiquity 23.04.2.

If you had tested this with a pre-final version of Ubuntu 23.04, it's
recommended to download the final install media.

For testing with Ubuntu Server 22.04.x or 20.04.x, when running
Subiquity, you should offered a new version of the installer. Please
take that update to version 23.04.2 or later to get the fix.

If this is still a problem for you, please make a comment and set the state
back to New. Thank you for the bug report.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.