Error when refreshing .items file

Hi,

I’ve been working through getting my items all set up and my sitemap is getting nice and full of data. However, last night at about 1am (doesn’t time fly…?) I updated the items file and started getting these errors. In the end I went to bed and left it, but this morning I had a couple of emails from Wunderground saying I’d maxed out my API limit for yesterday and today! So I commented out all the weather binding references and left it alone for the day.

I found this conversation in the google group:

https://groups.google.com/forum/#!category-topic/openhab/mqtt/bnnBpbydaGo

Which seems to be very similar.

Here’s a snippet from my openhab.log:

2015-11-17 08:07:34.142 [INFO ] [c.internal.ModelRepositoryImpl] - Refreshing model 'default.items'
2015-11-17 08:07:34.266 [INFO ] [.l.internal.LightwaveRfBinding] - LightwaveRf Binding changed for: Light_g00_tablelamp
2015-11-17 08:07:34.267 [INFO ] [.l.internal.LightwaveRfBinding] - LightwaveRf Binding changed for: Light_g00_kitchen_spots
2015-11-17 08:07:34.268 [INFO ] [.l.internal.LightwaveRfBinding] - LightwaveRf Binding changed for: Dimmer1
2015-11-17 08:07:34.269 [INFO ] [.l.internal.LightwaveRfBinding] - LightwaveRf Binding changed for: Light_g01_Living
2015-11-17 08:07:34.270 [INFO ] [.l.internal.LightwaveRfBinding] - LightwaveRf Binding changed for: Light_g00_dining_spots
2015-11-17 08:07:34.270 [INFO ] [.l.internal.LightwaveRfBinding] - LightwaveRf Binding changed for: Switch2
2015-11-17 08:07:34.271 [INFO ] [htwaveRfGenericBindingProvider] - ConfigString[room=1,device=1,type=DIMMER] Room[1] Device[1] Serial[null] Type[DIMMER] Poll[-1]
2015-11-17 08:07:34.272 [INFO ] [.l.internal.LightwaveRfBinding] - LightwaveRf Binding changed for: Light_g00_kitchen_spots
2015-11-17 08:07:34.273 [INFO ] [htwaveRfGenericBindingProvider] - ConfigString[room=1,device=2,type=DIMMER] Room[1] Device[2] Serial[null] Type[DIMMER] Poll[-1]
2015-11-17 08:07:34.273 [INFO ] [.l.internal.LightwaveRfBinding] - LightwaveRf Binding changed for: Light_g00_dining_spots
2015-11-17 08:07:34.274 [INFO ] [htwaveRfGenericBindingProvider] - ConfigString[room=1,device=4,type=SWITCH] Room[1] Device[4] Serial[null] Type[SWITCH] Poll[-1]
2015-11-17 08:07:34.275 [INFO ] [.l.internal.LightwaveRfBinding] - LightwaveRf Binding changed for: Light_g00_tablelamp
2015-11-17 08:07:34.276 [INFO ] [htwaveRfGenericBindingProvider] - ConfigString[room=4,device=1,type=DIMMER] Room[4] Device[1] Serial[null] Type[DIMMER] Poll[-1]
2015-11-17 08:07:34.276 [INFO ] [.l.internal.LightwaveRfBinding] - LightwaveRf Binding changed for: Light_g01_Living
2015-11-17 08:07:34.277 [INFO ] [htwaveRfGenericBindingProvider] - ConfigString[room=3,device=2,type=DIMMER] Room[3] Device[2] Serial[null] Type[DIMMER] Poll[-1]
2015-11-17 08:07:34.278 [INFO ] [.l.internal.LightwaveRfBinding] - LightwaveRf Binding changed for: Dimmer1
2015-11-17 08:07:34.279 [INFO ] [htwaveRfGenericBindingProvider] - ConfigString[room=3,device=3,type=SWITCH] Room[3] Device[3] Serial[null] Type[SWITCH] Poll[-1]
2015-11-17 08:07:34.279 [INFO ] [.l.internal.LightwaveRfBinding] - LightwaveRf Binding changed for: Switch2
2015-11-17 08:07:34.362 [ERROR] [.p.m.i.MysqlPersistenceService] - mySQL: Unable to find table for query 'All'.
2015-11-17 08:07:34.376 [ERROR] [.p.m.i.MysqlPersistenceService] - mySQL: Unable to find table for query 'g02'.
2015-11-17 08:07:34.384 [ERROR] [.p.m.i.MysqlPersistenceService] - mySQL: Unable to find table for query 'Weather'.
2015-11-17 08:07:34.391 [ERROR] [.p.m.i.MysqlPersistenceService] - mySQL: Unable to find table for query 'Present'.
2015-11-17 08:07:34.460 [ERROR] [.p.m.i.MysqlPersistenceService] - mySQL: Unable to find table for query 'Light_FF_Bath_Mirror'.
2015-11-17 08:07:34.464 [ERROR] [.p.m.i.MysqlPersistenceService] - mySQL: Unable to find table for query 'Dimmer1'.
2015-11-17 08:07:34.467 [ERROR] [.p.m.i.MysqlPersistenceService] - mySQL: Unable to find table for query 'Switch2'.
2015-11-17 08:07:34.470 [ERROR] [.p.m.i.MysqlPersistenceService] - mySQL: Unable to find table for query 'DSCAlarm'.
2015-11-17 08:07:34.474 [ERROR] [.p.m.i.MysqlPersistenceService] - mySQL: Unable to find table for query 'DSCAlarmPanel'.
2015-11-17 08:07:34.478 [ERROR] [.p.m.i.MysqlPersistenceService] - mySQL: Unable to find table for query 'DSCAlarmPartitions'.
2015-11-17 08:07:34.481 [ERROR] [.p.m.i.MysqlPersistenceService] - mySQL: Unable to find table for query 'DSCAlarmZones'.
2015-11-17 08:07:34.499 [ERROR] [.o.m.c.i.folder.FolderObserver] - An unexpected exception has occured
java.lang.IllegalArgumentException: No enum constant org.openhab.core.library.types.OnOffType.0
    at java.lang.Enum.valueOf(Enum.java:238) ~[na:1.8.0]
    at org.openhab.core.library.types.OnOffType.valueOf(OnOffType.java:1) ~[na:na]
    at org.openhab.persistence.mysql.internal.MysqlPersistenceService.query(MysqlPersistenceService.java:668) ~[na:na]
    at org.openhab.core.persistence.internal.PersistenceManager.initialize(PersistenceManager.java:382) ~[na:na]
    at org.openhab.core.persistence.internal.PersistenceManager.itemAdded(PersistenceManager.java:355) ~[na:na]
    at org.openhab.core.persistence.internal.PersistenceManager.allItemsChanged(PersistenceManager.java:350) ~[na:na]
    at org.openhab.core.internal.items.ItemRegistryImpl.allItemsChanged(ItemRegistryImpl.java:201) ~[na:na]
    at org.openhab.model.item.internal.GenericItemProvider.modelChanged(GenericItemProvider.java:393) ~[na:na]
    at org.openhab.model.core.internal.ModelRepositoryImpl.notifyListeners(ModelRepositoryImpl.java:159) ~[na:na]
    at org.openhab.model.core.internal.ModelRepositoryImpl.addOrRefreshModel(ModelRepositoryImpl.java:100) ~[na:na]
    at org.openhab.model.core.internal.folder.FolderObserver.checkFolder(FolderObserver.java:142) ~[na:na]
    at org.openhab.model.core.internal.folder.FolderObserver.run(FolderObserver.java:99) ~[na:na]

