Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppImage: sql delivers not loaded #3

Closed
yschutz opened this Issue Jan 11, 2018 · 19 comments

Comments

Projects
None yet
2 participants
@yschutz
Copy link
Owner

commented Jan 11, 2018

Hello,
From the AppImage built with travis:

At run time, the sqlite driver cannot be loaded:

QSqlDatabase: QSQLITE driver not loaded

and no available drivers is found.

In the AppImage these drivers are in usr/plugins/sqldrivers ...

What is going wrong ?

@yschutz

This comment has been minimized.

Copy link
Owner Author

commented Jan 11, 2018

@probonopd could you help me on this issue ?

@yschutz yschutz added the help wanted label Jan 11, 2018

@probonopd

This comment has been minimized.

Copy link
Contributor

commented Jan 11, 2018

Were these drivers deployed automatically by linuxdeployqt or did you copy them in manually? Possibly they are missing (or not finding) dependencies. For debugging, please run with LD_DEBUG=libs ./Your.AppImage and watch out for errors.

@yschutz

This comment has been minimized.

Copy link
Owner Author

commented Jan 11, 2018

The drivers were automatically deployed by linuxdeployqt

@probonopd

This comment has been minimized.

Copy link
Contributor

commented Jan 11, 2018

Thanks for the information. Do you see any errors when you run LD_DEBUG=libs ./Your.AppImage?

@yschutz

This comment has been minimized.

Copy link
Owner Author

commented Jan 11, 2018

apart of a few symbol lookup errors: undefined symbol related with gtk, I did not spot an error message before the "QSQLITE driver not loaded" message

@probonopd

This comment has been minimized.

Copy link
Contributor

commented Jan 11, 2018

The GTK erros are probably caused by the GTK platform theme and unrelated. Please extract the AppImage (using --appimage-extract), then run strace -f ./squashfs-root/AppDir 2>&1 | grep -i sql, try to use some database functionality while watching for errors. Thanks.

@yschutz

This comment has been minimized.

Copy link
Owner Author

commented Jan 12, 2018

Thanks for your assistance... This is all what I get :

strace -f ./squashfs-root/AppRun 2&1 |strace -f ./squashfs-root/AppRun 2>&1 | grep -i sql
open("/home/schutz/Downloads/squashfs-root/usr/bin/../lib/libQt5Sql.so.5", O_RDONLY|O_CLOEXEC) = 3
write(2, "QSqlDatabase: QSQLITE driver not"..., 40QSqlDatabase: QSQLITE driver not loaded
write(2, "QSqlDatabase: available drivers:"..., 34QSqlDatabase: available drivers:
write(2, "QSqlDatabase: an instance of QCo"..., 85QSqlDatabase: an instance of QCoreApplication is required for loading driver plugins

@probonopd

This comment has been minimized.

Copy link
Contributor

commented Jan 13, 2018

Right when it is being launched, it says on the command line:

QSqlDatabase: QSQLITE driver not loaded
QSqlDatabase: available drivers:
QSqlDatabase: an instance of QCoreApplication is required for loading driver plugins

The sqldrivers plugins seem to be there:

me@host:~$ find usr/plugins/sqldrivers/
usr/plugins/sqldrivers/
usr/plugins/sqldrivers/libqsqltds.so
usr/plugins/sqldrivers/libqsqlpsql.so
usr/plugins/sqldrivers/libqsqlodbc.so
usr/plugins/sqldrivers/libqsqlmysql.so
usr/plugins/sqldrivers/libqsqlite.so

libQt5Sql gets loaded:

me@host:~$ strace -f squashfs-root/AppRun 2>&1 | grep -i sql
openat(AT_FDCWD, "/home/me/squashfs-root/usr/bin/../lib/libQt5Sql.so.5", O_RDONLY|O_CLOEXEC) = 3

But for some reason libQt5Sql doesn't seem to load usr/plugins/sqldrivers/libqsqlite.so - at least using strace I can't see any attempt at opening it:

me@host:~$ strace -f squashfs-root/AppRun 2>&1 | grep -i sqldrivers

I don't know yet why that is. Other plugins are being opened, but not the sqldrivers.

@probonopd

This comment has been minimized.

Copy link
Contributor

commented Jan 13, 2018

Actually, according to http://www.qtcentre.org/threads/48838-QSqlDatabase-an-instance-of-QCoreApplication-is-required-for-loading-driver-plugins! it gets fixed with

#include <QtCore/QCoreApplication>
QCoreApplication a(argc, argv);
@yschutz

This comment has been minimized.

Copy link
Owner Author

commented Jan 13, 2018

Thanks. I did see this one as well. However QCoreApplication does not allow to create a QWidget (The QCoreApplication class provides an event loop for Qt applications without UI)
So this cannot be the solution.

@probonopd

This comment has been minimized.

Copy link
Contributor

commented Jan 13, 2018

Does it work for you before you run linuxdeployqt?

@yschutz

This comment has been minimized.

Copy link
Owner Author

commented Jan 13, 2018

Yes. I am developing on Mac. It works and the app created with macdeployqt works as well.

@probonopd

This comment has been minimized.

Copy link
Contributor

commented Jan 13, 2018

Yes. I am developing on Mac. It works and the app created with macdeployqt works as well.

My question is, have you tested it on Linux without using linuxdeployqt? Then we would know for sure that linuxdeployqt is causing the issue.

@yschutz

This comment has been minimized.

Copy link
Owner Author

commented Jan 13, 2018

Yes, i have installed a Linux VM on my Mac. It works as it should from QtCreator.

@yschutz

This comment has been minimized.

Copy link
Owner Author

commented Jan 18, 2018

@probonopd just wondering if there is a solution to this problem .... thanks

@probonopd

This comment has been minimized.

Copy link
Contributor

commented Jan 18, 2018

Sorry, Ihave not yet found the cause for why this is failing.

@yschutz

This comment has been minimized.

Copy link
Owner Author

commented Jan 29, 2018

Problem solved: it was in my code. Now I add the db as: db = addDataBase("QSQLITE") just before opening db. db is not anymore a data member of my dbhandler class. Not sure what exactly cause the pb

@probonopd

This comment has been minimized.

Copy link
Contributor

commented Jan 29, 2018

Thanks for letting us know. This way others who might be running into the same issue will be able to find the solution here.

@yschutz

This comment has been minimized.

Copy link
Owner Author

commented Jan 29, 2018

@probonopd Thanks for helping on this and sorry for pointing in the wrong direction

@yschutz yschutz closed this Jan 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.