Please help! rrd4j error in newest OH2: Invalid header - not a rrd4j file

Hi folks I’m the newest release OH on rasp pi 3
When using tail command to debug my system I realize these error notice:

2017-01-24 01:42:00.095 [ERROR] [sistence.rrd4j.internal.RRD4jService] - Could not create rrd4j database file '/var/lib/openhab2/persistence/rrd4j/Weather_Humidity.rrd': Invalid file header. File [/var/lib/openhab2/persistence/rrd4j/Weather_Humidity.rrd] is not a RRD4J RRD file
2017-01-24 01:42:00.414 [ERROR] [sistence.rrd4j.internal.RRD4jService] - Could not create rrd4j database file '/var/lib/openhab2/persistence/rrd4j/Weather_Pressure.rrd': Invalid file header. File [/var/lib/openhab2/persistence/rrd4j/Weather_Pressure.rrd] is not a RRD4J RRD file

my item:

/*Humidity*/
Group Weather_Humidity_Chart(Weather)
Number Weather_Humidity "Outside Humidity [%.1f %%]" <humidity> (Weather_Humidity_Chart){ channel="yahooweather:weather:berlin:humidity" }
Number Weather_Humid_Max 		"Todays Maximum [%.1f %%]"	<humidity> (Weather_Humidity_Chart)
Number Weather_Humid_Min 		"Todays Minimum [%.1f %%]"	<humidity> (Weather_Humidity_Chart)
Number Weather_Humidity_Chart_Period		"Humidity Chart Period" <chart>

/*Pressure*/
Group Weather_Pressure_Chart(Weather)
Number   	Weather_Pressure   "Outside Pressure [%.2f mb]"  <pressure>(Weather_Pressure_Chart){ channel="yahooweather:weather:berlin:pressure" }
Number Weather_Pressure_Max 		"Todays Maximum [%.1f mb]"	<pressure> (Weather_Pressure_Chart)
Number Weather_Pressure_Min 		"Todays Minimum [%.1f mb]"	<pressure> (Weather_Pressure_Chart)
Number    Weather_Pressure_Chart_Period   "Pressure Chart Period" <chart>

sitemap:

Text item=Weather_Humidity valuecolor=[>60="blue",>40="dodgerblue",<=40="green"] {
			Frame {
				Text item=Weather_Humid_Max valuecolor=[>60="blue",>40="dodgerblue",<=40="green"]
				Text item=Weather_Humid_Min valuecolor=[>60="blue",>40="dodgerblue",<=40="green"]
					}
			Frame {
				Switch item=Weather_Humidity_Chart_Period label="Humidity Chart Period" mappings=[0="Hour", 1="Day", 2="Week"]
Chart item=Weather_Humidity_Chart period=h refresh=6000 visibility=[Weather_Humidity_Chart_Period==0, Weather_Temperature_Chart_Period=="Uninitialized"]
				Chart item=Weather_Humidity_Chart period=D refresh=30000 visibility=[Weather_Humidity_Chart_Period==1]
				Chart item=Weather_Humidity_Chart period=W refresh=30000 visibility=[Weather_Humidity_Chart_Period==2]
			}
		}

rrd4j.persist: (under /etc/openhab2/persistence)

// persistence strategies have a name and a definition and are referred to in the "Items" section
Strategies {
	// for rrd charts, we need a cron strategy
	everyMinute : "0 * * * * ?"
}

Items {
	Weather_Humidity_Chart*,Weather_Pressure_Chart*,Weather_Humidity,Weather_Pressure: strategy = everyChange, everyMinute, restoreOnStartup
	
	// let's only store temperature values in rrd
	Weather_Humidity_Chart*,Weather_Pressure_Chart*,Weather_Humidity,Weather_Pressure: strategy = everyMinute, restoreOnStartup
}

Please help me fix these error lines! Thanks in advance!

Why are you persisting each item twice?

1 Like

Ah…
I intended to copy and paste the items line to this forum but some how I double-pressed CTRL+V

If you haven’t persisted any values yet, I’d suggest to delete the .rrd4j files before restarting.

Had the same issue, deleting the RRD4J files cleared up the error.

2 Likes

I did the same but the files are recreated automatically after i delete them… ???
What can I do now?

Well, yes. They’re supposed to be created when you persist an Item.

What version are you on? This is a four year old thread.

I’m on 3.0.1.
The things it concerns are z-wave items.
Is there a way I can stop the recreating of the RRD4j items?

This is what I read in the log:
2021-05-16 14:49:00.440 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/Terrasverwarming5_Switch.rrd’: Invalid file header. File [/var/lib/openhab/persistence/rrd4j/Terrasverwarming5_Switch.rrd] is not a RRD4J RRD file

rrd4j persistence is installed by default in OH3. If you don’t want to persist anything, you can uninstall it (but you will lose ‘analyze’ charting).

If present, rrd4j persists everything -unless you tel it not, by manually configuring the Items you do want it to persist.

Most likely though, you’ve got files that are bent out of shape in some way.
You do have to stop openHAB before deleting the file, then you should find it gets recreated properly on reboot.

1 Like

All right I think I get it.

I created a rrd4j file in the persistence folder with another switch inside that was not part of the problems. Seems my errors in the log are gone.

Thanks for your help