Warning when updating item "failed notifying listener"

Tags: #<Tag:0x00007f1730b1bf68> #<Tag:0x00007f1730b1b8d8> #<Tag:0x00007f1730b1b7c0>

Hello,

I have trouble with one of my items. It is showing this when updating (but only sometimes, not every time):

2020-08-16 21:35:00.417 [WARN ] [pse.smarthome.core.items.GenericItem] - failed notifying listener 'org.eclipse.smarthome.model.rule.runtime.internal.engine.RuleEngineImpl@1d0118e' about state update of item OU_Backyard_AbsoluteHumidity: Can not compare incompatible units.

java.lang.IllegalArgumentException: Can not compare incompatible units.

	at org.eclipse.smarthome.core.library.types.QuantityType.compareTo(QuantityType.java:174) ~[bundleFile:?]

	at org.eclipse.smarthome.core.library.types.QuantityType.equals(QuantityType.java:156) ~[bundleFile:?]

	at org.eclipse.smarthome.core.items.GenericItem$1.run(GenericItem.java:260) [bundleFile:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_265]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_265]

	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_265]

2020-08-16 21:35:00.417 [WARN ] [pse.smarthome.core.items.GenericItem] - failed notifying listener 'org.eclipse.smarthome.core.persistence.internal.PersistenceManagerImpl@1bae282' about state update of item OU_Backyard_AbsoluteHumidity: Can not compare incompatible units.

java.lang.IllegalArgumentException: Can not compare incompatible units.

	at org.eclipse.smarthome.core.library.types.QuantityType.compareTo(QuantityType.java:174) ~[bundleFile:?]

	at org.eclipse.smarthome.core.library.types.QuantityType.equals(QuantityType.java:156) ~[bundleFile:?]

	at org.eclipse.smarthome.core.items.GenericItem$1.run(GenericItem.java:260) [bundleFile:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_265]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_265]

	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_265]

2020-08-16 21:35:00.417 [WARN ] [pse.smarthome.core.items.GenericItem] - failed notifying listener 'OU_Backyard (Type=GroupItem, Members=14, State=NULL, Label=Hinterhof, Category=garage, Tags=[Garden], Groups=[Home, OU])' about state update of item OU_Backyard_AbsoluteHumidity: Can not compare incompatible units.

java.lang.IllegalArgumentException: Can not compare incompatible units.

	at org.eclipse.smarthome.core.library.types.QuantityType.compareTo(QuantityType.java:174) ~[bundleFile:?]

	at org.eclipse.smarthome.core.library.types.QuantityType.equals(QuantityType.java:156) ~[bundleFile:?]

	at org.eclipse.smarthome.core.items.GenericItem$1.run(GenericItem.java:260) [bundleFile:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_265]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_265]

	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_265]
2020-08-16 21:40:00.402 [WARN ] [pse.smarthome.core.items.GenericItem] - failed notifying listener 'org.eclipse.smarthome.model.rule.runtime.internal.engine.RuleEngineImpl@1d0118e' about state update of item OU_Backyard_AbsoluteHumidity: Unable to convert to system unit during compare.

java.lang.IllegalArgumentException: Unable to convert to system unit during compare.

	at org.eclipse.smarthome.core.library.types.QuantityType.compareTo(QuantityType.java:171) ~[bundleFile:?]

	at org.eclipse.smarthome.core.library.types.QuantityType.equals(QuantityType.java:156) ~[bundleFile:?]

	at org.eclipse.smarthome.core.items.GenericItem$1.run(GenericItem.java:260) [bundleFile:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_265]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_265]

	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_265]

I already deleted the persisted data in influxdb because I thought there was a problem with units.
This is the item:

Number:Dimensionless      	  OU_Backyard_AbsoluteHumidity          "Absolute Luftfeuchte [%.2f g/m³]"                                         <humidity>                       (OU_Backyard, Weather)

These are the groups:

Group           OU_Backyard               "Hinterhof"           <garage>             (Home, OU)                    ["Garden"]
Group           Weather                   "Wetter"              <sun_clouds>

This is the rule to calculate the value:

	var Number humi_abs = 0
	humi_abs = (6.112 * Math.exp((17.67 * (OU_Backyard_Temperature.state as QuantityType<Number>).doubleValue) / (243.5 + (OU_Backyard_Temperature.state as QuantityType<Number>).doubleValue)) * (2.1674 * OU_Backyard_RelativeHumidity.state as QuantityType<Number>).doubleValue) / (273.15 + (OU_Backyard_Temperature.state as QuantityType<Number>).doubleValue) // g/m^3
	OU_Backyard_AbsoluteHumidity.postUpdate(humi_abs)

I guess the error is in the formula for humi_abs but I cannot figure it out.

This is a known issue in OHC and resolved in OH 3.0. It is just a warning that can be ignored.

As a workaround I commented the item and rebooted. After that I uncommented leaving the groups still commented. After an hour seeing now errors i uncommented the groups. So far everything is running again. Thanks!

Hi all!
I have the same problem now in OH3!
I didn’t create any .persist files jet (complete new installation) and every other item is persisting just fine (influxdb)…

