Set password dialog appears on invalid evcc.yaml
Describe the bug
follow up to https://github.com/evcc-io/evcc/issues/14241
When you try to start evcc with a broken evcc.yaml file it presents the "Set Admin Password" dialoge. The reason is, that it hasn't established a database connection but parts of the code (auth endpoints) rely on reading from the database.
Wanted behavior:
- Establish database connection even if evcc.yaml fails. In the future database location should only be defined by env or cli parameter.
- settings api should return error when read access fails (no connection, db locked, ...)
\cc @andig
Steps to reproduce
- use a working configuration with configured password
- introduce a syntax error in evcc.yaml
- restart evcc
- open the UI
- you'll see a set admin password prompt
Configuration details
-
Log details
-
What type of operating system are you running?
Linux
Version
0.127.1
Wenn die DB nicht initialisiert ist können wir ja überhaupt gar nichts tun. Sollten wir das vllt. als einen speziellen fatal Error anzeigen? Das würde weitere Änderungen ersparen. Hier macht es ja auch keinen Sinn, die Configoberläche auz zu machen?
Hier macht es ja auch keinen Sinn, die Configoberläche auz zu machen?
Ja, können wir auch machen. Dann brächten wir hier wirklich zwei Klassen von Fehlern. Die durch die Config UI behebbaren (üblicherweise Geräte, Integrationen, ...) und die katastrophalen (evcc.yaml unlesbar, keine db verbindung, ...).
@andig Wie würdest du die API mäßig unterscheidbar machen? Aktuell läuft das ja alles unter fatal.