Problem with Items (Persistence Error without Persistentence set up)

Hi,

i added my MQTT Sonoff Stuff without any problem, but my Sonoff POW makes some trouble and in the end OH restarts.

my items:

/////////////////////////////
// DRUCKER LED 
// SONOFF TH16 - Temperature & Humidity
/////////////////////////////

Switch    Sonoff_TH16_1_Power              "Sonoff TH16 Power"                                       <poweroutlet>    (gSonoff)                           {channel="mqtt:topic:SONOFF_TH16_1:power"}
String    Sonoff_TH16_1_String             "Sonoff TH16 String"                                      <poweroutlet>    (gSonoff)                           {channel="mqtt:topic:SONOFF_TH16_1:state"}
Number    Sonoff_TH16_1_Temp               "Sonoff TH16 Temp [%s °C]"                                <temperature>    (gSonoff)                           {channel="mqtt:topic:SONOFF_TH16_1:temperature"}
Number    Sonoff_TH16_1_Humidity           "Sonoff TH16 Humidity [%s %%]"                            <humidity>       (gSonoff)                           {channel="mqtt:topic:SONOFF_TH16_1:humidity"}
Number    Sonoff_TH16_1_RSSI               "Sonoff TH16 WLAN Stärke [%.0f %%]"                       <wifi>           (gSonoff)                           {channel="mqtt:topic:SONOFF_TH16_1:rssi"}
Number    Sonoff_TH16_1_Load               "Sonoff TH16 Load Avg. [%s %%]"                           <heating>        (gSonoff)                           {channel="mqtt:topic:SONOFF_TH16_1:load"}
String    Sonoff_TH16_1_Uptime             "Sonoff TH16 Uptime"                                      <time>           (gSonoff)                           {channel="mqtt:topic:SONOFF_TH16_1:uptime"}
String    Sonoff_TH16_1_ssid               "Sonoff TH16 WiFi"                                        <wifi>           (gSonoff)                           {channel="mqtt:topic:SONOFF_TH16_1:ssid"}

/////////////////////////////
// PC 
// SONOFF POW - Strom messen
/////////////////////////////

Switch    Sonoff_POW_1_Power                 "Sonoff POW Power [MAP(de.map):%s]"                       <poweroutlet>    (gSonoff)                      {channel="mqtt:topic:SONOFF_POW_1:power_pow"}
String    Sonoff_POW_1_String                "Sonoff POW String"                                       <poweroutlet>    (gSonoff)                      {channel="mqtt:topic:SONOFF_POW_1:state_pow"}
Number    Sonoff_POW_1_Voltage               "Sonoff POW Spannung [%s V]"                              <temperature>    (gSonoff)                      {channel="mqtt:topic:SONOFF_POW_1:voltage_pow"}
Number    Sonoff_POW_1_Total                 "Sonoff POW Energie geamt [%s kWh]"                       <humidity>       (gSonoff)                      {channel="mqtt:topic:SONOFF_POW_1:total_pow"}
Number    Sonoff_POW_1_TotalYesterday        "Sonoff POW Energie gestern [%s kWh]"                     <temperature>    (gSonoff)                      {channel="mqtt:topic:SONOFF_POW_1:totalyesterday_pow"}
Number    Sonoff_POW_1_TotalToday            "Sonoff POW Energie heute [%s kWh]"                       <humidity>       (gSonoff)                      {channel="mqtt:topic:SONOFF_POW_1:totaltoday_pow"}
Number    Sonoff_POW_1_Current               "Sonoff POW Strom [%s A]"                                 <temperature>    (gSonoff)                      {channel="mqtt:topic:SONOFF_POW_1:current_pow"}
Number    Sonoff_POW_1_Period                "Sonoff POW Period [%s]"                                  <humidity>       (gSonoff)                      {channel="mqtt:topic:SONOFF_POW_1:period_pow"}
Number    Sonoff_POW_1_Factor                "Sonoff POW Leistungsfaktor [%s]"                         <humidity>       (gSonoff)                      {channel="mqtt:topic:SONOFF_POW_1:factor_pow"}
Number    Sonoff_POW_1_Power2                "Sonoff POW Leistung [%s W]"                              <temperature>    (gSonoff)                      {channel="mqtt:topic:SONOFF_POW_1:power2_pow"}
Number    Sonoff_POW_1_ApparentPower         "Sonoff POW Scheinleistung [%s VA]"                       <humidity>       (gSonoff)                      {channel="mqtt:topic:SONOFF_POW_1:apparentpower_pow"}
Number    Sonoff_POW_1_ReactivePower         "Sonoff POW Blindleistung [%s VAr]"                       <temperature>    (gSonoff)                      {channel="mqtt:topic:SONOFF_POW_1:reactivepower_pow"}
Number    Sonoff_POW_1_RSSI                  "Sonoff POW WLAN Stärke [%.0f %%]"                        <wifi>           (gSonoff)                      {channel="mqtt:topic:SONOFF_POW_1:rssi_pow"}
Number    Sonoff_POW_1_Load                  "Sonoff POW Load Avg. [%s %%]"                            <heating>        (gSonoff)                      {channel="mqtt:topic:SONOFF_POW_1:load_pow"}
String    Sonoff_POW_1_Uptime                "Sonoff POW Uptime"                                       <time>           (gSonoff)                      {channel="mqtt:topic:SONOFF_POW_1:uptime_pow"}
String    Sonoff_POW_1_ssid                  "Sonoff POW WiFi"                                         <wifi>           (gSonoff)                      {channel="mqtt:topic:SONOFF_POW_1:ssid_pow"}

