Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Debian 11 Bullseye QSQLITE Driver not loaded

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
aario
Posts: 23
Joined: 2019-04-18 06:26

Debian 11 Bullseye QSQLITE Driver not loaded

#1 Post by aario »

Hi Folks,
I'm developing an application using qt and sqlite. There seems to be a problem with my installation of debian or its packging.
Here is my code:

Code: Select all

    QString dbPath = ":memory:";
    qDebug()  <<  QSqlDatabase::drivers();
    addDatabase("QSQLITE", "QSQLITE");
    setDatabaseName(dbPath);
    if (!isValid()) {
        qFatal("QSQLITE database type is reported invalid by your operating system!\n%s", qPrintable(lastError().text()));
    }

    if (!open())
        qFatal("Failed to open database at '%s'\n%s", qPrintable(dbPath), qPrintable(lastError().text()));
This function in my code:

Code: Select all

QSqlDatabase::isValid()
returns false. Thus the code fails at the beginning.
This one:

Code: Select all

qDebug()  <<  QSqlDatabase::drivers();
prints:

Code: Select all

("QSQLITE", "QMARIADB", "QMYSQL", "QMYSQL3")
This one:

Code: Select all

QSqlDatabase::lastError().text()
returns:

Code: Select all

Driver not loaded Driver not loaded
Running this command:

Code: Select all

ldd /usr/lib/x86_64-linux-gnu/qt5/plugins/sqldrivers/libqsqlite.so
returns:

Code: Select all

        linux-vdso.so.1 (0x00007ffd54bb0000)
        libQt5Sql.so.5 => /lib/x86_64-linux-gnu/libQt5Sql.so.5 (0x00007fc1b7667000)
        libQt5Core.so.5 => /lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007fc1b711c000)
        libsqlite3.so.0 => /lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007fc1b6fd9000)
        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fc1b6e0c000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc1b6c47000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fc1b6c25000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fc1b6c06000)
        libdouble-conversion.so.3 => /lib/x86_64-linux-gnu/libdouble-conversion.so.3 (0x00007fc1b6bef000)
        libicui18n.so.67 => /lib/x86_64-linux-gnu/libicui18n.so.67 (0x00007fc1b68e9000)
        libicuuc.so.67 => /lib/x86_64-linux-gnu/libicuuc.so.67 (0x00007fc1b6700000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fc1b66fa000)
        libpcre2-16.so.0 => /lib/x86_64-linux-gnu/libpcre2-16.so.0 (0x00007fc1b6670000)
        libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x00007fc1b6593000)
        libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fc1b6464000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fc1b6320000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fc1b6306000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fc1b76dd000)
        libicudata.so.67 => /lib/x86_64-linux-gnu/libicudata.so.67 (0x00007fc1b47ed000)
        libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fc1b4778000)
Even running my application with:

Code: Select all

QT_DEBUG_PLUGINS=1
shows:

Code: Select all

loaded library "/usr/lib/x86_64-linux-gnu/qt5/plugins/sqldrivers/libqsqlite.so"
And this command:

Code: Select all

dpkg --get-selections | grep sqlite
returns:

Code: Select all

libqt5sql5-sqlite:amd64                         install
libsqlite3-0:amd64                              install
sqlitebrowser                                   install
here is my os-release:

Code: Select all

PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
I also know that at the beginning of working with this version of debian I tried running akonadi on sqlite but it didn't work and eventually I gave up and used mysql.

I also noted that the application sqlitebrowser is working properly on my system and is using Qt. But ld command shows that this application uses libsqlite3 directly instead of Qt libraries!! So i decided to open a sqlite library directly from my project:

Code: Select all

    sqlite3 *db;
    int rc;
    rc = sqlite3_open("/home/aario/Downloads/poet_assistant.db", &db);

    if( rc ) {
       qFatal("Can't open database: %s\n", sqlite3_errmsg(db));
    } else {
       qInfo("Opened database successfully through sqlite3 library\n");
    }
And this one works! I'm getting to the idea that there's a bug with the qt libraries in bullseye. Any idea is highly appreciated. Thanks in advance.

Post Reply