Could not create rrd4j database file error in OH3

Hi.

I get this error message:

2021-01-05 14:19:00.714 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/KNXTermostatGang_TermostatGang.rrd’: Read failed, file /var/lib/openhab/persistence/rrd4j/KNXTermostatGang_TermostatGang.rrd not mapped for I/O

I get this on 5 items. I looked into the folder and this dbfiles was 0 kB.

Have I done something wrong or is it a bug?

Regards
ROS

What’s the ownership and permissions on that file?

Hi rikoshak.

I am not so familiar in Linux :slight_smile:

I will delete those items and make new ones and see it that helps.

Do an

ls -ld /var/lib/openhab/persistence/rrd4j/KNXTermostatGang_TermostatGang.rrd  /var/lib/openhab/persistence/rrd4j/ /var/lib/openhab/persistence

this will show owner, group and related permissions of the directories and the file.

Hi Wolfgang_S.

I have deleted the items, if it come again will do that command.

I do have the same problem with a few items.
I tried to setup the system from scratch but it appeared again.

2021-01-09 20:39:00.701 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file '/var/lib/openhab/persistence/rrd4j/ESPEasy0MQTT_ESPEasy0Command.rrd': Read failed, file /var/lib/openhab/persistence/rrd4j/ESPEasy0MQTT_ESPEasy0Command.rrd not mapped for I/O

Below a readout the ownership and the permissions.

ernst@openHABianDevice:/etc/openhab/misc $ ls -ld /var/lib/openhab/persistence/rrd4j/
drwxrwxr-x 1 openhab openhab 4096 Jan  9 19:59 /var/lib/openhab/persistence/rrd4j/
ernst@openHABianDevice:/etc/openhab/misc $ ls -ld /var/lib/openhab/persistence/
drwxrwxr-x 1 openhab openhab 4096 Jan  9 19:37 /var/lib/openhab/persistence/
ernst@openHABianDevice:/etc/openhab/misc $ ls -ld /var/lib/openhab/persistence/rrd4j/ESPEasy0MQTT_ESPEasy0Command.rrd
-rw-r--r-- 1 openhab openhab 0 Jan  9 19:59 /var/lib/openhab/persistence/rrd4j/ESPEasy0MQTT_ESPEasy0Command.rrd

Restarting the openhab service does not help.

I had the same issue. You need to change the permissions as described herein:

However, I would love to understand the origin of the issue to solve it once for all.

To me it looks like the permissions are ok but the file itself does not have any content ( size 0 ).
I would suggest to shutdown the OH service and remove the file then start OH service again and check if it was created again.

Thanks for your answer.
To me the permission look ok: all files should be read and writeable.
Deleting all files in rrd4j directory and a new start helped.

Anyway, it is a little bit strange:

  • In the system services I did not select the RRD4J option (see picture).

1 Like

I can report a similiar issue with my system, after the migration to OH3 (latest stable version 3.0.0).

I see the following errors for one of the .rrd files:

2021-01-12 16:05:32.611 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/FritzBoxCBLWANDownstreamCurrRate.rrd’: null
2021-01-12 16:05:41.690 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/FritzBoxCBLWANDownstreamCurrRate.rrd’: null
2021-01-12 16:05:54.809 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/FritzBoxCBLWANDownstreamCurrRate.rrd’: null
2021-01-12 16:10:55.822 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/FritzBoxCBLWANDownstreamCurrRate.rrd’: null
2021-01-12 16:20:55.681 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/FritzBoxCBLWANDownstreamCurrRate.rrd’: null
2021-01-12 16:25:13.892 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/FritzBoxCBLWANDownstreamCurrRate.rrd’: null
2021-01-12 16:25:19.952 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/FritzBoxCBLWANDownstreamCurrRate.rrd’: null
2021-01-12 16:30:25.409 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/FritzBoxCBLWANDownstreamCurrRate.rrd’: null
2021-01-12 16:40:27.652 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/FritzBoxCBLWANDownstreamCurrRate.rrd’: null
2021-01-12 16:45:45.912 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/FritzBoxCBLWANDownstreamCurrRate.rrd’: null
2021-01-12 16:50:09.886 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/FritzBoxCBLWANDownstreamCurrRate.rrd’: null
2021-01-12 16:50:15.939 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/FritzBoxCBLWANDownstreamCurrRate.rrd’: null
2021-01-12 16:50:21.994 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/FritzBoxCBLWANDownstreamCurrRate.rrd’: null
2021-01-12 17:00:56.496 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/FritzBoxCBLWANDownstreamCurrRate.rrd’: null
2021-01-12 17:05:34.333 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/FritzBoxCBLWANDownstreamCurrRate.rrd’: null
2021-01-12 17:10:24.879 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/FritzBoxCBLWANDownstreamCurrRate.rrd’: null
2021-01-12 17:10:36.988 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/FritzBoxCBLWANDownstreamCurrRate.rrd’: null

Not sure why these show up. Never saw this with OH2.5 before (using same hardware - RPI4 4GB, and same OS - CentOS7). Another rrd-file that is written at the same frequency works well (/var/lib/openhab/persistence/rrd4j/FritzBoxCBLWANUpstreamCurrRate.rrd).

  • I actually use rrd4j for persistence
  • Permissions on the file mentioned are as follows:

-rwxr-xr-x. 1 openhab openhab 755692 Jan 12 17:21 /var/lib/openhab/persistence/rrd4j/FritzBoxCBLWANDownstreamCurrRate.rrd

The other file mentioned (and without errors) has the same permissions (and same rrd4j config):

-rwxr-xr-x. 1 openhab openhab 28280 Jan 12 17:30 /var/lib/openhab/persistence/rrd4j/FritzBoxCBLWANUpstreamCurrRate.rrd

  • Charts with the item work well
  • Other than that, rrd4j does not show an error for other files
  • Already tried deletion of the file

Any more information I can/should provide?

=> Any ideas are greatly appreciated!

Hi,
I have the same issue now.
I’m not even able to change anything in OpenHAB, as Openhab restarts again an d again after RRD4J error.
Already tried to remove all files, but errors pop up again after new generation of the file.

1 Like

I also have the same issue. It completely bricks everything.

If I delete the files it works for a little while, but I have to rewire all widgets. However later the problem comes back.

2021-02-17 20:30:03.495 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/ZWaveNode5507900WallDimmerModuleFlushMounted_Dimmercontent_copy.rrd’: Map failed
2021-02-17 20:30:06.409 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/device1DeviceShuffle.rrd’: Map failed
2021-02-17 20:30:09.511 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/LightFamilyDiningTableSwitchDimmer.rrd’: Map failed
2021-02-17 20:30:13.049 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/LightHallSwitchDimmer.rrd’: Map failed
2021-02-17 20:30:16.158 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/spotifyDeviceShuffle.rrd’: Map failed
2021-02-17 20:30:19.261 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/CamilleLightToggle.rrd’: Map failed
2021-02-17 20:30:22.374 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/device1DeviceVolume.rrd’: Map failed
2021-02-17 20:30:25.483 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/device2DeviceVolume.rrd’: Map failed
2021-02-17 20:30:28.598 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not cr

I have tried to change persistence to sqlite, but it does not help

Any idea of what is going on?

@Joerg_Schreiner @karwak Did you ever figure out what was going on?

Hi Christian,

unfortunately I wasn‘t able to get rid of this error… no clue what to do to fix it.

Any help is greatly appreciated!

Thanks and best regards
Karsten

Hi,
my installation was also bricked after a while.
Haven’t set up a new test system since then.
Joerg

Hi all,
I’ve got the same issue after adding a Fibaro remote control. No clue how to fix this.

All, I was seeing a similar error and have discovered that this isn’t just one error but a collection of errors. You need to pay close attention to the part after the last :.

So far I’ve seen:

  • Read failed, blah not mapped for I/O
  • null
  • Map failed

Having looked at the code I’ve learned the following.

  • All of these errors are caused by a file I/O problem. For almost all of them the solution will be to look at your file system and checking permissions, whether the system if full, activity on the file system, etc.

  • For me the null error was only occurring on my Items that were Groups that have an aggregation function and I had overridden the default persistence to store on everyUpdate and everyMinute (no restoreOnStartup). My theory is that when any member of one of these groups updated it generated lots of updates to the Group Item and there is a parallel processing problem where the DB file is still locked for one or more of these events. I’ve opened an issue for this. So far changing from everyUpdate to everyChange in my strategy has eliminated the errors in my logs.

3 Likes

Hi,

I was able to setup OH3 and creating nice Graphs from rrd4j database and also from InfluxDB (With Grafana).
But there seems something wrong with the persistence part. After, about one or two hours the readings stop on both graphs.
in the log-file i get the following message:

[ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file ‘/var/lib/openhab/persistence/rrd4j/Elektriciteitsmeter_HuidigeElektriciteitverbruik.rrd’: /var/lib/openhab/persistence/rrd4j/Elektriciteitsmeter_HuidigeElektriciteitverbruik.rrd (Read-only file system)

I changed the access level to those directories but the result is still the same (after e.g. one hour). It seems that the data storage in rrd4j and inflxdb stops randomly.

anyone an idea where to start?

The error is “Read-only file system”. Ultimately that is the operating system telling openHAB that it cannot write to that file. It is not a file permissions problem. Is the file system full? Are these Items being updated really fast? Can you manually create a file in that folder (e.g. sudo touch /var/lib/openhab/persistence/rrd4j/testfile)?

There really isn’t anything that can be done to OH to solve this directly. But given that both rrd4j and InfluxDB stopped at the same time hints that the file system is being filled. If you are on openHABian with ZRAM that’s easy to do as most of these writes are made to a RAM disk that isn’t that large.

1 Like

Like @rlkoshak already said, a full file system or fast item updates can cause this issue in general.
E.g., if you have running any cron jobs/triggers that will update the states of your items in an interval < 3 sec, the error Could not create rrd4j database file '/var/lib/openhab/persistence/rrd4j/ColorLight_Color.rrd': null will be thrown with a pretty high probability. The same happens if you play around with e.g. a switch like a kid (on, off, on, off, on …).

I have a party mode for my color lightbulb running that will change the color every x seconds. I accept the fact that this error will occur in the logs for small x, but I do not think that this is a problem. As a consequence the party mode will not always change the color every x seconds (still for small x), but sometimes only every 2*x seconds.

Anyways, I think short frequency updates should not lead to this error. The commands could be stacked in a queue or something.

For openhanbian: Deinstallation of zram did the trick. After a reboot, no errors!