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]: cannot use a PostgreSQL database source, error message ''Error: Driver not loaded Driver not loaded" #2209

Closed
3 tasks done
natmaka opened this issue Jul 3, 2023 · 10 comments
Assignees

Comments

@natmaka
Copy link

natmaka commented Jul 3, 2023

JASP Version

0.17.2.1 (this report also apply to 0.18.3)

Commit ID

No response

JASP Module

Unrelated

What analysis are you seeing the problem on?

No response

What OS are you seeing the problem on?

Flatpak

Bug Description

(Coming from #2199)

I installed JASP through "flatpak --user ..." on a Debian bookworm (amd64) .

Using the menu Open-Database I try to access to a remote PostgreSQL instance (which otherwise works OK, including when accessed thru psql from the local computer). It fails. On the "preview" zone an error message appears: "Error: Driver not loaded Driver not loaded".

I tried to circumvent the sandboxing in order to let JASP access to Qt libraries (see #2199), to no avail.

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

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

Expected Behaviour

JASP should be able to access to a PostgreSQL instance.

Steps to Reproduce

  1. Menu: Open
  2. Menu: Database
  3. try to access to a remote PostgreSQL instance

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.
@github-actions
Copy link

github-actions bot commented Jul 3, 2023

@natmaka, thanks for taking the time to create this issue. If possible (and applicable), please upload to the issue website (#2209) 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]

@natmaka
Copy link
Author

natmaka commented Jul 4, 2023

I edited my report in order to add the error message. Here is a screenshot: https://postimg.cc/5jNvhXM7

@natmaka natmaka changed the title [Bug]: [Bug]: cannot use a PostgreSQL database source, error message ''Error: Driver not loaded Driver not loaded" Jul 10, 2023
@natmaka
Copy link
Author

natmaka commented Jul 10, 2023

Using JASP 0.17.3 (installed a 0.17.2.1 one week ago by "flatpak --user ...") on a Debian bookworm (amd64)

All potentially pertinent (Qt) Debian packages are installed systemwide, however I understand that the flatpak sandbox cannot access to them (as /usr and such are blacklisted).

I run it by invoking "dbus-run-session -- flatpak --user run org.jaspstats.JASP"

Are all required libraries (Qt: SQl, psql...) bundled in the distributed Flatpak?

@RensDofferhoff
Copy link

All potentially pertinent (Qt) Debian packages are installed systemwide, however I understand that the flatpak sandbox cannot access to them (as /usr and such are blacklisted).

This is correct. We sadly do not ship the database drivers (psql) in the flatpak.
The Qt drivers that are shipped are nothing but wrappers.
We could consider doing it for the next release at the cost of a larger flatpak with more dependencies to manage.
I will discuss it at our next meeting.

@natmaka
Copy link
Author

natmaka commented Jul 12, 2023

Thank you!
It seems to me that a trick may offer a way to avoid including the drivers/libraries files into the flatpak while enabling those who need it to let JASP access to it. In the flatpak can you add a LD_LIBRARY_PATH path pointing to some specific non-blacklisted directory (such as "/mountedlibs"), which will by empty, for the user to download then copy those files in a directory pertaining to the host computer, then use flatpak's "--filesystem" argument to map this directory into "/mountedlibs"?

@natmaka
Copy link
Author

natmaka commented Sep 17, 2023

0.18 doesn't solve the problem, therefore I suppose that shipping the database drivers (psql) in the flatpak wasn't considered sound or isn't possible. Is it a dead end or do you plan to find a way?
Did you consider the trick described just above (LD_LIBRARY_PATH-based)?

Thank you!

@natmaka natmaka closed this as completed Sep 17, 2023
@natmaka natmaka reopened this Sep 17, 2023
@JorisGoosen
Copy link
Contributor

Im not sure how easy it is to use libraries and databases outside the flatpak in the flatpak. Do they have the same ABI and all?

Maybe it would be better to include some drivers?
THey shouldnt be so big right?
Maybe just a basic ODBC, postgres and sqlite or something?

Also yeah we didnt look at it for the last release @natmaka , too much work on data editing

@tomtomme
Copy link
Member

tomtomme commented Feb 12, 2024

@JorisGoosen @RensDofferhoff
Is a fix for this planned for 0.19?

@natmaka
Natmaka posted this update accidentaly in another thread:

It still 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?

@JorisGoosen
Copy link
Contributor

Is a fix for this planned for 0.19?

Im afraid not, I want to look at this but it is rather low prio

@tomtomme
Copy link
Member

tomtomme commented Oct 2, 2024

Closing as duplicate of #2946 now. Lets disuss there.

@tomtomme tomtomme closed this as completed Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants