Solved /boot/lua/loader.lua:55: attempt to index a boolean value.

Hi,
I have a FreeBSD installation running in bhyve on FreeBSD.
It has been running fine for years.

All of a sudden it doesn't boot properly.
During boot I get this:
Code:
ERROR: /boot/lua/loader.lua:55: attempt to index a boolean value.


Type '?' for a list of commands, 'help' for more detailed help.
OK

If I then type boot it will continue booting normally.

I don't know how to troubleshoot this further.

This is the output from lsdev:
Code:
OK lsdev
host devices:
    host0:   Host filesystem
disk devices:
    disk0:   Guest drive image
      disk0p1: FreeBSD boot
      disk0p2: FreeBSD UFS
      disk0p3: FreeBSD swap
OK

Any ideas?
 
Yes.

What is the content of line 55 of that file?
And if that line is the same that I read on my installation, is the file /boot/lua/menu.lua exists on the VM?
 
Code:
# cat -n /boot/lua/loader.lua
    54  if not core.isMenuSkipped() then
    55          require("menu").run()
    56  else
    57          -- Load kernel/modules before we go
    58          config.loadelf()
    59  end

# ls -l /boot/lua/menu.lua
-r--r--r--  1 root  wheel  0 May 31 17:33 /boot/lua/menu.lua

The file is there but empty...
Weird.
 
In my FreeBSD 13.2-RELEASE-p2, it has 14,1 KiB size. I think you found the problem. Replace it with a legit one.
 
Thank you for the help!
I replaced the empty /boot/lua/menu.lua with the same non-empty file from my other system. Now it works.
I have no idea how that happened.
 
Back
Top