using OH3 (stable) on Ubuntu 20.4 with jdbc mysql.
Because default database is now set automatically to jdbc for recovery for all items there is the need to persistence.
If having an item for an Image (e.g. openweather-binding image owm current) the creation of the table gives a failure:
java.sql.SQLException: Column length too big for column ‘value’ (max = 21845); use BLOB or TEXT instead Query: CREATE TABLE IF NOT EXISTS owmcurrentconditionicondel_1839 (time TIMESTAMP(3) NOT NULL, value VARCHAR(65500), PRIMARY KEY(time)) Parameters:
I try to solve this create the table directly my hand with TYPE BLOB, will see if that will work.
But the binding should be able to create this tables in OH3 on itself too.
Here’s one other thing you could try (and I’m not sure of this will work).
In your jdbc.cfg, try adding this line, then restart the bundle (or restart openHAB).
sqltype.IMAGE=VARCHAR(21800)
Edit: I used 21800 instead of 21845 because I think that number may represent the sum of all columns in the table. So I allowed some wiggle room to account for the time column.
I just added and will have a look next days. Some tables I already created with BLOB, but I’ll try the others now without manual intervention and the added config.
Because tables at the moment all created, I can not tell if the added line works.
But I can inform, VARCHAR(21800) don’t works.
persistence saving the pictures then, but isn’t able to reload giving errors:
2021-01-15 00:07:36.982 [ERROR] [org.openhab.core.items.GenericItem ] - Tried to set invalid state raw type (image/png): 2773 bytes (StringType) on item owmFC3hConditionIcon of type ImageItem, ignoring it
2021-01-15 00:07:37.003 [ERROR] [org.openhab.core.items.GenericItem ] - Tried to set invalid state raw type (image/png): 2773 bytes (StringType) on item owmFC24hConditionIcon of type ImageItem, ignoring it
2021-01-15 00:07:37.049 [ERROR] [org.openhab.core.items.GenericItem ] - Tried to set invalid state raw type (image/png): 2773 bytes (StringType) on item owmFC6hConditionIcon of type ImageItem, ignoring it
2021-01-15 00:07:37.120 [ERROR] [org.openhab.core.items.GenericItem ] - Tried to set invalid state raw type (image/png): 3901 bytes (StringType) on item owmFC9hConditionIcon of type ImageItem, ignoring it
I have other JDBC errors at the moment … The BLOB seemed to have solved the issue. I have created a new database with the BLOB for images and now I have different errors which I am fighting now … Thanks for the update!
I have created a new blank database from scratch for the new OH version as I migrated from OH 2.5.12 to OH 3.1.0-M3. The acess works as OH creates all tables and some of them receive updates … So it cannot be a general problem. I am using a mariadb via the JDBC driver …
13:27:44.343 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method 'QueryablePersistenceService.query()' on 'org.openhab.persistence.jdbc.internal.JdbcPersistenceService@7e37e595': class [B cannot be cast to class java.lang.String ([B and java.lang.String are in module java.base of loader 'bootstrap')
13:27:44.358 [ERROR] [tence.internal.PersistenceManagerImpl] - Exception occurred while querying persistence service 'jdbc': class [B cannot be cast to class java.lang.String ([B and java.lang.String are in module java.base of loader 'bootstrap')
13:27:44.564 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method 'QueryablePersistenceService.query()' on 'org.openhab.persistence.jdbc.internal.JdbcPersistenceService@7e37e595': class [B cannot be cast to class java.lang.String ([B and java.lang.String are in module java.base of loader 'bootstrap')
13:27:44.577 [ERROR] [tence.internal.PersistenceManagerImpl] - Exception occurred while querying persistence service 'jdbc': class [B cannot be cast to class java.lang.String ([B and java.lang.String are in module java.base of loader 'bootstrap')
13:27:44.776 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method 'QueryablePersistenceService.query()' on 'org.openhab.persistence.jdbc.internal.JdbcPersistenceService@7e37e595': class [B cannot be cast to class java.lang.String ([B and java.lang.String are in module java.base of loader 'bootstrap')
13:27:44.780 [ERROR] [tence.internal.PersistenceManagerImpl] - Exception occurred while querying persistence service 'jdbc': class [B cannot be cast to class java.lang.String ([B and java.lang.String are in module java.base of loader 'bootstrap')
13:27:44.856 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method 'QueryablePersistenceService.query()' on 'org.openhab.persistence.jdbc.internal.JdbcPersistenceService@7e37e595': class [B cannot be cast to class java.lang.String ([B and java.lang.String are in module java.base of loader 'bootstrap')
13:27:44.861 [ERROR] [tence.internal.PersistenceManagerImpl] - Exception occurred while querying persistence service 'jdbc': class [B cannot be cast to class java.lang.String ([B and java.lang.String are in module java.base of loader 'bootstrap')
13:27:45.093 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method 'QueryablePersistenceService.query()' on 'org.openhab.persistence.jdbc.internal.JdbcPersistenceService@7e37e595': class [B cannot be cast to class java.lang.String ([B and java.lang.String are in module java.base of loader 'bootstrap')
13:27:45.099 [ERROR] [tence.internal.PersistenceManagerImpl] - Exception occurred while querying persistence service 'jdbc': class [B cannot be cast to class java.lang.String ([B and java.lang.String are in module java.base of loader 'bootstrap')
13:27:45.410 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method 'QueryablePersistenceService.query()' on 'org.openhab.persistence.jdbc.internal.JdbcPersistenceService@7e37e595': class [B cannot be cast to class java.lang.String ([B and java.lang.String are in module java.base of loader 'bootstrap')
13:27:45.414 [ERROR] [tence.internal.PersistenceManagerImpl] - Exception occurred while querying persistence service 'jdbc': class [B cannot be cast to class java.lang.String ([B and java.lang.String are in module java.base of loader 'bootstrap')
13:27:45.854 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method 'QueryablePersistenceService.query()' on 'org.openhab.persistence.jdbc.internal.JdbcPersistenceService@7e37e595': class [B cannot be cast to class java.lang.String ([B and java.lang.String are in module java.base of loader 'bootstrap')
13:27:45.858 [ERROR] [tence.internal.PersistenceManagerImpl] - Exception occurred while querying persistence service 'jdbc': class [B cannot be cast to class java.lang.String ([B and java.lang.String are in module java.base of loader 'bootstrap')
13:27:46.148 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method 'QueryablePersistenceService.query()' on 'org.openhab.persistence.jdbc.internal.JdbcPersistenceService@7e37e595': class [B cannot be cast to class java.lang.String ([B and java.lang.String are in module java.base of loader 'bootstrap')
13:27:46.151 [ERROR] [tence.internal.PersistenceManagerImpl] - Exception occurred while querying persistence service 'jdbc': class [B cannot be cast to class java.lang.String ([B and java.lang.String are in module java.base of loader 'bootstrap')
O.K. not 100% sure, but I had this too some earlier and searched the forum, if remember right, its a caching problem. So stop OH3, clear cache and restart.
Can it be, that this errors only come at starting OH3?
OH 2.x has for restoring allways rrd4j active. while OH3 rrd4j not the default persistence. So you should have a look on your persistence rules and default database too.
I am a bit cautious with clearing the cache because when removing everything from the cache directory it can also cause more problems … tmp directory should not be the problem but I am not happy deleting everything in the cache directory … but I will consider this …
Yes, it seems so … I have not let run the instance for more than 20 minutes as I am also debugging some problems with rules but it seems so.
If switching between OH 2.5 and 3 during migration I would just ignore those errors, because they dont have a negative effect, just some items dont have a state until refreshed / start fully done
Thank you for this explanation … I found nothing like this in the other topics … I get used to not become scared about warnings but ERRORS are normally better solved … I will stay calm and see if this disappears over time.
But I am wondering that these errors should not occur anymore once all items finally received a status, right?
I will try that but I am running OH in a docker container … not sure if the command exists there as well … I will find out
All fine. Got a lot of support here and glad to give some back!
Happy Easter
Maybe the garbage collection for jdbc is interesting for you too. I rewrote for openhab3, not sure if the same for Maria DB as for mysql: just search for sql maintenance