as soon as i add my POW ITEMS, i get this ERROR in the LOG:

2021-08-20 00:55:52.645 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file '/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_Factor.rrd': Invalid file header. File [/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_Factor.rrd] is not a RRD4J RRD file
2021-08-20 00:55:52.636 [WARN ] [org.openhab.core.items.GenericItem  ] - failed notifying listener 'org.openhab.core.persistence.internal.PersistenceManagerImpl@642fd3' about state update of item Sonoff_POW_1_Period: No enum constant org.rrd4j.ConsolFun.
java.lang.IllegalArgumentException: No enum constant org.rrd4j.ConsolFun.
	at java.lang.Enum.valueOf(Enum.java:240) ~[?:?]
	at org.rrd4j.ConsolFun.valueOf(ConsolFun.java:10) ~[?:?]
	at org.rrd4j.core.Archive.getConsolFun(Archive.java:207) ~[?:?]
	at org.rrd4j.core.RrdDb.getRrdDef(RrdDb.java:955) ~[?:?]
	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) [bundleFile:?]
	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:834) [?:?]
2021-08-20 00:55:52.660 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file '/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_ApparentPower.rrd': Invalid file header. File [/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_ApparentPower.rrd] is not a RRD4J RRD file
2021-08-20 00:55:52.664 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file '/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_Power2.rrd': Invalid file header. File [/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_Power2.rrd] is not a RRD4J RRD file
2021-08-20 00:55:52.668 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file '/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_ReactivePower.rrd': Invalid file header. File [/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_ReactivePower.rrd] is not a RRD4J RRD file

i did not set up any persistence yet.
Where is the problem with this ?
Thank you!

Rrd4j is set-up by default. UI-Settings; System Services; Persistence. These could be transitory; check the folder mentioned. Maybe they were setup anyway

Hi Bob,

i installed InfluxDB and Grafana today and it works. Changed the Persistence to Influx in the GUI and i still get the same Error when i uncomment the Sonoff POW !?

Any Ideas ?
Thanks!

2021-08-20 23:31:38.219 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'sonoff.items'
2021-08-20 23:31:38.659 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file '/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_Factor.rrd': Invalid file header. File [/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_Factor.rrd] is not a RRD4J RRD file
2021-08-20 23:31:38.684 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file '/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_Power2.rrd': Invalid file header. File [/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_Power2.rrd] is not a RRD4J RRD file
2021-08-20 23:31:38.710 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file '/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_ApparentPower.rrd': Invalid file header. File [/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_ApparentPower.rrd] is not a RRD4J RRD file
2021-08-20 23:31:38.736 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file '/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_ReactivePower.rrd': Invalid file header. File [/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_ReactivePower.rrd] is not a RRD4J RRD file
2021-08-20 23:31:38.764 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file '/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_RSSI.rrd': Invalid file header. File [/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_RSSI.rrd] is not a RRD4J RRD file
2021-08-20 23:31:38.792 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file '/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_Load.rrd': Invalid file header. File [/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_Load.rrd] is not a RRD4J RRD file
2021-08-20 23:31:39.367 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file '/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_Factor.rrd': Invalid file header. File [/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_Factor.rrd] is not a RRD4J RRD file
2021-08-20 23:31:39.382 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file '/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_Power2.rrd': Invalid file header. File [/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_Power2.rrd] is not a RRD4J RRD file
2021-08-20 23:31:39.402 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file '/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_ApparentPower.rrd': Invalid file header. File [/var/lib/openhab/persistence/rrd4j/Sonoff_POW_1_ApparentPower.rrd] is not a RRD4J RRD file
2021-08-20 23:31:39.372 [WARN ] [org.openhab.core.items.GenericItem  ] - failed notifying listener 'org.openhab.core.persistence.internal.PersistenceManagerImpl@a1cf1b' about state update of item Sonoff_POW_1_Period: No enum constant org.rrd4j.ConsolFun.
java.lang.IllegalArgumentException: No enum constant org.rrd4j.ConsolFun.
	at java.lang.Enum.valueOf(Enum.java:240) ~[?:?]
	at org.rrd4j.ConsolFun.valueOf(ConsolFun.java:10) ~[?:?]
	at org.rrd4j.core.Archive.getConsolFun(Archive.java:207) ~[?:?]
	at org.rrd4j.core.RrdDb.getRrdDef(RrdDb.java:955) ~[?:?]
	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) [bundleFile:?]
	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:834) [?:?]

image

Not really my area of expertise :confused: It is interesting that only a few items seem to spring the error. What is is in userdata/persistence/rrd4j folder? Do the files appear anyway despite the error? If they do it is probably not critical, just annoying.

Bob

its pretty annoying, because OH restarts every 10 mins. and i can’t get further with my sonoffs…

yes they are

The limit of my experience is that rrd4j is a default and that despite errors the files are usually set-up anyway. I don’t know why this is effecting OH restarts? Could that be a separate issue?

Sorry

i deleted all the .rrd files above and now i have no errors regarding that.