-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[Persistence] JDBC and MySQL restoreOnStartup throw error for Location items #5761
Comments
Needs a debug log. |
It was in there... just lost formatting pasting from other issue. |
This?
Is not a debug log. |
Ah... debug... 🙄 sorry... The table is never created for the LocationItem (and I've given it a value). This is after an OH restart.
|
Ok, after poking at the code a bit, I have another question. How are you setting the state of the LocationItem initially? It appears to me this should fail whether persistence is running or not... |
I think I did it yesterday through Jython, so something like this (different location through)...
But I just did it through Rules DSL with...
Checked that it went through with...
|
So this:
Indicates there's no data stored for the item in question. Do you have the logs for the time that the item was created? |
I have the same problem JDBC does not store LOCATION Items. |
I think when I made my initial report, I had previously created a StringItem to store the location, and then had changed it to a LocationItem. This would explain how the table was originally created, and the error at startup. Recently, I created a new LocationItem, and the table was never created. Here are fresh logs after creating a new LocationItem...
And after it receives an update, there is nothing in a persistence debug log, as if it is not being tracked.
@9037568 , is there anything more that could help you? |
See the last note in
https://community.openhab.org/t/persistence-not-working-for-gps-location-formatted-xx-xxx75788937955-x-xxxx170208076405/37883/27
…On Mon, Feb 4, 2019 at 12:12 PM Scott Rushworth ***@***.***> wrote:
I think when I made my initial report, I had previously created a
StringItem to store the location, and then had changed it to a
LocationItem. This would explain how the table was originally created, and
the error at startup. Recently, I created a new LocationItem, and the table
was never created.
Here are fresh logs after creating a new LocationItem...
2019-02-04 11:56:46.459 [DEBUG] [org.openhab.persistence.jdbc.internal.JdbcPersistenceService] - JDBC::query: item is Test_Location_1
2019-02-04 11:56:46.459 [WARN ] [org.openhab.persistence.jdbc.internal.JdbcPersistenceService] - JDBC::query: unable to find table for query, no data in database for item 'Test_Location_1'. Current number of tables in the database: 3594
2019-02-04 11:56:46.460 [WARN ] [org.openhab.persistence.jdbc.internal.JdbcPersistenceService] - JDBC::query: no way to generate the table for item 'Test_Location_1'
2019-02-04 11:56:46.469 [INFO ] [smarthome.event.ItemAddedEvent] - Item 'Test_Location_1' has been added.
And after it receives an update, there is nothing in a persistence debug
log, as if it is not being tracked.
2019-02-04 12:03:22.528 [INFO ] [smarthome.event.ItemCommandEvent] - Item 'Test_Location_1' received command 41.555,-81.555
2019-02-04 12:03:22.529 [INFO ] [smarthome.event.ItemStateEvent] - Test_Location_1 updated to 41.555,-81.555
2019-02-04 12:03:22.530 [INFO ] [smarthome.event.ItemStateChangedEvent] - Test_Location_1 changed from NULL to 41.555,-81.555
@9037568 </~https://github.com/9037568> , is there anything more that could
help you?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5761 (comment)>,
or mute the thread
</~https://github.com/notifications/unsubscribe-auth/AJdQOX-8ObhzQSLt0Wr9botYAdIX-cJEks5vKGoAgaJpZM4Z4TW1>
.
|
Since there's a compat1x LocationItem, shouldn't it work with 1.x persistence? Although, persistence moving to 2.x is coming, so that should surely resolve this. |
The problem is, the compatibility layer to openHAB 2 can't do anything with the itemRegistry returns null for Location Items: I will port the binding to openHAB 2 once it is generally clear how persistence bindings can be implemented/distributed in openHAB 2. @openhab-5iver, or are there any examples already? |
Closed by openhab/openhab-addons#10501 |
[old issue... moving to correct repo]
This may affect other persistence bindings too, but I have experienced it with both MySQL and JDBC persistence bindings using a MariaDB db.
Forum topic
Expected Behavior
Location type items should restore on startup and not throw an error.
Current Behavior
Possible Solution
Location items are stored as VARCHAR in mysql/mariadb. I have not yet tested changing the datatype to GEOMETRY.
Steps to Reproduce (for Bugs)
Your Environment
The text was updated successfully, but these errors were encountered: