MapDB creates errors

Tags: #<Tag:0x00007fc8f1131408>

Short after installing MapDB for restore it creates lot of warnings??:

2018-04-10 15:43:37.755 [vent.ItemStateChangedEvent] - Temperatur_kjoleskap changed from 5.800000000000001 to 5.9

==> /var/log/openhab2/openhab.log <==

2018-04-10 15:43:37.753 [WARN ] [pse.smarthome.core.items.GenericItem] - failed notifying listener ‘org.eclipse.smarthome.core.persistence.internal.PersistenceManagerImpl@29fb58’ about state update of item Temperatur_kjoleskap: 2018-02-16 is not in a valid format.

java.lang.IllegalArgumentException: 2018-02-16 is not in a valid format.

at org.openhab.core.library.types.DateTimeType.<init>(DateTimeType.java:50) [200:org.openhab.core.compat1x:2.2.0]

at org.openhab.core.library.types.DateTimeType.valueOf(DateTimeType.java:64) [200:org.openhab.core.compat1x:2.2.0]

at org.openhab.persistence.mapdb.internal.MapDBitemSerializer.deserialize(MapDBitemSerializer.java:59) [253:org.openhab.persistence.mapdb:1.11.0]

at org.openhab.persistence.mapdb.internal.MapDBitemSerializer.deserialize(MapDBitemSerializer.java:1) [253:org.openhab.persistence.mapdb:1.11.0]

at org.mapdb.BTreeMap$NodeSerializer.deserialize(BTreeMap.java:449) [253:org.openhab.persistence.mapdb:1.11.0]

at org.mapdb.BTreeMap$NodeSerializer.deserialize(BTreeMap.java:288) [253:org.openhab.persistence.mapdb:1.11.0]

at org.mapdb.Store.deserialize(Store.java:297) [253:org.openhab.persistence.mapdb:1.11.0]

at org.mapdb.StoreDirect.get2(StoreDirect.java:475) [253:org.openhab.persistence.mapdb:1.11.0]

at org.mapdb.StoreWAL.get2(StoreWAL.java:336) [253:org.openhab.persistence.mapdb:1.11.0]

at org.mapdb.StoreWAL.get(StoreWAL.java:320) [253:org.openhab.persistence.mapdb:1.11.0]

at org.mapdb.Caches$HashTable.get(Caches.java:246) [253:org.openhab.persistence.mapdb:1.11.0]

at org.mapdb.EngineWrapper.get(EngineWrapper.java:58) [253:org.openhab.persistence.mapdb:1.11.0]

at org.mapdb.BTreeMap.put2(BTreeMap.java:677) [253:org.openhab.persistence.mapdb:1.11.0]

at org.mapdb.BTreeMap.put(BTreeMap.java:643) [253:org.openhab.persistence.mapdb:1.11.0]

at org.openhab.persistence.mapdb.internal.MapDBPersistenceService.store(MapDBPersistenceService.java:161) [253:org.openhab.persistence.mapdb:1.11.0]

at org.openhab.core.persistence.internal.PersistenceServiceDelegate.store(PersistenceServiceDelegate.java:55) [200:org.openhab.core.compat1x:2.2.0]

at org.eclipse.smarthome.core.persistence.internal.PersistenceManagerImpl.handleStateEvent(PersistenceManagerImpl.java:131) [114:org.eclipse.smarthome.core.persistence:0.10.0.b1]

at org.eclipse.smarthome.core.persistence.internal.PersistenceManagerImpl.stateChanged(PersistenceManagerImpl.java:432) [114:org.eclipse.smarthome.core.persistence:0.10.0.b1]

at org.eclipse.smarthome.core.items.GenericItem$1.run(GenericItem.java:234) [109:org.eclipse.smarthome.core:0.10.0.b1]

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

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

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

Caused by: java.text.ParseException: Unparseable date: “2018-02-16”

at java.text.DateFormat.parse(DateFormat.java:366) ~[?:?]

at org.openhab.core.library.types.DateTimeType.<init>(DateTimeType.java:47) ~[?:?]

... 21 more

Somehow a date string makes it’s way into you item
What is your item Temperatur_kjoleskap definition?

