[SOLVED] Persistence - What's the difference

I am running openhab 2.5M5 on a raspberry pi 3 B+ (openhabian).

Recently I switched from jdbc to influxdb.
The strange thing is, that I get an error message in openhab.log since:

2019-11-29 20:05:41.559 [INFO ] [arthome.model.script.car_state.rules] - CarResponse received update!
2019-11-29 20:05:41.565 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Evaluate car response': An error occurred during the script execution: index=0, size=0

Which is caused by this section wihtin my rule:

rule "Evaluate car response"
when
	Item CarResponse received update //changed
then
	logInfo("car_state.rules", "CarResponse received update!")
	if(previousState == NULL) {
		if(CarUpdate.state != ON) CarUpdate.postUpdate(ON)
		return; // failing fast
	}
...

I don’t get, why the result of this rule different, because the persistence file for both jdbc and influxdb is the same.

If I comment this out of the rule, the error disappears right away.
Any idea what might be different?

I believe that the implicit variable previousState is only available for the changed trigger
See: Rules | openHAB

2 Likes

You are absolutely right.

I just checked my history of the rule and previously it was changed (easily recognizable at the comment)

I missed that part while tweaking my system (and changing the persistence)

Obviously I need to keep myself focused on single changes.

Thanks a lot for pointing this out!

The problem is compounded by the fact that the error message doesn’t tell you squat about the nature of the error…

That’s right.

I knew this kind of error, so I was sure that it’s persistence related - which is the case.
Unfortunately in a different way I expected :wink: