Hello,
does the RRD4J persistence service have a limit on the number of items?
Openhab runs stably and reliably with approx. 1490 items. I use MapDB and RRD4J as persists.
Little by little, I add more items via “Add elements from text definition” in order to be able to fully configure and control my heating controller.
During the import of the items, openhab completely crashes and restarts. The items were then only partially imported. I’m then at about ~1495-1500 items.
A fatal error has been detected by the Java Runtime Environment:
SIGBUS (0x7) at pc=0x0000007f85396384, pid=1034280, tid=1040900
JRE version: OpenJDK Runtime Environment (11.0.16+8) (build 11.0.16+8-post-Debian-1deb11u1)
Java VM: OpenJDK 64-Bit Server VM (11.0.16+8-post-Debian-1deb11u1, mixed mode, tiered, compressed oops, g1 gc, linux-aarch64)
Problematic frame:
V [libjvm.so+0x52a384]
No core dump will be written. Core dumps have been disabled. To enable core dumping, try “ulimit -c unlimited” before starting Java again
If you would like to submit a bug report, please visit:
https://bugs.debian.org/openjdk-11
--------------- S U M M A R Y ------------
Command Line: -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/openhab/runtime -Dopenhab.userdata=/var/lib/openhab -Dopenhab.logdir=/var/log/openhab -Dfelix.cm.dir=/var/lib/openhab/config -Djava.library.path=/var/lib/openhab/tmp/lib -Djetty.host=0.0.0.0 -Djetty.http.compliance=RFC2616 -Dnashorn.args=–no-deprecation-warning -Dorg.apache.cxf.osgi.http.transport.disable=true -Dorg.ops4j.pax.web.listening.addresses=0.0.0.0 -Dorg.osgi.service.http.port=8080 -Dorg.osgi.service.http.port.secure=8443 -Djava.awt.headless=true -Dfile.encoding=UTF-8 -XX:+ExitOnOutOfMemoryError --add-reads=java.xml=java.logging --add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED --patch-module=java.base=/usr/share/openhab/runtime/lib/endorsed/org.apache.karaf.specs.locator-4.3.7.jar --patch-module=java.xml=/usr/share/openhab/runtime/lib/endorsed/org.apache.karaf.specs.java.xml-4.3.7.jar --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.naming/javax.naming.spi=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.file=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.ftp=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED --add-exports=java.base/sun.net.www.content.text=ALL-UNNAMED --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED --add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED --add-exports=java.rmi/sun.rmi.registry=ALL-UNNAMED --add-exports=java.security.sasl/com.sun.security.sasl=ALL-UNNAMED -Dkaraf.instances=/var/lib/openhab/tmp/instances -Dkaraf.home=/usr/share/openhab/runtime -Dkaraf.base=/var/lib/openhab -Dkaraf.data=/var/lib/openhab -Dkaraf.etc=/var/lib/openhab/etc -Dkaraf.log=/var/log/openhab -Dkaraf.restart.jvm.supported=true -Djava.io.tmpdir=/var/lib/openhab/tmp -Djava.util.logging.config.file=/var/lib/openhab/etc/java.util.logging.properties -Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true org.apache.karaf.main.Main
Host: AArch64, 4 cores, 7G, Debian GNU/Linux 11 (bullseye)
Time: Thu Nov 3 16:32:32 2022 CET elapsed time: 1884.342802 seconds (0d 0h 31m 24s)
--------------- T H R E A D ---------------
Current thread (0x0000007f302ad800): JavaThread “OH-safeCall-9” [_thread_in_vm, id=1040900, stack(0x0000007ea35e1000,0x0000007ea37e1000)]
Stack: [0x0000007ea35e1000,0x0000007ea37e1000], sp=0x0000007ea37de720, free space=2037k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x52a384]
V [libjvm.so+0xc66e18]
J 32293 jdk.internal.misc.Unsafe.copySwapMemory0(Ljava/lang/Object;JLjava/lang/Object;JJJ)V java.base@11.0.16 (0 bytes) @ 0x0000007f70cff45c [0x0000007f70cff3c0+0x000000000000009c]
C 0x0000000000000000
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 32293 jdk.internal.misc.Unsafe.copySwapMemory0(Ljava/lang/Object;JLjava/lang/Object;JJJ)V java.base@11.0.16 (0 bytes) @ 0x0000007f70cff460 [0x0000007f70cff3c0+0x00000000000000a0]
J 39780 c1 jdk.internal.misc.Unsafe.copySwapMemory(Ljava/lang/Object;JLjava/lang/Object;JJJ)V java.base@11.0.16 (37 bytes) @ 0x0000007f6a21b258 [0x0000007f6a21b100+0x0000000000000158]
j java.nio.DirectDoubleBufferS.put([DII)Ljava/nio/DoubleBuffer;+123 java.base@11.0.16
j org.rrd4j.core.ByteBufferBackend.writeDouble(JDI)V+39
J 31174 c1 org.rrd4j.core.RrdDoubleMatrix.(Lorg/rrd4j/core/RrdUpdater;IIZ)V (43 bytes) @ 0x0000007f6b71b04c [0x0000007f6b71af40+0x000000000000010c]
J 47918 c1 org.rrd4j.core.Archive.(Lorg/rrd4j/core/RrdDb;Lorg/rrd4j/core/ArcDef;)V (354 bytes) @ 0x0000007f6caad360 [0x0000007f6caabd00+0x0000000000001660]
j org.rrd4j.core.RrdDb.(Lorg/rrd4j/core/RrdDef;Lorg/rrd4j/core/RrdBackendFactory;Lorg/rrd4j/core/RrdDbPool;)V+202
J 41669 c1 org.openhab.persistence.rrd4j.internal.RRD4jPersistenceService.getDB(Ljava/lang/String;)Lorg/rrd4j/core/RrdDb; (175 bytes) @ 0x0000007f6c3c5f5c [0x0000007f6c3c5380+0x0000000000000bdc]
J 43109 c1 org.openhab.persistence.rrd4j.internal.RRD4jPersistenceService.query(Lorg/openhab/core/persistence/FilterCriteria;)Ljava/lang/Iterable; (452 bytes) @ 0x0000007f69257ed4 [0x0000007f69257e00+0x00000000000000d4]
j jdk.internal.reflect.GeneratedMethodAccessor76.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+40
J 10415 c2 jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; java.base@11.0.16 (10 bytes) @ 0x0000007f708c510c [0x0000007f708c50c0+0x000000000000004c]
J 32273 c1 org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(Lorg/openhab/core/internal/common/Invocation;)Ljava/lang/Object; (81 bytes) @ 0x0000007f6b89a700 [0x0000007f6b89a580+0x0000000000000180]
J 32207 c1 org.openhab.core.internal.common.Invocation.call()Ljava/lang/Object; (16 bytes) @ 0x0000007f6b87e374 [0x0000007f6b87e2c0+0x00000000000000b4]
J 33564 c2 java.util.concurrent.FutureTask.run()V java.base@11.0.16 (123 bytes) @ 0x0000007f70d5e094 [0x0000007f70d5de00+0x0000000000000294]
J 45681 c2 java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V java.base@11.0.16 (187 bytes) @ 0x0000007f71317580 [0x0000007f71317400+0x0000000000000180]
J 37790 c1 java.util.concurrent.ThreadPoolExecutor$Worker.run()V java.base@11.0.16 (9 bytes) @ 0x0000007f6a9f8c4c [0x0000007f6a9f8bc0+0x000000000000008c]
J 6952 c1 java.lang.Thread.run()V java.base@11.0.16 (17 bytes) @ 0x0000007f69fcc1a4 [0x0000007f69fcc040+0x0000000000000164]
v ~StubRoutines::call_stub
siginfo: si_signo: 7 (SIGBUS), si_code: 2 (BUS_ADRERR), si_addr: 0x0000007ee54fc000
Complete Crash-Reports:
hs_err_pid331673.log (242.8 KB)
hs_err_pid1034280.log (264.8 KB)
I can then continue to import individual items, but the following entry appears in the log file for each new item:
2022-11-03 17:18:02.150 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method ‘QueryablePersistenceService.query()’ on ‘org.openhab.persistence.rrd4j.internal.RRD4jPersistenceService@17dc802’: a fault occurred in a recent unsafe memory access operation in compiled Java code
java.lang.InternalError: a fault occurred in a recent unsafe memory access operation in compiled Java code
at org.rrd4j.core.Header.(Header.java:54) ~[?:?]
at org.rrd4j.core.RrdDb.(RrdDb.java:471) ~[?:?]
at org.rrd4j.core.RrdDb.of(RrdDb.java:417) ~[?:?]
at org.openhab.persistence.rrd4j.internal.RRD4jPersistenceService.getDB(RRD4jPersistenceService.java:331) ~[?:?]
at org.openhab.persistence.rrd4j.internal.RRD4jPersistenceService.query(RRD4jPersistenceService.java:235) ~[?:?]
at jdk.internal.reflect.GeneratedMethodAccessor72.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]
2022-11-03 17:18:02.162 [ERROR] [ence.internal.PersistenceManagerImpl] - Exception occurred while querying persistence service ‘rrd4j’: a fault occurred in a recent unsafe memory access operation in compiled Java code
java.lang.InternalError: a fault occurred in a recent unsafe memory access operation in compiled Java code
at org.rrd4j.core.Header.(Header.java:54) ~[?:?]
at org.rrd4j.core.RrdDb.(RrdDb.java:471) ~[?:?]
at org.rrd4j.core.RrdDb.of(RrdDb.java:417) ~[?:?]
at org.openhab.persistence.rrd4j.internal.RRD4jPersistenceService.getDB(RRD4jPersistenceService.java:331) ~[?:?]
at org.openhab.persistence.rrd4j.internal.RRD4jPersistenceService.query(RRD4jPersistenceService.java:235) ~[?:?]
at jdk.internal.reflect.GeneratedMethodAccessor72.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]
And with many of the most recently imported and newly created items, these errors appear in the logbook cyclically or when the value changes - as specified in the persistence configuration - although the database file is created and also values:
2022-11-03 17:18:02.335 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/Configuration_Heating Controller_Kitchen_Window Contact.rrd’: Invalid file header. File [/var/lib/openhab/persistence/rrd4j/Configuration_heating controller_kitchen_window contact.rrd] is not a RRD4J RRD file
If the values of the added items are changed, you can see the following logbook entries, for example:
2022-11-03 17:38:55.043 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/Configuration_Heating Controller_Kitchen_Von_Monat_Aus.rrd’: Invalid file header. File [/var/lib/openhab/persistence/rrd4j/Configuration_Heating Controller_Kitchen_Von_Monat_Aus.rrd] is not a RRD4J RRD file
2022-11-03 17:38:47.264 [WARN ] [org.openhab.core.items.GenericItem ] - failed notifying listener ‘org.openhab.core.persistence.internal.PersistenceManagerImpl@18b06f2b’ about state update of item Configuration_heating controller_kitchen_holiday_sunday: Null consolidation function specified
java.lang.IllegalArgumentException: Null consolidation function specified
at org.rrd4j.core.ArcDef.(ArcDef.java:43) ~[?:?]
at org.rrd4j.core.RrdDb.getRrdDef(RrdDb.java:1288) ~[?:?]
at org.openhab.persistence.rrd4j.internal.RRD4jPersistenceService.getConsolidationFunction(RRD4jPersistenceService.java:397) ~[?:?]
at org.openhab.persistence.rrd4j.internal.RRD4jPersistenceService.store(RRD4jPersistenceService.java:142) ~[?:?]
at org.openhab.core.persistence.internal.PersistenceManagerImpl.handleStateEvent(PersistenceManagerImpl.java:152) ~[?:?]
at org.openhab.core.persistence.internal.PersistenceManagerImpl.stateChanged(PersistenceManagerImpl.java:473) ~[?:?]
at org.openhab.core.items.GenericItem.lambda$1(GenericItem.java:259) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]
2022-11-03 17:38:47.731 [WARN ] [org.openhab.core.items.GenericItem ] - failed notifying listener ‘org.openhab.core.persistence.internal.PersistenceManagerImpl@18b06f2b’ about state update of item Configuration_heating controller_kitchen_holiday_sunday: Null consolidation function specified
java.lang.IllegalArgumentException: Null consolidation function specified
at org.rrd4j.core.ArcDef.(ArcDef.java:43) ~[?:?]
at org.rrd4j.core.RrdDb.getRrdDef(RrdDb.java:1288) ~[?:?]
at org.openhab.persistence.rrd4j.internal.RRD4jPersistenceService.getConsolidationFunction(RRD4jPersistenceService.java:397) ~[?:?]
at org.openhab.persistence.rrd4j.internal.RRD4jPersistenceService.store(RRD4jPersistenceService.java:142) ~[?:?]
at org.openhab.core.persistence.internal.PersistenceManagerImpl.handleStateEvent(PersistenceManagerImpl.java:152) ~[?:?]
at org.openhab.core.persistence.internal.PersistenceManagerImpl.stateChanged(PersistenceManagerImpl.java:473) ~[?:?]
at org.openhab.core.items.GenericItem.lambda$1(GenericItem.java:259) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]
If a certain number of the items created last is deleted, everything is error-free again!
-Openhab 3.4M3 has the same problem.
-Restarting the system doesn’t change anything either.
-There are no permission problems or file system errors.
-When I import the last imported ~22 items to a fresh system with 0 items there are no crashes or errors!
So there must be a problem with the number of items and/or RRD4J persistence items?
Can someone confirm or understand this?