Thank you for answering :slight_smile:
It seems quite random because it does this with a lot of other items aswell.
This is an other “standard” weather item that givs same error:
DateTime ObservationTime “Oppdatert [%1$tH:%1$tM]” {channel=“weatherunderground:weather:cd8316cc:current#observationTime”}

This is my mapdb.persist:
Strategies {
default = everyUpdate
}

Items {
// persist all Items on every change and restore them from the MapDB at startup
* : strategy = everyChange, restoreOnStartup
}

l
018-04-11 08:26:02.890 [vent.ItemStateChangedEvent] - ObservationTime changed from 2018-04-11T08:20:59.000+0200 to 2018-04-11T08:25:59.000+0200

==> /var/log/openhab2/openhab.log <==

2018-04-11 08:26:02.935 [WARN ] [pse.smarthome.core.items.GenericItem] - failed notifying listener ‘org.eclipse.smarthome.core.persistence.internal.PersistenceManagerImpl@a732d0’ about state update of item ObservationTime: 2018-02-16 is not in a valid format.

java.lang.IllegalArgumentException: 2018-02-16 is not in a valid format.

at org.openhab.core.library.types.DateTimeType.<init>(DateTimeType.java:50) [200:org.openhab.core.compat1x:2.2.0]

at org.openhab.core.library.types.DateTimeType.valueOf(DateTimeType.java:64) [200:org.openhab.core.compat1x:2.2.0]

2018-02-16 is the 16th February.
As a string… Mmmmhh…

Do you have this date hard coded in your code anywhere?

hmm…this is very strange, all the errorrs says : 2018-02-16 is not valid format

Any idea where I can look for this value?

File by file in your conf folder
If you can’t find it anywhere, I recommend clearing your cache:

Did not find it anywhere ;( cleared the cache and got this after restart:

2018-04-11 11:23:45.793 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel

==> /var/log/openhab2/events.log <==

2018-04-11 11:23:46.479 [vent.ItemStateChangedEvent] - x300_basseng_temp_inn changed from 5.2 to 5.3

==> /var/log/openhab2/openhab.log <==

2018-04-11 11:23:46.351 [ERROR] [g.eclipse.smarthome.core.persistence] - [org.eclipse.smarthome.core.persistence.internal.PersistenceManagerImpl(8)] The addPersistenceService method has thrown an exception

java.lang.IllegalArgumentException: 2018-02-16 is not in a valid format.

at org.openhab.core.library.types.DateTimeType.<init>(DateTimeType.java:50) ~[?:?]

at org.openhab.core.library.types.DateTimeType.valueOf(DateTimeType.java:64) ~[?:?]

at org.openhab.persistence.mapdb.internal.MapDBitemSerializer.deserialize(MapDBitemSerializer.java:59) ~[?:?]

at org.openhab.persistence.mapdb.internal.MapDBitemSerializer.deserialize(MapDBitemSerializer.java:1) ~[?:?]

at org.mapdb.BTreeMap$NodeSerializer.deserialize(BTreeMap.java:449) ~[?:?]

at org.mapdb.BTreeMap$NodeSerializer.deserialize(BTreeMap.java:288) ~[?:?]

at org.mapdb.Store.deserialize(Store.java:297) ~[?:?]

at org.mapdb.StoreDirect.get2(StoreDirect.java:475) ~[?:?]

at org.mapdb.StoreWAL.get2(StoreWAL.java:336) ~[?:?]

at org.mapdb.StoreWAL.get(StoreWAL.java:320) ~[?:?]

at org.mapdb.Caches$HashTable.get(Caches.java:246) ~[?:?]

at org.mapdb.EngineWrapper.get(EngineWrapper.java:58) ~[?:?]

at org.mapdb.BTreeMap.get(BTreeMap.java:602) ~[?:?]

at org.mapdb.BTreeMap.get(BTreeMap.java:589) ~[?:?]

at org.openhab.persistence.mapdb.internal.MapDBPersistenceService.query(MapDBPersistenceService.java:175) ~[?:?]

at org.openhab.core.persistence.internal.QueryablePersistenceServiceDelegate.query(QueryablePersistenceServiceDelegate.java:47) ~[?:?]

at org.eclipse.smarthome.core.persistence.internal.PersistenceManagerImpl.initialize(PersistenceManagerImpl.java:262) ~[?:?]

at org.eclipse.smarthome.core.persistence.internal.PersistenceManagerImpl.startEventHandling(PersistenceManagerImpl.java:377) ~[?:?]

at org.eclipse.smarthome.core.persistence.internal.PersistenceManagerImpl.addPersistenceService(PersistenceManagerImpl.java:107) ~[?:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]

at org.apache.felix.scr.impl.inject.BaseMethod.invokeMethod(BaseMethod.java:229) ~[?:?]

at org.apache.felix.scr.impl.inject.BaseMethod.access$500(BaseMethod.java:39) ~[?:?]

at org.apache.felix.scr.impl.inject.BaseMethod$Resolved.invoke(BaseMethod.java:650) ~[?:?]

at org.apache.felix.scr.impl.inject.BaseMethod.invoke(BaseMethod.java:506) ~[?:?]

at org.apache.felix.scr.impl.inject.BindMethod.invoke(BindMethod.java:658) ~[?:?]

at org.apache.felix.scr.impl.manager.DependencyManager.doInvokeBindMethod(DependencyManager.java:1722) ~[?:?]

at org.apache.felix.scr.impl.manager.DependencyManager.invokeBindMethod(DependencyManager.java:1699) ~[?:?]

at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeBindMethod(SingleComponentManager.java:372) ~[?:?]

at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:320) ~[?:?]

at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:291) ~[?:?]

at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1215) ~[?:?]

at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1136) ~[?:?]

at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:945) ~[?:?]

at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:881) ~[?:?]

at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1167) ~[?:?]

at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:127) ~[?:?]

at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109) ~[?:?]

at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:915) ~[?:?]

at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) ~[?:?]

at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) ~[?:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862) ~[?:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801) ~[?:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127) ~[?:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225) ~[?:?]

at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464) ~[?:?]

