Not all Data in Persistence

Hi all,

i have a problem and i don’t know what to do. The problem startet whith trying to get rid of some error messages in the MySQL log. So i had to change the connectionparameter for the jdbc persistence.
I changed everything restartet openhab but first there was a permission error in mysql. I fixed that.
I don’t know what happen but at first i thought there where no Data coming to mysql. But later i saw that some things send to mysql while others won’t do that.

In mysql processmonitor i see some established connections from openhab. And i already changed the debuglevel to trace but there are no error messages and i don’t know where to look and what to change. I don’t think that mysql is the Problem because of there are some connections and some things are sending their data but i don’t know what to do.

Maybe i should say that in the same step i changed from 3.2 to 3.3

Does anyone have an idea where to look or what to do to get some errors?

:face_exhaling:

Today i tried to downgrade back to 3.2. After the downgrade was finished no things where shown but all items where there. After upgrading back to 3.3 everything was like before the downgrade.

Is this behaviour after the downgrade as expected?

Might be related

good idea but i can’t find any item or thing starting with a digit. checked the schemantic model and rules also but nothing.

Today i tried to downgrade back to 3.2. After the downgrade was finished no things where shown but all items where there. After upgrading back to 3.3 everything was like before the downgrade.

Is this behaviour after the downgrade as expected?

shouldn’t it be possible to simply downgrade in minor releases?

ok c’mon. there must be a possibility to debug this. Why are there no errormessages if there obviously are some errors?

and another bump

no errors in the logfiles. What am i missing?

:ghost:

You might have to give us a bit more detail.

What version of OH are you currently running?
What OH add-on have you installed, to use with your MySQL?
How did you configure that?
Thread title talks about “not all data”, does that mean some Items are persisted? How do you know? And some aren’t - how do you know that?

At the moment i’m running OH 3.3.0-1 the last release from the repo(JFrog stable/main).
MySQL(mysqld Ver 5.7.39-0ubuntu0.18.04.2) is used with JDBC Persistence MySQL(3.3.0)
configured through configfile(/etc/openhab/services/jdbc.conf)

This is an old installation from 2.X. But all items, things and rules are configured with paperui.

Im running also Grafana where most of the items are configured for visualization(Grafana uses MySQL as datasource). Most of the items doesn’t update anymore but some do.
For example i have 18 temperaturevalues configured but only 6 will update since the issue started.

Did you check if data is persisted with API Explorer or did you simply conclude some items are not persisted because no values are shown on Grafana?

1 Like

nothing of those two. grabbed my mysql cli checked the items lookuptable for the right tablenumber und did a “select * from item0340 order by time desc limit 5;”
but maybe you lead me to something brb need to check that

What makes you think any should be persisted? i.e. how are selecting (xxx.persist file) or are you relying on default strategies?

The persistence services don’t like it if Item types are changed, which mention of temperature Items suggests as a possibility when upgrading. e.g. Number → Number:Temperature

thanks for the affort @rossko57 but the Problem is so simple and stupid that i really missed it and and thought too far …

to answer your question everything should be persistet the strategy(which really aint one :crazy_face: ) is straight forward

mysql.persistence →

Strategies {
 
        everyMinute     : "0 * * * * ?"
        every5Minutes : "0 */5 * * * ?"
        everyHour   : "0 0 * * * ?"
        everyDay    : "0 0 0 * * ?"
        default = everyChange
}

Items {
    * : strategy = everyChange, every5Minutes, restoreOnStartup
}

but @opus gave me an idea what could be the “problem” (and indeed debugginwise it was 50 cm away from the keyboard :stuck_out_tongue: )

mysql> select count(itemname), itemname from items group by itemname having count(itemname) > 1;
+-----------------+-------------------------------------------------------------+
| count(itemname) | itemname                                                    |
+-----------------+-------------------------------------------------------------+
|               2 | AussensensorHuette_AbsHumidity                              |
|               2 | AussensensorHuette_Dewpoint                                 |
|               2 | AussensensorHuette_Humidity

in the whole database there are 82 duplicated lookup items. So does anyone have an idea where this comes from. No item type or anything was change just the connection ip of the Database. And shouldn’t the persistent find all of theire items and not just some?

To summarise, all the data is there but I now have 82 duplicate tables.

beside the problem that the jdbc persistence module added unneeded table and didn’t recognized the correct ones.
why i can’t see the mysql inserts of jdbc persistence in trace loglevel?