500 Error "Server got itself in trouble"

Hi everyone, I’m having trouble with my HA.
As the title says, when I try to connect to the dashboard via homeassistant.local:8123, it shows

500 Internal Server Error
Server got itself in trouble

I have my HA installed on a Raspberry Pi and connected to my home network via a network cable. Until yesterday, it worked properly.
What I did today was unplug it from the power and network cable and moved it to another location and reconnected it. Then the above problem occurred.

Here are my other findings:

  • Reboot didn’t work;
  • Pluging it back to the original place didn’t work;
  • Despite the 500 error on port 8123, everything is fine on port 4357 (= Home Assistant observer). It shows “Supervisor: Connected; Supported: Supported; Healthy: Healthy”;
  • Whether visiting homeassistant.local or enter its IP directly, the result is the same;
  • Everything works fine with my devices and automations, for example the home lights still turn on and off automatically;
  • I can’t connect to ssh via port 22 (it shows Connection refused). i’m not sure i could have done that before.
  • After connecting to a monitor, I can see the procedure of booting up, as well as the HA CLI, everything looks fine without errors.

Anyway, it looks like something is wrong with the dashboard. What should I do about it?