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

QtWebEngineProcess error #34

Closed
mytskine opened this issue Oct 20, 2016 · 18 comments
Closed

QtWebEngineProcess error #34

mytskine opened this issue Oct 20, 2016 · 18 comments
Labels

Comments

@mytskine
Copy link

I applied linuxdeployqt to a custom build of otter-browser. The AppImage is sucessfully built, but when I run it on another sytem, it fails with the message "QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled".

I first used linuxdeployqt-1-x86_64.AppImage, then I used the latest linuxdeployqt from git, with the latest AppImageAssistant. In this case, the image failed with the message "Could not find QtWebEngineProcess".
Here are the libraries that are not packaged by the AppImage when I use linuxdeployqt otter-browser -libpath=/home/vagrant/Qt/5.7/gcc_64/lib -verbose=2 -appimage -bundle-non-qt-libs:

% ldd otter-browser | grep -v otter-browser/tmp | sort
    /lib64/ld-linux-x86-64.so.2 (0x000055b44386b000)
    libasound.so.2 => /usr/lib/x86_64-linux-gnu/libasound.so.2 (0x00007f6e545cb000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6e57af3000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f6e56cdb000)
    libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f6e4e4eb000)
    libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f6e4eda3000)
    libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f6e55b33000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f6e57e93000)
    libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f6e5676b000)
    libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007f6e57593000)
    libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f6e56a83000)
    libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f6e4b943000)
    libICE.so.6 => /usr/lib/x86_64-linux-gnu/libICE.so.6 (0x00007f6e4da43000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6e580ab000)
    libnvidia-glcore.so.367.44 => /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.367.44 (0x00007f6e4f64b000)
    libnvidia-tls.so.367.44 => /usr/lib/x86_64-linux-gnu/tls/libnvidia-tls.so.367.44 (0x00007f6e5138b000)
    libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f6e4eb2b000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f6e578d3000)
    libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f6e4c26b000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f6e5713b000)
    libSM.so.6 => /usr/lib/x86_64-linux-gnu/libSM.so.6 (0x00007f6e4d83b000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f6e583b3000)
    libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f6e4c76b000)
    libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f6e5553b000)
    libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f6e4cb7b000)
    libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f6e4e093000)
    libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f6e4c973000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f6e539db000)
    linux-vdso.so.1 (0x00007ffd7d3c5000)

Here are the libraries load from the AppImage:

libasyncns.so.0
libattr.so.1
libcap.so.2
libdbus-1.so.3
libFLAC.so.8
libfreetype.so.6
libgcrypt.so.20
libgthread-2.0.so.0
libhunspell-1.3.so.0
libicudata.so.56
libicui18n.so.56
libicuuc.so.56
libjson-c.so.2
liblzma.so.5
libnsl.so.1
libnspr4.so
libnss3.so
libnssutil3.so
libogg.so.0
libplc4.so
libplds4.so
libpng12.so.0
libpulsecommon-5.0.so
libpulse.so.0
libQt5Core.so.5
libQt5DBus.so.5
libQt5Gui.so.5
libQt5Multimedia.so.5
libQt5Network.so.5
libQt5PrintSupport.so.5
libQt5Qml.so.5
libQt5Quick.so.5
libQt5WebChannel.so.5
libQt5WebEngineCore.so.5
libQt5WebEngineWidgets.so.5
libQt5Widgets.so.5
libQt5XmlPatterns.so.5
libsmime3.so
libsndfile.so.1
libsystemd.so.0
libvorbisenc.so.2
libvorbis.so.0
libwrap.so.0
libX11-xcb.so.1
libXcomposite.so.1
libXcursor.so.1
libXdamage.so.1
libXext.so.6
libXfixes.so.3
libXi.so.6
libxml2.so.2
libXrender.so.1
libxslt.so.1
libXtst.so.6

As a side note, when there is no .desktop file, the command linuxdeployqt silently fails with an apparent success.

Another surprise was that the resulting file was named ..AppImage which is a very uncommon and hidden name. I suspect the intended name was ../AppImage.

@probonopd
Copy link
Owner

probonopd commented Oct 20, 2016

tl;dr: We must implement https://doc-snapshots.qt.io/qt5-5.7/qtwebengine-deploying.html

I think QtWebEngineProcess is a binary that doesn't get bundled by appimagetool yet. Which is a bug. The name of the AppImage is also wrong, it should be the name of the AppDir plus .AppImage.

@probonopd probonopd added the bug label Oct 20, 2016
@probonopd
Copy link
Owner

probonopd commented Oct 20, 2016

Hypothesis (to be verified): When libQt5WebEngineCore.so is going to be deployed, then the 5.7/gcc_64/libexec/QtWebEngineProcess executable (and its dependencies) need to be deployed as well.

@mytskine
Copy link
Author

mytskine commented Oct 21, 2016

Many thanks, your hypothesis was right, unfortunately there are other steps to build a valid image.

  • I copied the directory 5.7/gcc_64/libexec/(which only contains QtWebEngineProcess) into the directory to package.
  • I added -executable=libexec/QtWebEngineProcess to the linuxdeployqt command.
  • The AppImage did not work because of missing i18n libraries, so I added Qt/5.7/gcc_64/lib/libicu* under lib/.
  • Now the AppImage fails because of missing i18n data.