2021-01-19 10:54:26.861 [WARN ] [org.openhab.core.items.GenericItem  ] - failed notifying listener 'org.openhab.core.persistence.internal.PersistenceManagerImpl@1f40ff2' about state update of item ESPA0_Office2Humidity: newPosition > limit: (83916 > 8192)

java.lang.IllegalArgumentException: newPosition > limit: (83916 > 8192)

	at java.nio.Buffer.createPositionException(Buffer.java:318) ~[?:?]

	at java.nio.Buffer.position(Buffer.java:293) ~[?:?]

	at java.nio.ByteBuffer.position(ByteBuffer.java:1086) ~[?:?]

	at java.nio.MappedByteBuffer.position(MappedByteBuffer.java:226) ~[?:?]

	at java.nio.MappedByteBuffer.position(MappedByteBuffer.java:67) ~[?:?]

	at org.rrd4j.core.RrdNioBackend.read(RrdNioBackend.java:172) ~[?:?]

	at org.rrd4j.core.RrdBackend.readInt(RrdBackend.java:270) ~[?:?]

	at org.rrd4j.core.RrdPrimitive.readInt(RrdPrimitive.java:38) ~[?:?]

	at org.rrd4j.core.RrdInt.get(RrdInt.java:35) ~[?:?]

	at org.rrd4j.core.Archive.<init>(Archive.java:45) ~[?:?]

	at org.rrd4j.core.RrdDb.<init>(RrdDb.java:290) ~[?:?]

	at org.rrd4j.core.RrdDb.<init>(RrdDb.java:204) ~[?:?]

	at org.rrd4j.core.RrdDb.<init>(RrdDb.java:233) ~[?:?]

	at org.openhab.persistence.rrd4j.internal.RRD4jPersistenceService.getDB(RRD4jPersistenceService.java:322) ~[?:?]

	at org.openhab.persistence.rrd4j.internal.RRD4jPersistenceService.store(RRD4jPersistenceService.java:140) ~[?:?]

	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) [?:?]

Hi all,
I can confirm to have this issue also

2021-01-23 19:51:25.560 [WARN ] [org.openhab.core.items.GenericItem  ] - failed notifying listener 'org.openhab.core.persistence.internal.PersistenceManagerImpl@1aa7cd1' about state update of item SensorPower1: newPosition > limit: (83916 > 36864)
java.lang.IllegalArgumentException: newPosition > limit: (83916 > 36864)
	at java.nio.Buffer.createPositionException(Buffer.java:318) ~[?:?]
	at java.nio.Buffer.position(Buffer.java:293) ~[?:?]
	at java.nio.ByteBuffer.position(ByteBuffer.java:1086) ~[?:?]
	at java.nio.MappedByteBuffer.position(MappedByteBuffer.java:226) ~[?:?]
	at java.nio.MappedByteBuffer.position(MappedByteBuffer.java:67) ~[?:?]
	at org.rrd4j.core.RrdNioBackend.read(RrdNioBackend.java:172) ~[?:?]
	at org.rrd4j.core.RrdBackend.readInt(RrdBackend.java:270) ~[?:?]
	at org.rrd4j.core.RrdPrimitive.readInt(RrdPrimitive.java:38) ~[?:?]
	at org.rrd4j.core.RrdInt.get(RrdInt.java:35) ~[?:?]
	at org.rrd4j.core.Archive.<init>(Archive.java:45) ~[?:?]
	at org.rrd4j.core.RrdDb.<init>(RrdDb.java:290) ~[?:?]
	at org.rrd4j.core.RrdDb.<init>(RrdDb.java:204) ~[?:?]
	at org.rrd4j.core.RrdDb.<init>(RrdDb.java:233) ~[?:?]
	at org.openhab.persistence.rrd4j.internal.RRD4jPersistenceService.getDB(RRD4jPersistenceService.java:322) ~[?:?]
	at org.openhab.persistence.rrd4j.internal.RRD4jPersistenceService.store(RRD4jPersistenceService.java:140) ~[?:?]
	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) [?:?]

I have also other items generating the same WARN message.
It seems there is relation with a file permission issue, because al these items also had a ‘Permission denied’ error in the openhab.log file.

openhab.log:2021-01-23 17:28:53.170 [ERROR] [d4j.internal.RRD4jPersistenceService] - Could not create rrd4j database file '/var/lib/openhab/persistence/rrd4j/SensorPower1.rrd': /var/lib/openhab/persistence/rrd4j/SensorPower1.rrd (Permission denied)

/var/lib/openhab/persistence/rrd4j
-rw------- 1 root root 36K Jan 16 17:19 SensorPower1.rrd

I changed the permissions and owner to 644 and openhab.openhab just like the other item files.

sudo chmod -R 644 *
sudo chown openhab.openhab *
-rw-r–r-- 1 openhab openhab 36K Jan 16 17:19 SensorPower1.rrd

I manually deleted the Items.rrd files of the Items causing a Warning. After a while the Items.rrd files were recreated and I had no warnings anymore.

Thanks! deleting the .rrd file and then use the fix permission option in openhabian-config did the trick!