SQLCipher not working in linux

08:27:40,294 SEVERE [com.couchbase.lite] (DefaultQuartzScheduler_Worker-6) Database: Cannot load native library
08:27:40,376 SEVERE [com.couchbase.lite] (DefaultQuartzScheduler_Worker-6) Database: Cannot load native library
08:27:40,379 ERROR [stderr] (DefaultQuartzScheduler_Worker-6) Exception in thread “DefaultQuartzScheduler_Worker-6” java.lang.UnsatisfiedLinkError: com.couchbase.lite.internal.database.sqlite.SQLiteDatabase.nativeSupportEncryption()Z
08:27:40,379 ERROR [stderr] (DefaultQuartzScheduler_Worker-6) at com.couchbase.lite.internal.database.sqlite.SQLiteDatabase.nativeSupportEncryption(Native Method)
08:27:40,379 ERROR [stderr] (DefaultQuartzScheduler_Worker-6) at com.couchbase.lite.internal.database.sqlite.SQLiteDatabase.isSupportEncryption(SQLiteDatabase.java:385)
08:27:40,379 ERROR [stderr] (DefaultQuartzScheduler_Worker-6) at com.couchbase.lite.storage.SQLiteStorageEngineBase.supportEncryption(SQLiteStorageEngineBase.java:228)
08:27:40,379 ERROR [stderr] (DefaultQuartzScheduler_Worker-6) at com.couchbase.lite.store.SQLiteStore.derivePBKDF2SHA256Key(SQLiteStore.java:559)
08:27:40,379 ERROR [stderr] (DefaultQuartzScheduler_Worker-6) at com.couchbase.lite.Database.createSymmetricKey(Database.java:1425)
08:27:40,379 ERROR [stderr] (DefaultQuartzScheduler_Worker-6) at com.couchbase.lite.Database.open(Database.java:1328)
08:27:40,380 ERROR [stderr] (DefaultQuartzScheduler_Worker-6) at com.couchbase.lite.Manager.openDatabase(Manager.java:341)

Couchbase-lite-java-sqlcipher-1.4.4.jar and couchbase-lite-java-sqlite-custom-1.4.4.jar are added to class path of my application which contains .so and .a file.

You will need a version of Couchbase Lite that contains a native library that supports your operating system/ABI. It should support x86 and x86_64 on Linux.

We are using cblite for our java app. So, we are using 1.4.4 jars for cblite.
Is there a way to get more descriptive exceptions so that we can reach a solution. Is there a way to check which version of cblite will work for our linux machine.

I don’t know if anyone at Couchbase still remembers enough about the 1.4 source code to be able to answer this.

I’m guessing you probably need a native SQLCipher shared library installed, i.e. libsqlcipher.so or something like that. Couchbase Lite 1.4 should have come with setup/build instructions; do they address this?

“Linux” is a gigantic umbrella of different things all of which think they know best about how to do things.

If my memory serves it is because some variants will try to identify as “x64” and some will try to identify as “x86_64”. I think our current JAR has the latter, so if the variant of Linux you are using is looking for the former it won’t find it. Some people have had luck repackaging the JAR with the x86_64 folder renamed to x64.

I have verified and in my case it is x86_64. Is there a way to get the location in log to see where code is tryong to search for the file. Also in my jars .so files are present in couchbase-lite-java-sqlite-custom-1.4.4.jar\native\linux\x86_64

What is System.getProperty(“os.name”) and System.getProperty(“os.arch”)?

CBL-Java will try to load the shared library at the location based on OS Name and Arch.

ava.lang.UnsatisfiedLinkError: /tmp/libsqlite3.so: /lib64/libc.so.6: version `GLIBC_2.14’ not found (required by /tmp/libsqlite3.so)

    at java.lang.ClassLoader$NativeLibrary.load(Native Method)

    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)

    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)

    at java.lang.Runtime.load0(Runtime.java:809)

    at java.lang.System.load(System.java:1086)

Our Linus is 2.12.

Name : glibc Relocations: (not relocatable)

Version : 2.12 Vendor: Red Hat, Inc.

Can you please suggest the jar version which is compatible with this version.

In that case we probably don’t have a version that is compatible. The only thing you can do in this case is to try to rebuild the native libraries on RHEL 6. For SQLCipher the repo we use to build the native library is here. We don’t use RHEL for anything, and the only version of CentOS we use is 7.