Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Autoreset issues on RPi #1767

Closed
2 tasks done
mauromorales opened this issue Aug 25, 2023 · 15 comments · Fixed by kairos-io/kairos-agent#144
Closed
2 tasks done

🐛 Autoreset issues on RPi #1767

mauromorales opened this issue Aug 25, 2023 · 15 comments · Fixed by kairos-io/kairos-agent#144
Assignees
Labels
ARM bug Something isn't working

Comments

@mauromorales
Copy link
Member

mauromorales commented Aug 25, 2023

tested ubuntu v2.4.0-alpha3 on RPi4

  • process seems to finish but it doesn't auto reboot neither returns to a terminal
  • GRUB characters are broken afterwards

BB0B3765-7A1E-4397-9FC7-E30FCCAD56E9_1_105_c

@mauromorales mauromorales added bug Something isn't working ARM labels Aug 25, 2023
@jimmykarily
Copy link
Contributor

Maybe related? #1723

@jimmykarily jimmykarily moved this from Todo 🖊 to In Progress 🏃 in 🧙Issue tracking board Sep 11, 2023
@jimmykarily jimmykarily moved this from In Progress 🏃 to Todo 🖊 in 🧙Issue tracking board Sep 11, 2023
@Itxaka Itxaka mentioned this issue Sep 11, 2023
29 tasks
@Itxaka
Copy link
Member

Itxaka commented Sep 11, 2023

I saw broken characters from the start, the issue seems to be the change between gftxterm and normal, which produces 2 alternating outputs via the same terminal.

Autoreset is correct as the kairos-reset service does not have the reboot flag or the unattended flag.

@Itxaka
Copy link
Member

Itxaka commented Sep 11, 2023

For the autoreset: kairos-io/packages#419

@Itxaka
Copy link
Member

Itxaka commented Sep 12, 2023

autoreset is now fixed by the patch above.

Grub characters indeed are broken, looks like some files are missing when doing the reset, to be copied, modules maybe as this are the only ones copied over:

https://github.com/kairos-io/kairos-agent/blob/main/pkg/utils/grub.go#L137

I saw some messages about files missing when grub loads, but its impossible to capture the moment as it gets erased...

@Itxaka
Copy link
Member

Itxaka commented Sep 12, 2023

grub> loadfont unicode
error: ../../grub-core/fs/fshelp.c:257:file `/grub2/fonts/unicode.pf2' not
found.
grub> 

we missing copying that into the fonts dir (fonts dir doesnt even exist)

@Itxaka Itxaka moved this from Todo 🖊 to Under review 🔍 in 🧙Issue tracking board Sep 13, 2023
@Itxaka Itxaka linked a pull request Sep 13, 2023 that will close this issue
@Itxaka Itxaka self-assigned this Sep 13, 2023
@github-project-automation github-project-automation bot moved this from Under review 🔍 to Done ✅ in 🧙Issue tracking board Sep 13, 2023
@Itxaka Itxaka reopened this Sep 13, 2023
@github-project-automation github-project-automation bot moved this from Done ✅ to Under review 🔍 in 🧙Issue tracking board Sep 13, 2023
@Itxaka
Copy link
Member

Itxaka commented Sep 13, 2023

Needs confirmation

@jimmykarily
Copy link
Contributor

  • I built an image from master (commit sha: 91b652b3)
  • I run kairos-agent --debug reset and I got this error:
INFO[2023-09-14T09:37:02Z] Unmounting disk partitions                   
DEBU[2023-09-14T09:37:02Z] Not unmounting partition, /run/cos/state doesn't look like mountpoint 
DEBU[2023-09-14T09:37:02Z] Not unmounting partition, /run/cos/persistent doesn't look like mountpoint 
DEBU[2023-09-14T09:37:02Z] Not unmounting partition, /run/cos/oem doesn't look like mountpoint 
DEBU[2023-09-14T09:37:02Z] Not unmounting partition, /run/cos/efi doesn't look like mountpoint 
INFO[2023-09-14T09:37:02Z] Formatting 'state' partition                 
DEBU[2023-09-14T09:37:02Z] Running cmd: 'mkfs.ext4 -L COS_STATE /dev/mmcblk0p2' 
1 error occurred:
        * exit status 1
  • I run the failed command manually and it seems that there is prompt that makes it fail:
root@cos-recovery:/home/kairos# mkfs.ext4 -L COS_STATE /dev/mmcblk0p2
mke2fs 1.47.0 (5-Feb-2023)
/dev/mmcblk0p2 contains a ext4 file system labelled 'COS_STATE'
        last mounted on /run/initramfs/cos-state on Fri Aug 18 18:15:41 2023
Proceed anyway? (y,N) 
  • I answered y and let it finish
  • I run kairos-agent --debug reset again and this time it went through
  • I rebooted

fonts in grub looks fine.

So the font issue is gone but we have another issue with mkfs. We probably need to pass some flag to avoid prompts.

@jimmykarily
Copy link
Contributor

There is the -F flag for mkfs.ext4 that skips prompts. We should probably use it.

@Itxaka
Copy link
Member

Itxaka commented Sep 14, 2023

That is kind of weird... it should affect x86 as well unless state is somehow
different on RPI....

@Itxaka
Copy link
Member

Itxaka commented Sep 14, 2023

Looks like it's mounted on s different place to what reset tries to unmount...

@jimmykarily
Copy link
Contributor

output:

INFO[2023-09-14T10:07:29Z] Unmounting disk partitions                   
DEBU[2023-09-14T10:07:29Z] Not unmounting partition, /run/cos/state doesn't look like mountpoint 
DEBU[2023-09-14T10:07:29Z] Not unmounting partition, /run/cos/persistent doesn't look like mountpoint 
DEBU[2023-09-14T10:07:29Z] Not unmounting partition, /run/cos/oem doesn't look like mountpoint 
DEBU[2023-09-14T10:07:29Z] Not unmounting partition, /run/cos/efi doesn't look like mountpoint 
INFO[2023-09-14T10:07:29Z] Formatting 'state' partition                 
DEBU[2023-09-14T10:07:29Z] Running cmd: 'mkfs.ext4 -L COS_STATE /dev/mmcblk0p2' 
1 error occurred:
        * exit status 1

mounts:

kairos@cos-recovery:~$ lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
loop0         7:0    0  2.6G  1 loop /
mmcblk0     179:0    0 59.7G  0 disk 
├─mmcblk0p1 179:1    0   96M  0 part 
├─mmcblk0p2 179:2    0  7.9G  0 part 
├─mmcblk0p3 179:3    0  5.3G  0 part /run/initramfs/cos-state
├─mmcblk0p4 179:4    0   64M  0 part /oem
└─mmcblk0p5 179:5    0   64M  0 part 

@jimmykarily
Copy link
Contributor

Running sudo su before kairos-agent reset makes it work. I'll try once with just sudo . I think that one failed once but I need to re-try to be sure.

@jimmykarily
Copy link
Contributor

sudo kairos-agent reset also works. It was simple after all. I just needed permissions. It would be nice if we showed a better message though. I will check if that's possible.

@Itxaka
Copy link
Member

Itxaka commented Sep 14, 2023

SO I guess this is a closed issue, yay!

@Itxaka Itxaka closed this as completed Sep 14, 2023
@github-project-automation github-project-automation bot moved this from Under review 🔍 to Done ✅ in 🧙Issue tracking board Sep 14, 2023
@jimmykarily
Copy link
Contributor

For better error messages: kairos-io/kairos-agent#145

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARM bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants