Hanging after "Update successful, rebooting"

Hello everyone,

I am stuck with an strange error and praying for your help here.

We are trying to integrate BalenaOS with a custom board having already produced several image versions that are visible and manageable from balenaCloud, no problem with this.

Currently, our last image is based on BalenaOS 2.113.32 with BalenaSupervisor 14.9.8.
Also have images for 2.113.24 and 2.113.27

The problem comes when we try a balenaOS Update. The process seems to be correct but it hangs at the very end with the message “Update successful, rebooting” and it do nothing else.
Nevertheless, the update process has been indeed successful because if I reboot manually the device, either locally or through remote terminal, the upgrade is OK.

I’ve searched journalctl -xf for problems and found this errors:

balena-supervisor[1967]: [error]   Scheduling another update attempt in 900000ms due to failure:  Error: Failed to apply state transition steps. (HTTP code 500) server error - AppArmor e:
0cc7b1cc27e5[1321]: [error]     error: exec: "apparmor_parser": executable file not found in $PATH  Steps:["start"]
balena-supervisor[1967]: [error]     error: exec: "apparmor_parser": executable file not found in $PATH  Steps:["start"]
balena-supervisor[1967]: [error]       at fn (/usr/src/app/dist/app.js:10:9304)
balena-supervisor[1967]: [error]       at runMicrotasks (<anonymous>)
balena-supervisor[1967]: [error]       at processTicksAndRejections (node:internal/process/task_queues:96:5)
0cc7b1cc27e5[1321]: [error]       at fn (/usr/src/app/dist/app.js:10:9304)
0cc7b1cc27e5[1321]: [error]       at runMicrotasks (<anonymous>)
0cc7b1cc27e5[1321]: [error]       at processTicksAndRejections (node:internal/proce

Any idea on this? Do you think this AppArmor error may be related to it?
I’ve found an AppArmor related change in here which I don’t know if is the source for this problem.

Any help would be much appreciated.

BR

So the reboot command from the hostOS works ok and reboots the board as expected?

Also, can you paste the output of dmesg -T please?

reboot command works well both from the hostOS CLI or the remote CLI through balenaCloud dashboard.
Please find attached the output from dmesg and also device diagnostics.
d8a2b5c65b30893c766e3cb3ae576cde_diagnostics_2023.03.29_12.46.20+0000.txt (498.7 KB)
dmesg_T.log (43.0 KB)

I see this: systemd-run: command not found
Can you include it in the host OS and try again?

That seems to fix it! For the moment I just installed the program systemd-run manually and it ran the update like a charm! I am producing a PR to include the needed modifications and upload it to the repo.

Thanks for the support Florin!