NEWS
Backup Restore in Container
-
Liebe Community,
ich bin gerade dabei meinen bestehenden Raspberry Pi gegen einen neuen auszutauschen. Da ich hier die Installation und Migration so weit wie möglich automatisieren möchte, aber gleichzeitig auch auf Iobroker im Container wechseln möchte, habe ich mir über Ansible ein Playbook geschrieben. Das klappt auch soweit. Problem ist nur, dass der Iobroker im Container nach dem Einspielen des Backups nicht starten möchte.
Das Vorgehen ist wie folgt:- Kopieren eines Backups in das Container Volume
- Starten des Containers
- Container erkennt valides Backup
- Iobroker startet mit folgendem Fehler nicht in einer Endlosschleife:
root@iobroker:/opt/iobroker# cat log/iobroker.current.log 2022-02-21 17:22:47.393 - info: host.iobroker iobroker.js-controller version 3.3.22 js-controller starting 2022-02-21 17:22:47.399 - info: host.iobroker Copyright (c) 2014-2021 bluefox, 2014 hobbyquaker 2022-02-21 17:22:47.400 - info: host.iobroker hostname: iobroker, node: v14.19.0 2022-02-21 17:22:47.400 - info: host.iobroker ip addresses: 172.19.0.2 2022-02-21 17:22:48.664 - error: host.iobroker Cannot read system.config: null (OK when migrating or restoring) 2022-02-21 17:23:17.416 - error: host.iobroker No connection to databases possible, restart 2022-02-21 17:23:17.421 - info: host.iobroker iobroker _restart 2022-02-21 17:23:17.986 - info: host.iobroker iobroker Starting node restart.js 2022-02-21 17:23:19.751 - info: host.iobroker iobroker.js-controller version 3.3.22 js-controller starting 2022-02-21 17:23:19.757 - info: host.iobroker Copyright (c) 2014-2021 bluefox, 2014 hobbyquaker 2022-02-21 17:23:19.758 - info: host.iobroker hostname: iobroker, node: v14.19.0 2022-02-21 17:23:19.758 - info: host.iobroker ip addresses: 172.19.0.2 2022-02-21 17:23:19.894 - error: host.iobroker Cannot read system.config: null (OK when migrating or restoring)
Anbei das Log aus dem Container:
-------------------------------------------------------------------------------- ------------------------- 2022-02-21 17:20:23 ------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----- Welcome to your ioBroker-container! ----- ----- Startupscript is now running. ----- ----- Please be patient! ----- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----- Debugging information ----- ----- ----- ----- System ----- ----- arch: aarch64 ----- ----- ----- ----- Docker-Image ----- ----- image: v6.0.0 ----- ----- build: 2022-02-11T07:56:40+00:00 ----- ----- ----- ----- Versions ----- ----- node: v14.19.0 ----- ----- npm: 6.14.16 ----- ----- ----- ----- ENV ----- ----- PACKAGES: etherwake ----- ----- SETGID: 1000 ----- ----- SETUID: 1000 ----- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----- Step 1 of 5: Preparing container ----- -------------------------------------------------------------------------------- Updating Linux packages on first run... Reading package lists... Building dependency tree... Reading state information... Reading package lists... Building dependency tree... Reading state information... 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Done. Registering maintenance script as command... Done. Installing additional packages is set by ENV. Checking the following Packages: etherwake... -------------------------------------------------------------------------------- ------------------------- 2022-02-21 17:21:51 ------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----- Welcome to your ioBroker-container! ----- ----- Startupscript is now running. ----- ----- Please be patient! ----- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----- Debugging information ----- ----- ----- ----- System ----- ----- arch: aarch64 ----- ----- ----- ----- Docker-Image ----- ----- image: v6.0.0 ----- ----- build: 2022-02-11T07:56:40+00:00 ----- ----- ----- ----- Versions ----- ----- node: v14.19.0 ----- ----- npm: 6.14.16 ----- ----- ----- ----- ENV ----- ----- PACKAGES: etherwake ----- ----- SETGID: 1000 ----- ----- SETUID: 1000 ----- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----- Step 1 of 5: Preparing container ----- -------------------------------------------------------------------------------- Updating Linux packages on first run... Reading package lists... Building dependency tree... Reading state information... Reading package lists... Building dependency tree... Reading state information... 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Done. Registering maintenance script as command... Done. Installing additional packages is set by ENV. Checking the following Packages: etherwake... etherwake is already installed. Reading package lists... Building dependency tree... Reading state information... Reading package lists... Building dependency tree... Reading state information... 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Done. -------------------------------------------------------------------------------- ----- Step 2 of 5: Detecting ioBroker installation ----- -------------------------------------------------------------------------------- IoBroker backup file detected in /opt/iobroker. Preparing restore... Done. Restoring ioBroker... Done. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!! IMPORTANT NOTE !!!!! !!!!! The sartup script restored iobroker from a backup file. !!!!! !!!!! Check /opt/iobroker/log/restore.log to see if restore was successful. !!!!! !!!!! When ioBroker now starts it will reinstall all Adapters automatically. !!!!! !!!!! This might be take a looooong time! Please be patient! !!!!! !!!!! You can view installation process by taking a look at ioBroker log. !!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -------------------------------------------------------------------------------- ----- Step 3 of 5: Checking ioBroker installation ----- -------------------------------------------------------------------------------- (Re)Setting folder permissions (This might take a while! Please be patient!)... Done. Fixing "sudo-bug" by replacing sudo in iobroker with gosu... Done. /opt/scripts/iobroker_startup.sh: line 199: [: !=: unary operator expected -------------------------------------------------------------------------------- ----- Step 4 of 5: Applying special settings ----- -------------------------------------------------------------------------------- Some adapters have special requirements/ settings which can be activated by the use of environment variables. For more information take a look at readme.md on Github! -------------------------------------------------------------------------------- ----- Step 5 of 5: ioBroker startup ----- -------------------------------------------------------------------------------- Starting ioBroker...
Ein anderes Backup File habe ich auch schon ohne Erfolg ausprobiert.
Vielen Dank vorab für eure Unterstützung!
-
@modjo Sicher das du nicht einfach nur lange genug wartest?
Selbst wenn das steht „Restore Done“ heißt das nicht das auch schon alle Adapter, Instanzen etc, fertig installiert wurde.
Das logfile besser mal mit „tail -f“ beobachten anstelle von „cat“
-
@wendy2702 Vielen Dank für deine Anwort.
Ich denke schon, da ich es schon 2x jeweils über Nacht laufen lassen habe. -
@modjo OK. Kann man ja nicht wissen. Warum Container auf einem PI?
Wie ist denn jetzt gerade der aktuelle status?
Was kommt den aktuell bei:
iob v iob list instances iob update
-
@wendy2702 Weil ich darauf noch andere Container, wie z.B. Grafana, etc. laufen lassen möchte und ein Pi4 mit 8 GB Ram sonst nicht effizient genutzt wird.
Anbei die Ausgabe der Befehle:root@iobroker:~# iob v 3.3.22 root@iobroker:~# iob list instances Cannot read system.config: null (OK when migrating or restoring) No connection to states 127.0.0.1:6379[redis] root@iobroker:~# iob update Cannot read system.config: null (OK when migrating or restoring) No connection to states 127.0.0.1:6379[redis]
Gruß
-
@modjo OK.
Ist der Hostname zur alten Installation identisch?
Läuft aktuell ein restore?
Wenn nicht:
iob stop
Wobei er eigentlich eh nicht laufen sollte aber egal.
Dann prüfen ob kein iobroker Prozess mehr aktiv ist
ps auxww|grep io
Dann:
cd /opt/iobroker/ npm install iobroker.js-controller@3.3.22
Probieren ob iob sauber startet: Logfile beobachten
Zur Sicherheit nochmal
iob fix
Wenn dann erstmal alles OK ist nochmal bitte das restore probieren.