Q:

GRUB randomly showing on startup

I have set GRUB to be fully hidden. However, it does sometimes randomly show when I am booting. What could  be causing this?
Contents of etc/default/grub
GRUB_DEFAULT="0"
GRUB_TIMEOUT_STYLE="hidden"
GRUB_TIMEOUT="0"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nouveau.modeset=0"
GRUB_CMDLINE_LINUX=""
GRUB_HIDDEN_TIMEOUT="0"
GRUB_DISABLE_OS_PROBER="true"

Ubuntu 18.04. is the only installed operating system. I am using UEFI boot with secure boot disabled.

A:

The problem seemed to occur when Grub went into recovery mode after the system or a program didn't shut down properly.
To prevent Grub from showing in those circumstances add this line to /etc/default/grub
GRUB_RECORDFAIL_TIMEOUT="3"
Set the timeout value to anything you like. I have set it to 3 to still have the option to access group in case of system failure. Setting the value to 0 will prevent Grub from showing altogether.
After making the changes run this command to apply them:
sudo update-grub

