late-commands crashes when cat'ing /target/boot/grub/grub.cfg

Bug #2060312 reported by Guillaume

This bug report will be marked for expiration in 41 days if no further activity occurs. (find out why)

6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
subiquity
Incomplete
Undecided
Unassigned

Bug Description

Near the end of the late-commands section in autoinstall.yaml, subiquity crashes with a simple cat :
systemd-cat --level-prefix=false --identifier=subiquity_log.2105 sh -c cat '/target/boot/grub/grub.cfg' > /dev/console

It's just to debug, so disabling this command is enough to keep it going, but since it was working well with 22.04, i can't understand why it fails with 24.04 :
2024-04-05 07:28:14,431 DEBUG subiquitycore.utils:119 arun_command called: ['systemd-cat', '--level-prefix=false', '--identifier=subiquity_log.2105', 'sh', '-c', "cat '/target/boot/grub/grub.cfg' > /dev/console "]
2024-04-05 07:28:14,450 DEBUG subiquitycore.utils:133 arun_command ['systemd-cat', '--level-prefix=false', '--identifier=subiquity_log.2105', 'sh', '-c', "cat '/target/boot/grub/grub.cfg' > /dev/console "] exited with code 1
2024-04-05 07:28:14,450 ERROR root:30 finish: subiquity/Late/run/command_15: FAIL: Command '['systemd-cat', '--level-prefix=false', '--identifier=subiquity_log.2105', 'sh', '-c', "cat '/target/boot/grub/grub.cfg' > /dev/console "]' returned non-zero exit status 1.
2024-04-05 07:28:14,450 ERROR root:30 finish: subiquity/Late/run: FAIL: Command '['systemd-cat', '--level-prefix=false', '--identifier=subiquity_log.2105', 'sh', '-c', "cat '/target/boot/grub/grub.cfg' > /dev/console "]' returned non-zero exit status 1.
2024-04-05 07:28:14,451 ERROR subiquity.server.server:426 top level error
Traceback (most recent call last):
  File "/snap/subiquity/5645/lib/python3.10/site-packages/subiquity/server/controllers/cmdlist.py", line 139, in _run
    await self.run()
  File "/snap/subiquity/5645/lib/python3.10/site-packages/subiquitycore/context.py", line 149, in decorated_async
    return await meth(self, **kw)
  File "/snap/subiquity/5645/lib/python3.10/site-packages/subiquity/server/controllers/cmdlist.py", line 90, in run
    await arun_command(
  File "/snap/subiquity/5645/lib/python3.10/site-packages/subiquitycore/utils.py", line 137, in arun_command
    raise subprocess.CalledProcessError(proc.returncode, cmd, stdout, stderr)
subprocess.CalledProcessError: Command '['systemd-cat', '--level-prefix=false', '--identifier=subiquity_log.2105', 'sh', '-c', "cat '/target/boot/grub/grub.cfg' > /dev/console "]' returned non-zero exit status 1.
2024-04-05 07:28:14,475 DEBUG subiquity.common.errorreport:398 generating crash report
2024-04-05 07:28:14,476 INFO subiquity.common.errorreport:424 saving crash report 'unknown error crashed with CalledProcessError' to /var/crash/1712302094.475684404.unknown.crash
2024-04-05 07:28:14,476 INFO root:30 start: subiquity/ErrorReporter/1712302094.475684404.unknown/add_info:
2024-04-05 07:28:15,487 INFO root:30 finish: subiquity/ErrorReporter/1712302094.475684404.unknown/add_info: SUCCESS: written to /var/crash/1712302094.475684404.unknown.crash

Revision history for this message
Guillaume (e1msih) wrote :
description: updated
Guillaume (e1msih)
summary: - Subiquity crashes with ubuntu 24.04 daily build and cat in late-commands
+ Subiquity crashes with noble daily build and cat in late-commands
Revision history for this message
Chris Peterson (cpete) wrote : Re: Subiquity crashes with noble daily build and cat in late-commands

Based on the error I'm going to guess /target/boot/grub/grub.cfg isn't available yet by the time the command is run. Could you make do with something like this instead?:

  late-commands:
    - while [ ! -f /target/boot/grub/grub.cfg ] ; do sleep 1 ; done
    - cat /target/boot/grub/grub.cfg > /dev/console

FWIW I did a simple autoinstall in a VM with just the above cat command and I couldn't reproduce the issue.

Changed in subiquity:
status: New → Incomplete
Chris Peterson (cpete)
summary: - Subiquity crashes with noble daily build and cat in late-commands
+ late-commands crashes when cat'ing /target/boot/grub/grub.cfg
Revision history for this message
Guillaume (e1msih) wrote :

I can, of course.
Thanks for looking into it.

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

Other bug subscribers

Bug attachments

Remote bug watches

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