xTuple.com xTupleU Blog & News Customer Support

Error with 4.9.5 on debian - Database Drivers not installed

Recieving the following error:

Warning: QSqlDatabase: QPSQL7 driver not loaded
Warning: QSqlDatabase: available drivers: QSQLITE

On 64 bit Debian Stretch

From the GUI, I get this error.

After downloading and extracting the following and running “./xtuple” from the extracted folder.
https://github.com/xtuple/qt-client/releases/download/v4.9.5/xTuple-4.9.5-gc936d99-Linux64.tar.bz2

I’ve successfully installed version 10.0.0 from the repositories and it boots and connects with no problem other than complaining about the database version mismatch.

This is on a Chromebook running Dev channel and the Debian Linux container from Google. 4.10.0 runs like a champ and any errors seem to be from the db mismatch.

I saw this discussion here below, but it never seems to answer the reason for the error; just suggests upgrading in the end. Xtuple 4.9.5 missing libraries

Would love to get 4.9.5 running from this machine. Any pointers?

Dustin,

The basic problem in all of these cases is that one or more shared libraries are missing. Upgrading sometimes fixes this because the new version has the right libraries and sometimes because the new version links to the libraries you’ve already got. Version numbers embedded in the shared library names are important.

You need to update the container so it has all of the required libraries. The most definitive method I know of to find which libraries are missing is with the command-line tool ldd:

# Open a terminal window
1$ cd /wherever/you/have/placed/xtuple
2$ export LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH"
3$ ldd xtuple.bin | grep found
  1. make sure you are in the same directory as the xtuple application and support files
  2. tell ldd and other programs to look in this directory when searching for shared libraries (this will only apply to this terminal session)
  3. find all of the shared libraries that the xtuple.bin program uses, restricting the output to just those libraries that aren’t found (or those that contain found in their name, which is rare)

Those are the shared libraries that you need to install.

The obvious question: Why doesn’t xTuple just bundle those with the application? The obvious answer is that this would violate the purposes of using shared libraries in the first place. This is such a common problem, though, particularly for folks who use Linux distributions we don’t build on, that we are considering several options to fix this:

  • bundle more shared libraries
  • bundle fewer shared libraries and let the end-user and the operating system sort things out
  • eliminate the version-specific linking
  • use static instead of dynamic linking
  • update the operating system on our build machines more often

Each of these has its own costs and benefits, which is why we haven’t settled on any one solution yet.

GIl

As well as what Gil has provided, a quick fix for me has always been to just delete the libpq*.* we provide. Just make sure you have the postgresql client libraries installed as you do still need them. I typically add PostgreSQL’s APT repo and install postgresql-client from there. I am currently using our existing 4.9.5 build on Linux after removing libpq.

The only other thing I have run into on modern distributions is the older Qt linking to an outdated version ob libwebp. To get around this I have used the distro’s bundling of Qt and removed the libQt*.so from our archive, keeping just the xTuple libraries and binary.

Neither of these methods are officially supported but a few of us use them in order to connect to databases using the older version of xTuple on modern linux distributions.

Gil, thanks for the detailed explanation! Its great to understand these things more completely.

David, you get the gold star because I ran “rm libpq*.*” and it opens just fine. I presume from Gil’s explanation that the script is getting confused by the fact that those files exist locally, but the OS is linking to its own copies? Or that those libraries in the current folder have some mismatch to the OS version.

If I run the ldd command, I still get some complaints, like this:

$ ldd xtuple.bin | grep found
libQtDesignerComponents.so.4 => not found
libQtHelp.so.4 => not found
libQtWebKit.so.4 => not found
libQtScriptTools.so.4 => not found
libQtScript.so.4 => not found
libQtSql.so.4 => not found
libQtXmlPatterns.so.4 => not found
libQtNetwork.so.4 => not found
libQtDesigner.so.4 => not found
libQtXml.so.4 => not found
libQtGui.so.4 => not found
libQtCore.so.4 => not found

Any point in trying to clean that up? I tried opening the MetaSql designer, and it seems to work just fine. Of course, I’m not saying I tried everything…

Thanks again guys, this is really helpful.