Org.openhab.core.persistence:3.0.1 throws exception because of DayOfMonth = 0 in cron expression '0 0 0 0 * ?'

Dear Community,

A few days ago, I activated the persistence service on OpenHAB 3.0.1 with InfluxDB 1, installed via Openhabian. It basically works, but each time when OpenHAB starts, I find the following exception in the log file:

2021-03-26 13:03:26.855 [ERROR] [org.openhab.core.persistence        ] - bundle org.openhab.core.persistence:3.0.1 (184)[org.openhab.core.persistence.internal.PersistenceManagerImpl(224)] : The addPersistenceService method has thrown an exception

java.lang.IllegalArgumentException: Value too small in range in cron expression '0 0 0 0 * ?' in field 'DayOfMonth': value 0, minimum: 1

Is this an effect because storing data in the InfluxDB started later than March 1 in this month? Is this an error message that requires attention?

Best regards,
Peter

I think this may be to do with the persist settings, as in “everyMonth” or something. Do you have a influxdb.persist file or are you relying on the “default to everything”?

Hi,

my influxdb.persist contains the following settings:

Strategies {
    everyQuarterHour : "0 0,15,30,45 * * * ?"
    everyHour : "0 0 * * * ?"
    everyDay  : "0 0 0 * * ?"
    everyMinute  : "0 0 0 0 * ?"
    default = everyChange
}

Items {
    * : strategy = everyChange, everyQuarterHour
}

Best regards,
Peter

The error message was caused by a wrong cron expression:

Which should read:

everyMinute  : "0 * * * * ?"

After correcting this, the error was gone.

1 Like