at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:482) ~[?:?]

at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:999) ~[?:?]

at org.openhab.core.persistence.internal.PersistenceServiceFactory.registerDelegateService(PersistenceServiceFactory.java:72) ~[?:?]

at org.openhab.core.persistence.internal.PersistenceServiceFactory.addPersistenceService(PersistenceServiceFactory.java:53) ~[?:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]

at org.apache.felix.scr.impl.inject.BaseMethod.invokeMethod(BaseMethod.java:229) ~[?:?]

at org.apache.felix.scr.impl.inject.BaseMethod.access$500(BaseMethod.java:39) ~[?:?]

at org.apache.felix.scr.impl.inject.BaseMethod$Resolved.invoke(BaseMethod.java:650) ~[?:?]

at org.apache.felix.scr.impl.inject.BaseMethod.invoke(BaseMethod.java:506) ~[?:?]

at org.apache.felix.scr.impl.inject.BindMethod.invoke(BindMethod.java:658) ~[?:?]

at org.apache.felix.scr.impl.manager.DependencyManager.doInvokeBindMethod(DependencyManager.java:1722) ~[?:?]

at org.apache.felix.scr.impl.manager.DependencyManager.invokeBindMethod(DependencyManager.java:1699) ~[?:?]

at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeBindMethod(SingleComponentManager.java:372) ~[?:?]

at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:320) ~[?:?]

at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:291) ~[?:?]

at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1215) ~[?:?]

at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1136) ~[?:?]

at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:945) ~[?:?]

at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:881) ~[?:?]

at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1167) ~[?:?]

at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:127) ~[?:?]

at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109) ~[?:?]

at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:915) ~[?:?]

at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) ~[?:?]

at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) ~[?:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862) ~[?:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801) ~[?:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127) ~[?:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225) ~[?:?]

at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464) ~[?:?]

at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:887) ~[?:?]

at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:874) ~[?:?]

at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:132) ~[?:?]

at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:941) ~[?:?]

at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:741) ~[?:?]

at org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal(AbstractComponentManager.java:675) ~[?:?]

at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:430) ~[?:?]

at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:657) ~[?:?]

at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:341) ~[?:?]

at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:390) ~[?:?]

at org.apache.felix.scr.impl.Activator.access$200(Activator.java:54) ~[?:?]

at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:265) ~[?:?]

at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:254) ~[?:?]

at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:227) ~[?:?]

at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:482) ~[?:?]

at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:415) ~[?:?]

at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232) ~[?:?]

at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444) ~[?:?]

at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:903) ~[?:?]

at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) ~[?:?]

at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) ~[?:?]

at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:213) ~[?:?]

at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:120) ~[?:?]

at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:112) ~[?:?]

at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:156) ~[?:?]

at org.eclipse.osgi.container.Module.publishEvent(Module.java:476) ~[?:?]

at org.eclipse.osgi.container.Module.start(Module.java:467) ~[?:?]

at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[?:?]

at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:402) ~[?:?]

at org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1361) ~[?:?]

at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:888) ~[?:?]

at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1248) ~[?:?]

at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$1(FeaturesServiceImpl.java:1147) ~[?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

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

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

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

Caused by: java.text.ParseException: Unparseable date: “2018-02-16”

at java.text.DateFormat.parse(DateFormat.java:366) ~[?:?]

at org.openhab.core.library.types.DateTimeType.<init>(DateTimeType.java:47) ~[?:?]

... 117 more

Can you post your mapdb.persist file?

Strategies {
default = everyUpdate
}

Items {
// persist all Items on every change and restore them from the MapDB at startup
* : strategy = everyChange, restoreOnStartup
}

Nothing wrong there

Try that:

  • In paperUI uninstall the mapdb persistence
  • Stop OH
  • Rename your mapdb.persist to mapdb.back
  • Start OH
  • Install the mapdb service
  • Stop OH
  • Remove the mapdb.persist that was auto created
  • Rename your mapdb.back to mapdb.persist
  • Start OH

When reinstalling mapdb service it did not create a mapdb.persist file in the Persistence folder…Should it?

Not necessarily, some binding do and some don’t
I just put it in there just in case it did
Rename your mapdb.back back to mapdb.persist and start OH
I really hope that will do it because I am fresh out of ideas

Sorry but it did not …

Just a thought: your DateTime object only seems to give a problem for the date part, which you have not specified in your formatting string; I have such an object defined as this:

DateTime    Date    "Now:  [%1$ta, %1$tm/%1$td/%1$ty, %1$tT]" <clock>  (Status) { channel="ntp:ntp:local:dateTime" }

MapDB does not complain. I know it is far fetched, but the fact that only the date part is given in the error made me think about this. (Edit, the following is a wrong statement, see below (thank you @vzorglub): MapDB only persists numbers and maybe your formatting throws off something.)

Thanks :wink: but I don’t have any Datetime items other than observation time, it still complains about this for temperature and humidity items… Whats strange is that it only complains about the same date every time, 2018-02-16…

Rd4j only stores numbers. Mapdb will store anything (almost). That is not the issue

1 Like

I wonder What it is trying to persist , since it looks like its the same data each time?