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

[Bug]: PostgreSQL database: driver not found #2199

Closed
3 tasks
LaRiffle opened this issue Jun 26, 2023 · 14 comments
Closed
3 tasks

[Bug]: PostgreSQL database: driver not found #2199

LaRiffle opened this issue Jun 26, 2023 · 14 comments
Assignees
Labels
Bug Duplicate This issue or pull request already exists OS: macOS Intel Waiting for requester If waiting for a long time it is reasonable to close an issue

Comments

@LaRiffle
Copy link

JASP Version

0.17.2.1

Commit ID

No response

JASP Module

Other

What analysis are you seeing the problem on?

No response

What OS are you seeing the problem on?

macOS Intel

Bug Description

I'm trying to open a PostgresSQL connection but receive a "Driver not found" error

Expected Behaviour

Connection should work

Steps to Reproduce

  1. "Open"
  2. "Database"
  3. Select "Postgres" and any configuration, and click on "Connect to database"
CleanShot 2023-06-26 at 08 54 25@2x CleanShot 2023-06-26 at 08 53 54@2x

Log (if any)

No response

Final Checklist

  • I have included a screenshot showcasing the issue, if possible.
  • I have included a JASP file (zipped) or data file that causes the crash/bug, if applicable.
  • I have accurately described the bug, and steps to reproduce it.
@LaRiffle LaRiffle added the Bug label Jun 26, 2023
@github-actions
Copy link

@LaRiffle, thanks for taking the time to create this issue. If possible (and applicable), please upload to the issue website (#2199) a screenshot showcasing the problem, and/or a compressed (zipped) .jasp file or the data file that causes the issue. If you would prefer not to make your data publicly available, you can send your file(s) directly to us, [email protected]

@LaRiffle LaRiffle changed the title [Bug]: [Bug]: PostgreSQL database: driver not found Jun 26, 2023
@RensDofferhoff RensDofferhoff self-assigned this Jun 26, 2023
@boutinb boutinb assigned JorisGoosen and unassigned Kucharssim Jun 26, 2023
@JorisGoosen
Copy link
Contributor

@LaRiffle did you actually install any drivers for postgressql on your system?

I can run postgressql fine on my macos so Im assuming you are missing some driver from your system.
But you do not describe how or where your database runs and what you installed on your system.

If you can add that information here we might be able to help you figure out what your missing

@LaRiffle
Copy link
Author

Hi,
Actually I can run Postgres locally and here I'm trying to connect to a remote database.
I'm not sure exactly what is missing and what should be installed separately

@LaRiffle
Copy link
Author

Should I install something specific for JASP? Or linking to the Qt SQL engine?

@JorisGoosen
Copy link
Contributor

https://doc.qt.io/qt-6/sql-driver.html

Is how qt describes how to use the databases, our jasp interface basically forwards everything to that.

I just tried installing some official postgres drivers via the "App Stack Builder" but I cant get them to run.

But what postgres did you install?
@RensDofferhoff discovered that connecting to the homebrew version isnt possible without changing something in the binary of JASP. But I think that connecting to the official versions of postgres should work.

The problem is only that how to connect is not exactly well documented for all platforms*dbs
When I get to the office Ill check what I did there, but I suspect I used the ODBC driver, so you could give that a go

@natmaka
Copy link

natmaka commented Jul 2, 2023

Using JASP 0.17.2.1 (installed by "flatpak --user ...") on a Debian bookworm (amd64) with all potentially pertinent Debian packages installed (systemwide) and I encounter the same issue (same error message).

Upon trying the connect to a DB (clicking on the "Connect to database" button) on JASP's stderr I can read:
QSqlDatabase: QPSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE

Packages installed:
libqt5sql5
libqt5sql5-mysql
libqt5sql5-odbc
libqt5sql5-psql
libqt5sql5-sqlite
libqt6sql6
libqt6sql6-mysql
libqt6sql6-odbc
libqt6sql6-psql
odbc-postgresql

I also tried to let the dynamic linking take those QT libs into account:
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/qt6/plugins/sqldrivers/:/usr/lib/x86_64-linux-gnu/qt5/plugins/sqldrivers/

Invoking using flatpak's "--filesystem" argument ("flatpak run --filesystem=/usr org.jaspstats.JASP") doesn't solve the problem, probably because the host's '/usr' is blacklisted in Flatpak's sandbox.
I copied all Qt SQL-related libs into a local directory:
lib
lib/qt5
lib/qt5/libqsqlmysql.so
lib/qt5/libqsqlite.so
lib/qt5/libQt5Sql.so.5
lib/qt5/libqsqlpsql.so
lib/qt5/libqsqlodbc.so
lib/qt6
lib/qt6/libqsqlmysql.so
lib/qt6/libqsqlite.so
lib/qt6/libQt6Sql.so.6
lib/qt6/libqsqlpsql.so
lib/qt6/libqsqlodbc.so

And used 'LD_LIBRARY_PATH=/home/jasp/lib/qt5/:/home/jasp/lib/qt6/', to no avail.

Are all libs required for PostgreSQL access integrated to the Flatpak build?

@JorisGoosen
Copy link
Contributor

@natmaka Flatpak does not use local or system installed libraries at all.
But maybe we can help you out though, but it would require a new issue though as this one is about macos Intel where the issue is quite different

@tomtomme
Copy link
Member

tomtomme commented Feb 8, 2024

@LaRiffle
Could you figure this one out? Does it work with jasp 0.18.3? If so, how?

@tomtomme tomtomme added the Waiting for requester If waiting for a long time it is reasonable to close an issue label Feb 8, 2024
@natmaka
Copy link

natmaka commented Feb 11, 2024

@LaRiffle No, I could not figure this one out, it does not work (here) with JASP 0.18.3.

All related Flatpak dependencies are up-to-date. I also tried after installing psqlodbc

Same error message "Error: Driver not loaded Driver not loaded" (sic).

I'm pretty sure that my connection string is adequate (it works on the command line, using psql).

Were you able to find a way?

@tomtomme
Copy link
Member

@natmaka
I know your issue is not sorted out. Please post updates for that in your own issue. This is the issue of LaRiffle and I asked LaRiffle and not you! Thx!

@natmaka
Copy link

natmaka commented Feb 13, 2024

@tomtomme Sorry, it seems to me that those issues are coupled as (AFAIK) both have the same cause (PG driver not or inadequately integrated), and therefore that any information related to one of them may be useful the other(?) Won't bother you again. Thx.

@tomtomme
Copy link
Member

tomtomme commented Feb 13, 2024

They are a bit different because of the OS. And please do bother us, but in your issue :)
Thx for contributing!
I also apologize, my last comment sounded a bit rude.

@tomtomme
Copy link
Member

@LaRiffle
Please reopen, if you can share answers to the points Joris made above.

@tomtomme
Copy link
Member

tomtomme commented Oct 2, 2024

similar issue now discussed here: #2946

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Duplicate This issue or pull request already exists OS: macOS Intel Waiting for requester If waiting for a long time it is reasonable to close an issue
Projects
None yet
Development

No branches or pull requests

6 participants