Crash when unmounting cdrom

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

Bug Description

On the development version of Subiquity (currently 60d6746a41ee38a0ac775febe39768bafca9c808), the installation fails late in the process when unmounting /target/cdrom.

subprocess.CalledProcessError: Command '['systemd-run', '--wait', '--same-dir', '--property', 'SyslogIdentifier=subiquity_log.1561', '--setenv', 'PATH=/snap/subiquity/x1/bin:/snap/subiquity/x1/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/subiquity/x1/bin:/snap/subiquity/x1/sbin', '--setenv', 'PYTHONPATH=:/snap/subiquity/x1/lib/python3.8/site-packages', '--setenv', 'PYTHON=/snap/subiquity/x1/usr/bin/python3.8', '--setenv', 'SNAP=/snap/subiquity/x1', '--', 'umount', '/target/cdrom']' returned non-zero exit status 32.
2022-09-19 18:07:02,223 ERROR subiquity.server.server:422 top level error

After investigation, this seems to have been broken by this patch https://github.com/canonical/subiquity/commit/6d724c0a5be0ccbbf9e3b249e907aa2405993c69 which is part of PR 1417: https://github.com/canonical/subiquity/pull/1417

A partial revert of the patch fixes the issue:

https://pastebin.canonical.com/p/pB6jSf6BTf/

This could be caused by two processes (e.g., Subiquity & curtin?) trying to unmount cdrom. To be investigated further.

Revision history for this message
Olivier Gayot (ogayot) wrote :
Revision history for this message
Olivier Gayot (ogayot) wrote :

As shown below, we attempt to unmount the cdrom twice:

2022-09-20 08:35:59,483 DEBUG subiquitycore.utils:114 astart_command called: ['systemd-run', '--wait', '--same-dir', '--property', 'SyslogIdentifier=subiquity_log.1973', '--setenv', 'PATH=/snap/subiquity/x1/bin:/snap/subiquity/x1/usr/bin:/usr/local/sbin:/
usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/subiquity/x1/bin:/snap/subiquity/x1/sbin', '--setenv', 'PYTHONPATH=:/snap/subiquity/x1/lib/python3.8/site-packages', '--setenv', 'PYTHON=/snap/subiquity/x1/usr/bin/pyt
hon3.8', '--setenv', 'SNAP=/snap/subiquity/x1', '--', 'umount', '/target/cdrom']
[...]
2022-09-20 08:36:04,159 DEBUG subiquitycore.utils:114 astart_command called: ['systemd-run', '--wait', '--same-dir', '--property', 'SyslogIdentifier=subiquity_log.1973', '--setenv', 'PATH=/snap/subiquity/x1/bin:/snap/subiquity/x1/usr/bin:/usr/local/sbin:/
usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/subiquity/x1/bin:/snap/subiquity/x1/sbin', '--setenv', 'PYTHONPATH=:/snap/subiquity/x1/lib/python3.8/site-packages', '--setenv', 'PYTHON=/snap/subiquity/x1/usr/bin/pyt
hon3.8', '--setenv', 'SNAP=/snap/subiquity/x1', '--', 'umount', '/target/cdrom']

We do it once explicitly and then a second time in the self.cleanup() method.

        await self.unmount(
                Mountpoint(mountpoint=target_mnt.p('cdrom')),
                remove=False)
        os.rmdir(target_mnt.p('cdrom'))

        await _restore_dir('etc/apt')

        if self.app.base_model.network.has_network:
            await run_curtin_command(
                self.app, context, "in-target", "-t", target_mnt.p(),
                "--", "apt-get", "update", private_mounts=True)
        else:
            await _restore_dir('var/lib/apt/lists')

        await self.cleanup()

Revision history for this message
Olivier Gayot (ogayot) wrote :
Changed in subiquity (Ubuntu):
status: New → In Progress
Simon Chopin (schopin)
Changed in subiquity (Ubuntu):
importance: Undecided → High
tags: added: foundations-todo
Olivier Gayot (ogayot)
Changed in subiquity (Ubuntu):
status: In Progress → Fix Committed
Changed in subiquity (Ubuntu):
assignee: nobody → Olivier Gayot (ogayot)
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.

Changed in subiquity (Ubuntu):
status: Fix Committed → Fix Released
Benjamin Drung (bdrung)
tags: removed: foundations-todo
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.