- Platform information:
- Hardware: Raspberry Pi 4 Model B Rev 1.1 ; 4GB memory
- Host: Linux openhabian 5.15.76-v7l+ #1597 SMP Fri Nov 4 12:14:58 GMT 2022 armv7l GNU/Linux
- Distro: Raspbian GNU/Linux 11 (bullseye)
- openjdk version “11.0.18” 2023-01-17
- OpenJDK Runtime Environment (build 11.0.18+10-post-Raspbian-1deb11u1)
- OpenJDK Server VM (build 11.0.18+10-post-Raspbian-1deb11u1, mixed mode)
- OH Version: 3.4.3 (Build)
- Installation method: openhabian
Directories: Folder Name | Path | User:Group
----------- | ---- | ----------
OPENHAB_HOME | /usr/share/openhab | openhab:openhab
OPENHAB_RUNTIME | /usr/share/openhab/runtime | openhab:openhab
OPENHAB_USERDATA | /var/lib/openhab | openhab:openhab
OPENHAB_CONF | /etc/openhab | openhab:openhab
OPENHAB_LOGDIR | /var/log/openhab | openhab:openhabian
OPENHAB_BACKUPS | /var/lib/openhab/backups | openhab:openhab
Extras installed via openhabian-config:
zigbee2mqtt
SD card mirror
I have a whole property UPS, which in the eleven years it has been running continuously worked without fail, lost unexpectedly power yesterday for 2 seconds after the grid had brown-out issues.
The following experiences where had after all systems restarted.
As for openHABian:
- The OS time came back one hour earlier than it actually was
- The Zigbee dongle for the OH Zigbee binding stayed offline (reason: USB port change)
- No log files since August 2023, which may have been the last restart/reboot of the whole machine
- Zigbee2MQTT is (still) not accessible; it is running, but has no front-end (which it had before). I restarted mosquitto (because I read zigbee2mqtt won’t work if the broker wasn’t online first.) I fixed this with (recreate a directory)
- As a result of Zigbee not working, fridge freezer and other important devices did not resume power (default state off; had to switch them on manually); lights and switches don’t work either
- I lost all persistence data prior to last shutdown in August 2023
- after adjusting the OS time, persistence restarted (deleting what was captured since reboot).
Since I barely touch the system (as it just runs) I am not familiar with lots of the settings (I tend to forget these and have to reread… getting old); hence, the following questions or statements:
- I think I configured SD card mirroring. How can I check it is working? When is this image overwritten? Hence, no longer useful as a backup pre-failure state?
- How can the issue above prevented? (Loss of persistence logs…)
- I think I can install a UPS hat for the Pi to prevent data loss.
- I could disable ZRAM, which seems the problem for data loss, with data held in memory. Should I rather install a SSD or HDD?
- Why is the OS time out by an hour?
I also get these errors, and have no idea what triggers them:
2024-03-16 06:44:31.858 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - transformation throws exception [transformation=org.openhab.transform.map.internal.MapTransformationService@172d3a4, value=-]
org.openhab.core.transform.TransformationException: Target value not found in map for '-'
2024-03-16 07:34:52.865 [ERROR] [ab.core.ui.icon.internal.IconServlet] - Failed sending the icon byte stream as a response: null
2024-03-16 07:34:52.868 [WARN ] [org.eclipse.jetty.server.HttpChannel] - /icon/solarpanels
I have this backup; is it a full or config backup?
lrwxrwxrwx 1 openhab openhab 61 Feb 18 2023 latest.zip -> /var/lib/openhab/backups/openhab-backup-23_02_18-10_05_07.zip
-rw-r--r-- 1 openhab openhab 6.7M Feb 18 2023 openhab-backup-23_02_18-10_05_07.zip
Can I restore the persistence files only?
I noticed when I stop the OH service, it comes on by itself, hence, leaving no time to restore the persistence files.
Would it be better to install OH manually, run it in Proxmox which allows for snapshot backups?
Can ZRAM be set-up to write the logs at defined intervals?
Anything else that would prevent these issues… or better recover from them?
Thanks, any hints appreciated.
The ideal would be a system that comes up as required every time.
[edit1] I see this in journalctl; seems like zigbee2mqtt is restarting endlessly.
-- Journal begins at Sat 2024-03-16 06:26:39 AEST, ends at Sat 2024-03-16 09:46:34 AEST. --
Mar 16 06:26:39 openhabian systemd[1]: zigbee2mqtt.service: Main process exited, code=exited, status=1/FAILURE
Mar 16 06:26:39 openhabian systemd[1]: zigbee2mqtt.service: Failed with result 'exit-code'.
Mar 16 06:26:39 openhabian systemd[1]: zigbee2mqtt.service: Consumed 7.246s CPU time.
Mar 16 06:26:39 openhabian systemd[1]: zigbee2mqtt.service: Scheduled restart job, restart counter is at 3146.
Mar 16 06:26:39 openhabian systemd[1]: Stopped Zigbee2MQTT.
Mar 16 06:26:39 openhabian systemd[1]: zigbee2mqtt.service: Consumed 7.246s CPU time.
Mar 16 06:26:39 openhabian systemd[1]: Started Zigbee2MQTT.
Mar 16 06:26:40 openhabian npm[18779]: > zigbee2mqtt@1.33.1 start
Mar 16 06:26:40 openhabian npm[18779]: > node index.js
Mar 16 06:26:45 openhabian npm[18805]: Error: EACCES: permission denied, mkdir '/var/log/zigbee2mqtt'
Mar 16 06:26:45 openhabian npm[18805]: at Object.mkdirSync (node:fs:1382:3)
Mar 16 06:26:45 openhabian npm[18805]: at mkdirSyncRecursive (/opt/zigbee2mqtt/node_modules/mkdir-recursive/index.js:199:16)
Mar 16 06:26:45 openhabian npm[18805]: at mkdirSyncRecursive (/opt/zigbee2mqtt/node_modules/mkdir-recursive/index.js:197:12)
Mar 16 06:26:45 openhabian npm[18805]: at mkdirSyncRecursive (/opt/zigbee2mqtt/node_modules/mkdir-recursive/index.js:197:12)
Mar 16 06:26:45 openhabian npm[18805]: at Object.mkdirSync (/opt/zigbee2mqtt/node_modules/mkdir-recursive/index.js:82:10)
Mar 16 06:26:45 openhabian npm[18805]: at Object.init (/opt/zigbee2mqtt/lib/util/logger.ts:43:12)
Mar 16 06:26:45 openhabian npm[18805]: at new Controller (/opt/zigbee2mqtt/lib/controller.ts:53:16)
Mar 16 06:26:45 openhabian npm[18805]: at start (/opt/zigbee2mqtt/index.js:106:18)
Mar 16 06:26:45 openhabian npm[18805]: at processTicksAndRejections (node:internal/process/task_queues:96:5)
Mar 16 06:26:45 openhabian systemd[1]: zigbee2mqtt.service: Main process exited, code=exited, status=1/FAILURE
Mar 16 06:26:45 openhabian systemd[1]: zigbee2mqtt.service: Failed with result 'exit-code'.
Mar 16 06:26:45 openhabian systemd[1]: zigbee2mqtt.service: Consumed 7.263s CPU time.
Mar 16 06:26:45 openhabian systemd[1]: zigbee2mqtt.service: Scheduled restart job, restart counter is at 3147.
Mar 16 06:26:45 openhabian systemd[1]: Stopped Zigbee2MQTT.
Mar 16 06:26:45 openhabian systemd[1]: zigbee2mqtt.service: Consumed 7.263s CPU time.
Mar 16 06:26:45 openhabian systemd[1]: Started Zigbee2MQTT.
Mar 16 06:26:47 openhabian npm[18817]: > zigbee2mqtt@1.33.1 start
Mar 16 06:26:47 openhabian npm[18817]: > node index.js
Mar 16 06:26:51 openhabian npm[18831]: Error: EACCES: permission denied, mkdir '/var/log/zigbee2mqtt'
Mar 16 06:26:51 openhabian npm[18831]: at Object.mkdirSync (node:fs:1382:3)
Mar 16 06:26:51 openhabian npm[18831]: at mkdirSyncRecursive (/opt/zigbee2mqtt/node_modules/mkdir-recursive/index.js:199:16)
Mar 16 06:26:51 openhabian npm[18831]: at mkdirSyncRecursive (/opt/zigbee2mqtt/node_modules/mkdir-recursive/index.js:197:12)
Mar 16 06:26:51 openhabian npm[18831]: at mkdirSyncRecursive (/opt/zigbee2mqtt/node_modules/mkdir-recursive/index.js:197:12)
Mar 16 06:26:51 openhabian npm[18831]: at Object.mkdirSync (/opt/zigbee2mqtt/node_modules/mkdir-recursive/index.js:82:10)
Mar 16 06:26:51 openhabian npm[18831]: at Object.init (/opt/zigbee2mqtt/lib/util/logger.ts:43:12)
Mar 16 06:26:51 openhabian npm[18831]: at new Controller (/opt/zigbee2mqtt/lib/controller.ts:53:16)
Mar 16 06:26:51 openhabian npm[18831]: at start (/opt/zigbee2mqtt/index.js:106:18)
I have fixed this with Zigbee2MQTT @ OpenHab - #30 by Sleugner