Qt WebEngine ICU data not found at /tmp/.mount_WhePAU/resources. Trying parent directory...
Qt WebEngine ICU data not found at /tmp/.mount_WhePAU. Trying application directory...
Qt WebEngine ICU data not found at /tmp/.mount_WhePAU. Trying fallback directory... The application MAY NOT work.
Installed Qt WebEngine locales directory not found at location /tmp/.mount_WhePAU/translations/qtwebengine_locales. Trying application directory...
Qt WebEngine locales directory not found at location /tmp/.mount_WhePAU/qtwebengine_locales. Trying fallback directory... Translations MAY NOT not be correct.
[1021/093041:ERROR:icu_util.cc(162)] Invalid file descriptor to ICU data received.
[1021/093041:FATAL:content_main_runner.cc(714)] Check failed: base::i18n::InitializeICU(). 
  • I put Qt/5.7/gcc_64/resources/* under the resources/ directory and packaged it again.
  • It still crashes right after it starts, but I don't understand what the problem is with libsoftokn3.so (which is part of the libnss3 package, installed on my target system).
[1021/095423:ERROR:nss_util.cc(740)] Error initializing NSS with a persistent database (sql:/home/username/.pki/nssdb): libsoftokn3.so: cannot open shared object file: No such file or directory
[1021/095423:ERROR:nss_util.cc(211)] Error initializing NSS without a persistent database: NSS error code: -5925
[1021/095423:FATAL:nss_util.cc(213)] nss_error=-5925, os_error=0

I can't even find which executable/library requests this: I applied ldd $(find . -name "*.so" -or -type f -and -executable) | grep softokn3 without any match.

@probonopd
Copy link
Owner

Please do grep -r softokn3 . inside the AppDir - does it print anything?

@mytskine
Copy link
Author

lib/libnss3.so was the culprit!

Anyway, this doesn't solve much, because the same fatal error occurs even if I package libsoftokn3.so.

[1021/185717:ERROR:nss_util.cc(740)] Error initializing NSS with a persistent database (sql:/home/username/.pki/nssdb): NSS error code: -8023
[1021/185717:ERROR:nss_util.cc(211)] Error initializing NSS without a persistent database: NSS error code: -8023
[1021/185717:FATAL:nss_util.cc(213)] nss_error=-8023, os_error=0

The directory ~/.pki/nssdb does exist and has rx access. I don't intend to debug NSS, so I'll drop this attempt, unless you have some suggestions? Thanks anyway.

@probonopd
Copy link
Owner

What happens if you delete lib/libnss3.so from the AppDir?

@probonopd probonopd reopened this Oct 21, 2016
@mytskine
Copy link
Author

  • After removing libnss3.so:
./otter-browser-x86_64.AppImage: /tmp/.mount_UK1OeX/lib/libnssutil3.so: version `NSSUTIL_3.21' not found (required by /usr/lib/x86_64-linux-gnu/libnss3.so)
  • After also removing libnssutil3.so:
./otter-browser-x86_64.AppImage: symbol lookup error: /usr/lib/x86_64-linux-gnu/libnss3.so: undefined symbol: PR_GetEnvSecure
  • After also removing libsoftokn3.so:
[1021/193936:ERROR:nss_util.cc(740)] Error initializing NSS with a persistent database (sql:/home/username/.pki/nssdb): libsoftokn3.so: cannot open shared object file: No such file or directory
[1021/193936:ERROR:nss_util.cc(211)] Error initializing NSS without a persistent database: NSS error code: -5925

@probonopd
Copy link
Owner

probonopd commented Oct 22, 2016

I would assume NSS is pretty low level software that should be part of any target system and hence not bundled inside the AppImage; I might be wrong though. We need to figure out the entire dependency graph and decide what to bundle and what not to bundle. Does my Otter AppImage at https://bintray.com/probono/AppImages/Otter#files suffer from the same issues? It was not built using linuxdeployqt, so maybe it can help us figure out what should and should not be bundled by linuxdeployqt.

@mytskine
Copy link
Author

Your image is compiled against Qt5WebKit, while mine uses QtWebEngine which is the preferred way to build Otter beta11. That shows your executable was compiled against an old release of Qt, since libQt5WebKit.so is not part of the last release (Qt 5.7). So the chromium engine in your AppImage is a bit old. That's one of the reasons why I wanted to rebuild this package. IIRC, that's also why there is no Ubuntu package of the latest Otter release (Qt 5.7 and QtWebEngine are not packaged by Debian/Ubuntu).

Anyway, your AppImage fails to start on my Debian testing amd64:

zenity, kdialog, Xdialog missing. Skipping ./bin//otter-browser.wrapper.
/tmp/.mount_E6YnI7/usr/bin/otter-browser: ../lib/x86_64-linux-gnu/libgpg-error.so.0: no version information available (required by /lib/x86_64-linux-gnu/libgcrypt.so.20)
/tmp/.mount_E6YnI7/usr/bin/otter-browser: relocation error: /lib/x86_64-linux-gnu/libgcrypt.so.20: symbol gpgrt_lock_lock, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference

@probonopd
Copy link
Owner

Yes, I my AppImage merely repackages the deb from the ppa. Already found out that bundling libgpg-error.so.0 does more harm than good. Anyway, need to solve the real issue of this ticket ;)

@probonopd probonopd changed the title linuxdeploys builds AppImage that fails with QtWebEngineProcess error linuxdeployqt builds AppImage that fails with QtWebEngineProcess error Oct 22, 2016
@probonopd
Copy link
Owner

probonopd commented Oct 22, 2016

I can produce a working Otter AppDir using linuxdeployqt, however it involves manual copying of files linuxdeployqt should deploy automatically:

export PATH=/tmp/.mount_QtCreator-5.7.0-x86_64/5.7/gcc_64/bin/:$PATH
qmake -v # Check that the correct Qt path is shown

# This *SHOULD* be done automatically by linuxdeployqt, I need to figure out how
cp -r /tmp/.mount_QtCreator-5.7.0-x86_64/5.7/gcc_64/libexec $HOME/build-otter-browser-Desktop_Qt_5_7_0_GCC_64bit-Default/
mkdir -p $HOME/build-otter-browser-Desktop_Qt_5_7_0_GCC_64bit-Default/resources
cp -r /tmp/.mount_QtCreator-5.7.0-x86_64/5.7/gcc_64/translations/qtwebengine_locales $HOME/build-otter-browser-Desktop_Qt_5_7_0_GCC_64bit-Default/resources
cp /tmp/.mount_QtCreator-5.7.0-x86_64/5.7/gcc_64/resources/icudtl.dat $HOME/build-otter-browser-Desktop_Qt_5_7_0_GCC_64bit-Default/resources/

# Rerun linuxdeployqt from git
./linuxdeployqt/linuxdeployqt/linuxdeployqt ./build-otter-browser-Desktop_Qt_5_7_0_GCC_64bit-Default/otter-browser -verbose=3

# Runs!

However, when I use the -appimage switch, the AppImage fails with [1022/144633:ERROR:nss_util.cc(740)] Error initializing NSS with a persistent database (sql:/home/me/.pki/nssdb): libsoftokn3.so: cannot open shared object file: No such file or directory which is a separate issue.

@probonopd probonopd changed the title linuxdeployqt builds AppImage that fails with QtWebEngineProcess error QtWebEngineProcess error Oct 22, 2016
@probonopd
Copy link
Owner

Possibly fixed in 3415b30, please confirm

@mytskine
Copy link
Author

Sorry for the delay. I just used the new version of linuxdeployqt, and the result was the same as described in the comment #34 (comment). This isn't surprising, since the the new linuxdeployqt copies the same files that I did manually. Now I'll have to wait for a fix of #35. Many thanks for your help.

@probonopd
Copy link
Owner

@mytskine can you advise me what to do?

@nighttothegoal
Copy link

nighttothegoal commented Apr 21, 2017

amit@amit-VB:$ qmake
qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory
amit@amit-VB:
$ export PATH=/home/amit/Qt5.7.0/5.7/gcc_64/bin/:$PATH
amit@amit-VB:$ qmake -v
QMake version 3.0
Using Qt version 5.7.0 in /home/amit/Qt5.7.0/5.7/gcc_64/lib
amit@amit-VB:
$ chmod a+x /home/amit/Downloads/linuxdeployqt-continuous-x86_64.AppImage
amit@amit-VB:~$ /home/amit/Downloads/linuxdeployqt-continuous-x86_64.AppImage /home/amit/build-qt_quick-Desktop_Qt_5_7_0_GCC_64bit-Debug/qt_quick
Not using FHS-like mode
app-binary: "/home/amit/build-qt_quick-Desktop_Qt_5_7_0_GCC_64bit-Debug/qt_quick"
appDirPath: "/home/amit/build-qt_quick-Desktop_Qt_5_7_0_GCC_64bit-Debug"
relativeBinPath: "qt_quick"
ERROR: ldd outputLine: "libQt5WebEngine.so.5 => not found"
ERROR: Please ensure that all libraries can be found by ldd. Aborting.

Can anyone help me out?
Thanks.

@probonopd
Copy link
Owner

Where on your build system is libQt5WebEngine.so.5 located?

@qht1003077897
Copy link

[5397:5445:0410/103351.599157:ERROR:nss_util.cc(674)] Error initializing NSS with a persistent database (sql:/home/zhl/.pki/nssdb): libsoftokn3.so: 无法打开共享对象文件: 没有那个文件或目录
[5397:5445:0410/103351.601874:ERROR:nss_util.cc(154)] Error initializing NSS without a persistent database: NSS error code: -5925
[5397:5445:0410/103351.603075:FATAL:nss_util.cc(156)] nss_error=-5925, os_error=0

I wonder if this problem has been solved?

@L-Super
Copy link

L-Super commented Sep 25, 2023

[5397:5445:0410/103351.599157:ERROR:nss_util.cc(674)] Error initializing NSS with a persistent database (sql:/home/zhl/.pki/nssdb): libsoftokn3.so: 无法打开共享对象文件: 没有那个文件或目录 [5397:5445:0410/103351.601874:ERROR:nss_util.cc(154)] Error initializing NSS without a persistent database: NSS error code: -5925 [5397:5445:0410/103351.603075:FATAL:nss_util.cc(156)] nss_error=-5925, os_error=0

I wonder if this problem has been solved?

Me too.Did you solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants