This also happened to me recently and I still can't find the root cause of the problem, because you really can't do much at that point and I don't have that much experience.
But how I fixed mine was booting into an older version of FreeNAS, preferably the 11.0-RELEASE snapshot.
*remember to backup your geli.key and geli_recovery.key if you have encrypted drives.*
and just staying on 11.0 lol
*a point to note also is that my server had been restarting unexpectedly (similar to pressing the reset button) before the eventual "db>" error*