I’m trying to get Openhab running again after a corrupted disk. I used the latest openhabian so I now have openhab 4.0.1
Unfortunatelly jdbc persistence with sqlite does not work anymore. I get tons of messages like this:
2023-08-12 09:15:00.418 [INFO ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: Driver is available::Yank setupDataSource
2023-08-12 09:15:00.420 [WARN ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: failed to open connection: Failed to initialize pool: 'void org.sqlite.core.NativeDB._open_utf8(byte[], int)'
2023-08-12 09:15:00.422 [INFO ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: Driver is available::Yank setupDataSource
2023-08-12 09:15:00.423 [WARN ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: failed to open connection: Failed to initialize pool: 'void org.sqlite.core.NativeDB._open_utf8(byte[], int)'
2023-08-12 09:15:00.425 [WARN ] [jdbc.internal.JdbcPersistenceService] - JDBC::store: No connection to database. Cannot persist state '22.9' for item 'Temperatur_Terrasse (Type=NumberItem, State=22.9, Label=Terrasse, Category=temperatur
e, Tags=[Measurement, Temperature], Groups=[Temperaturen, Temp_aussen, Terrasse])'! Will retry connecting to database when error count:0 equals errReconnectThreshold:0
There is no difference if I use the old persistence db file or not.
I tried now three different things:
New install of OH4 with my config backup (initial.zip in /boot)
New install of OH3 with my config backup (initial.zip in /boot)
New install of OH4 with clean config and then installing jdbc sqlite, add mqtt binding and some things/items and add them to persistance (via the new GUI)
In all cases I used the latest openhabian image on a RPI4 and in all cases I get the same error messages.
Can this be related to the Java17 update? Does jdbc sqlite work for anyone with Java 17?
Can I use that with OH3 as well? I would like to get the system running before upgrading as my backup is from a OH3 system.
Meanwhile I found something else in the syslog:
It looks like the libsqlitejdbc.so that is installed in your case is
org/sqlite/native/Linux/aarch64/libsqlitejdbc.so
instead of
org/sqlite/native/Linux/armv7/libsqlitejdbc.so
The OS was upgraded to 64 bit.
The openhabian detection of the architecture may not work correct or may not yet be prepared to detect this case.
I think others also had this oroblem but havent seen that mentuoned anywhere yet.
Are you on 4.0 now, or 3.4? If you are on 4.0 it would be highly appreciated if you could still give the 3.42 update a test run, so we can finally get this update merged. 3.41.2.2 contains an important security fix, but so far I have not been able to find anyone to give it a try (since I’m not running SQLite myself).
I’m on 4.0.3 currently and it is still not working, using apt packages.
root@rpi4:/var/log#openhab-cli info
Version: 4.0.3 (Build)
Oct 10 20:03:24 rpi4 karaf[23783]: Failed to load native library:sqlite-3.40.0.0-17b13633-8517-43a3-a52f-99169db5ab4d-libsqlitejdbc.so. osinfo: Linux/aarch64
I originally mentioned this in July. You might want to add a release note or FAQ for a workaround. Anyone that upgrades a raspberry pi4 is goint to hit the problem if they use sqlite for persistence. More people are likely to upgrade as time goes on.
I think there may also be something similar going on with one of the jni’s for karaf. When I go into the console (after the 64bit upgrade) I get the following warning, which doesn’t seem to affect anything but it does seem related to the 64bit kernel changes…
root@rpi4:/var/log#openhab-cli console
Logging in as openhab
Password:
Failed to load native library:jansi-2.4.0-d4e0b38880065a7e-libjansi.so. osinfo: Linux/arm
java.lang.UnsatisfiedLinkError: /var/lib/openhab/tmp/jansi-2.4.0-d4e0b38880065a7e-libjansi.so: /var/lib/openhab/tmp/jansi-2.4.0-d4e0b38880065a7e-libjansi.so: cannot open shared object file: No such file or directory
_ _ _
In your other thread you wrote that you have the problem with 3.4.4-2 so that one is even witout upgrade to 4.0.
Question: your 3.4.4-2 and 4.0 instance are/were based on 64 bit ?
As far as I understand the problem initially described here was that the OS was upgraded to 64 bit while 32 bit initially was installed. Changing the boot/kernel parameter made sure that the host was booted in 32 bit mode.
In your case as far as I understand you initially installed 64 bit, right ?
Yes the 3.4.4-2 and 4.0.3 were/are on 64bit at the time it stopped working.
I was on 3.4.4-2 as 32bit and everything was fine, and did a general system apt update / upgrade, which (unknown to me at the time) enabled the kernel from 32 bits to 64bits as the linked article says. After that jdbc never worked again because the library was wrong. Subsequent to that I finally got around to updating OH to 4.0.3 so I was just reporting that the issue is the same.
There are possible other libraries as I mentioned, unless that error from karaf is supposed to happen.