Need help identifying ERROR causing rule / bundle


I have installed a brand new OH on my Raspi 3B+ with openhabian 1.5 and OH 2.5.3 stable.
However, I get some errors I would like to solve step by step.

For some I don’t have a clue where to look for an error. Sometimes ther is an indication to check line xx and column yy. This helps a bit though even without the rule’e name.

How about these kind of errors:

2020-04-07 16:33:04.630 [ERROR] [ersey.server.ServerRuntime$Responder] - An I/O error has occurred while writing a response message entity to the container output stream.
        at org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundWriteTo( ~[?:?]
        at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed( ~[bundleFile:?]
        at org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo( ~[bundleFile:?]
        at org.glassfish.jersey.server.ServerRuntime$Responder.writeResponse( [bundleFile:?]
        at org.glassfish.jersey.server.ServerRuntime$Responder.processResponse( [bundleFile:?]
        at org.glassfish.jersey.server.ServerRuntime$Responder.process( [bundleFile:?]
        at org.glassfish.jersey.server.ServerRuntime$ [bundleFile:?]
        at org.glassfish.jersey.internal.Errors$ [bundleFile:?]
        at org.glassfish.jersey.internal.Errors$ [bundleFile:?]
        at org.glassfish.jersey.internal.Errors.process( [bundleFile:?]
        at org.glassfish.jersey.internal.Errors.process( [bundleFile:?]
        at org.glassfish.jersey.internal.Errors.process( [bundleFile:?]
        at org.glassfish.jersey.process.internal.RequestScope.runInScope( [bundleFile:?]
        at org.glassfish.jersey.server.ServerRuntime.process( [bundleFile:?]
        at org.glassfish.jersey.server.ApplicationHandler.handle( [bundleFile:?]
        at org.glassfish.jersey.servlet.WebComponent.serviceImpl( [bundleFile:?]
        at org.glassfish.jersey.servlet.WebComponent.service( [bundleFile:?]
        at org.glassfish.jersey.servlet.ServletContainer.service( [bundleFile:?]
        at org.glassfish.jersey.servlet.ServletContainer.service( [bundleFile:?]
        at org.glassfish.jersey.servlet.ServletContainer.service( [bundleFile:?]
        at com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge.service( [bundleFile:?]
        at org.eclipse.jetty.servlet.ServletHolder.handle( [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.servlet.ServletHandler.doHandle( [bundleFile:9.4.20.v20190813]

bundleFIle:? Does not really help.
does not show up when checking karaf:
bundle:list | grep 9.4.20.v20190813

Any suggestion how to find out where to look for would be greatly appreciated.

That’s usually about a UI. Like you’ve rebooted OH, and a browser somewhere is still trying to talk to the “old” boot, and needs a refresh.

Thanks for the quick response.
So how to perform a refresh?

I usually remove the rules when shutting down and move them back into place 10 min after system started.
I thought approx 60 min after system started OH should be settled!=´?

I’m talking browser refresh, at your BasicUI or HABpanel or whatever. A live UI.

I suppose PaperUI as well, I don’t know.

Oh, stupid me :wink:
That might be possible that I have a Paper UI or such open.
I am just wondering why there is no reference to the binding.
(no offense) This would make thing easier for rookies like me.

Another issue popping up very often is this one:

2020-04-08 07:25:18.055 [WARN ] [pse.smarthome.core.items.GenericItem] - failed notifying listener 'org.eclipse.smarthome.core.persistence.internal.PersistenceManagerImpl@1bac17e' a$
java.lang.IndexOutOfBoundsException: null
        at java.nio.Buffer.checkIndex( ~[?:1.8.0_222]
        at java.nio.HeapByteBuffer.getLong( ~[?:1.8.0_222]
        at org.mapdb.DataInput2.readLong( ~[?:?]
        at org.openhab.persistence.mapdb.internal.MapDBitemSerializer.deserialize( ~[?:?]
        at org.openhab.persistence.mapdb.internal.MapDBitemSerializer.deserialize( ~[?:?]
        at org.mapdb.BTreeMap$NodeSerializer.deserialize( ~[?:?]
        at org.mapdb.BTreeMap$NodeSerializer.deserialize( ~[?:?]
        at org.mapdb.Store.deserialize( ~[?:?]
        at org.mapdb.StoreDirect.get2( ~[?:?]
        at org.mapdb.StoreWAL.get2( ~[?:?]
        at org.mapdb.StoreWAL.get( ~[?:?]
        at org.mapdb.Caches$HashTable.get( ~[?:?]
        at org.mapdb.EngineWrapper.get( ~[?:?]
        at org.mapdb.BTreeMap.put2( ~[?:?]
        at org.mapdb.BTreeMap.put( ~[?:?]
        at ~[?:?]
        at ~[?:?]
        at org.eclipse.smarthome.core.persistence.internal.PersistenceManagerImpl.handleStateEvent( ~[?:?]
        at org.eclipse.smarthome.core.persistence.internal.PersistenceManagerImpl.stateChanged( ~[?:?]
        at org.eclipse.smarthome.core.items.GenericItem$ [bundleFile:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker( [?:1.8.0_222]
        at java.util.concurrent.ThreadPoolExecutor$ [?:1.8.0_222]
        at [?:1.8.0_222]

I used to have persistence issues before the fresh install as well and though, that I messed up my system too much.
However, this is still happening (although I don’t know if it’s the same issue as before).

I assume there is an item still null which cannot be stored in mapdb. But which?
Because I have possibly many items on null because of the brand new start (including persistence),.

Is this an indicator to the item?

No, I think that is a ref to a service scheduled job (along the “everyChange” lines of something listening for Item events.

The log includes magic words mapdb and genericItem, so I reckon you’re on the right trail.

Depending what you mean … a selected Item state NULL is absolutely normal, persistence service knows exactly how to deal with that - by not persisting it!. But it will not produce any error.

null in terms of an Item not existing, I’m not quite so sure.
I do not think there is any problem at all if you include Item names that do not exist in your xxx.persist file, even if you specify restoreOnStartup for them.
I do not think there is any problem at all if you include Item names that have never yet had any data persisted in your xxx.persist file, even if you specify restoreOnStartup for them.

I would speculate the exact opposite problem. Are you persisting everything “lazily”? Is there something like a String Item holding monster sized data - a webpage scrape, or image code, or suchlike?

What has been noted to mess up some databases is changing an Item type e.g. Number to String, after it has started persisting. I’ve not heard of that being a problem for mapdb though.
Luckily, because it is mapdb, you do have the option to delete the whole db without losing much in the way of historical records.

Same would be effective if there is some weird existing corruption in the db itself.

I think I would review my mapdb.persist, make sure it looked what I wanted.
Uninstall mapdb
Delete the whole /userdata/persistence/mapdb/ folder and contents.
Delete /conf/services/mapdb.cfg file
Reinstall mapdb and let it start afresh with clean db, should pick up old mapdb.persist.

Thank you for your thorough response.
I am glad to hear that even very experienced guys like you struggle with the one or other issue :wink:

The only large string is the response from my car (about 20 lines of json response)
Is that too much?

That’s exactly the issue I have experienced on sql, maria and sqlite which cost me a lot of hair :wink:

Will do - thank you.
My mapdb only has one line (is this an issue? I never experienced issues with this yet):
Maybe with Location items which cannot be persisted anyway!?
* : strategy = everyChange, restoreOnStartup

1 Like

FYI, there is an option in the openhabian-config tool to have the rules load last.

Shouldn’t be any bother, I don’t know if mapdb has a limit but it is likely way bigger than that.

That is a very valid point, I do not know how gracefully the essentially 1.x persistence service mapdb deals with an Item type not invented until 2.0
It certainly messes up with other db.
Sounds like a likely culprit.

I’ve never stored that much in mapdb - occupation timestamps and the like. Prefer to write rules that deal sensibly with NULL after startup as “unknown-yet”, to blanket restores.

Thinking on it, I made quite a few custom icon sets as well, featuring a question mark as the default image, to prevent misleading UI icons for NULL.

Thanks, I will try to change this then.

Awesome - I didn’t know about this !
BTW: I have changed the mapdb persistence to ignore Location items and will see what happens.

That was (most likely) the issue.
After changing the mapdb in such way, that only other items than Locations will be taken into account I did not see this error anymore:
failed notifying listener

Thanks a lot for guiding me in the right direction!

1 Like