There definitely are mySQL tables for those four DSCAlarm items and Weather. I know that openHAB will complain about items that haven’t been populated yet. But these 4 definitely have been. The others are genuine empty items, so they’re fine.

All I’d been adding were the remaining zones for the DSC alarm, so I wasn’t doing anything ‘new’ or radical, just extending what had been there originally. It seems odd that this error has started happening out of the blue like this.

Can anyone shed any light from past experience?

Thanks

Chris

EDIT: I also found this topic on GitHub, which seems to be the same issue:

https://github.com/openhab/openhab/issues/3218

I’m pretty that issue is not related.

OK, thanks @watou. I’ll do some more digging around this evening.

Looking into it more, it sounds like an item somewhere is not returning the correct type of data that is being expected. Maybe something has got garbled on one of the lines…

From the source code:

> public enum OnOffType implements PrimitiveType, State, Command {
> 	ON, OFF;
> 		
> 	public String format(String pattern) {
> 		return String.format(pattern, this.toString());
> 	}

> }

It looks like the MySQL column has numeric values in although the item is a SwitchItem with an OnOffType. According to the source code, the column type for a switch value is CHAR(3) and holds an “ON” or “OFF” string. For some reason, it seems you are loading a “1” which cannot be converted to an OnOffType value. Is there any possibility that you changed an item type from something like a NumberItem or StringItem with 1 and 0 to a SwitchItem?

1 Like

Dear all,

sorry for digging out and hijacking this thread, but I have the smae issue.
Does anybody have an idea how to drill down the root cause? Already checked my latest changes, but did not find something similar.

Thanks
Manu