You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Qt applications fail due to xcb plugin mismatch #24256
% nix-shell -p openshot-qt
[nix-shell:~]$ openshot-qt
Loaded modules from current directory: /nix/store/0r6czdfcgfwqgar2sbz5zhrbysrmkn80-openshot-qt-2.1.0/lib/python3.5/site-packages
launch:INFO ------------------------------------------------
launch:INFO OpenShot (version 2.1.0)
launch:INFO ------------------------------------------------
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".
Available platform plugins are: minimal, offscreen, xcb.
Reinstalling the application may fix this problem.
Aborted
[nix-shell:~]$
I have the same problem with krita (installed via nix-env):
$ krita
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".
Available platform plugins are: minimal, offscreen, xcb.
Reinstalling the application may fix this problem.
Aborted
Installing it via environment.systemPackages does work.
For now one should remove everything that installs Qt plugins (not input ones, they are good) from their environment to fix this -- usually that's qtbase, qtEnv or other Qt packages.
@ttuegel What would be the implications of that? Isn't the plugin mechanism necessary for certain things (like picking up the open dialog box of the desktop environment, theming etc.)?
Isn't the plugin mechanism necessary for certain things (like picking up the open dialog box of the desktop environment, theming etc.)?
Right now, I have patched our Qt libraries to go spelunking through NIX_PROFILES in addition to QT_PLUGIN_PATH. I'm not going to remove plugin support, I'm just going to stop going through NIX_PROFILES looking for every possible plugin. 😃 All the desktop integration and theming plugins are currently provided by Qt or KDE anyway, but QT_PLUGIN_PATH will still work should it be necessary.
FWIW if anyone wants a quick and ugly hack to just get an application (in my case kolourpaint) to hopefully start without having to remove or reinstall a bunch of packages:
$ ls /nix/store/*qtbase*/lib/qt5/plugins/platforms/libqxcb.so
/nix/store/0igx2hwicb18di1mx65qh3jrpypvc40a-qtbase-5.6.1-1/lib/qt5/plugins/platforms/libqxcb.so
/nix/store/9kmi6a4pba9g45wr4c1ny5kasc70jbx9-qtbase-5.6.2/lib/qt5/plugins/platforms/libqxcb.so
/nix/store/3qz77v287y42s3a9l1745551idfcdflr-qtbase-5.8.0/lib/qt5/plugins/platforms/libqxcb.so
/nix/store/f2680a9j60qi724k7dgphxamlqsq933x-qtbase-5.6.1-1/lib/qt5/plugins/platforms/libqxcb.so
(choose the one that seems appropriate, or just trial and error)
...hm. I'm not 100% sure if this issue is the culprit, but I rebooted and KDE itself failed to start (error message something like "core shell components could not be found, this is a packaging problem, contact your distro"). I did nix-env -e kolourpaint and rebooted again and then it worked.
@ttuegel I still this error when running 17.09-based Qt packages on NixOS 17.03 (e.g. Krita or Tribler). For Tribler, I added this line to the wrapper:
FWIW, I'll add a comment how I fixed this in my case. I ran the failing command with LD_DEBUG=libs some_failing_command and then read from the last few lines what library it failed to find. Then added that to the environment and repeat until the command succeeds. For instance, in my case, adding xlibs.libX11 and xlibs.libXi to the environment solved the issue.
Background: I have FHS user env for Conda and when I launched IPython (ipython --pylabs) installed by Conda, I got the error: This application failed to start because it could not find or load the Qt platform plugin "xcb" in "". So I just needed to add all relevant libraries to this FHS user env. This is probably very different scenario than the OP (or others) had, but just thought I'd share this here in case someone has a similar issue as I did and looks for help here.
Hey I was just struggling with this for a few hours trying to run VirtualBox.
This has some obvious flaws that will not make this a great solution for everybody; but if you're in a bind you can give this a shot.
My fix was :
# In `configuration.nix`{config,lib,pkgs,options, ... }:
{virtualisation.virtualbox.host.enable=true;environment.pathsToLink=["${pkgs.xorg.libxcb}/lib/"];}
My previous workaround of exporting QT_QPA_PLATFORM_PLUGIN_PATH in my shell caused my (fedora system installed) vlc to segfault on startup. So I'd definitely vote for qt apps to be self-contained rather than integrating with the desktop, if this is the outcome.
Same here, experiencing this since upgrading to 20.09.
In my case, electrum is installed system wide.
→ electrum ~
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
[1] 6077 abort (core dumped) electrum
Perhaps try upgrading everything you have imperatively installed via nix-env? You may have an old ver in your ~/.nix-profile and a new ver on the system.
I have not found my desired solution in this thread, but in that other one. So I'd like to link it to here, in case anyone else is stumbling upon this.
I suggest to add the following line to the nix-shell file (in my case to a default.nix): QT_QPA_PLATFORM_PLUGIN_PATH="${qt5.qtbase.bin}/lib/qt-${qt5.qtbase.version}/plugins";
Activity
lheckemann commentedon Mar 23, 2017
Works fine when installed using
nix-env -iA nixos.openshot-qt, but both should be possible, right?AndersonTorres commentedon Mar 24, 2017
Incidentally there is a new version of openshot: #22710
(edited a typo, many thanks @lheckemann !)
lheckemann commentedon Mar 24, 2017
Wrong issue number? I guess you meant #22710
edolstra commentedon Apr 3, 2017
I have the same problem with krita (installed via
nix-env):Installing it via
environment.systemPackagesdoes work.straceshows the following:So it's opening two mismatching versions of libqxcb.so, where one is probably discovered via
/run/current-system/sw/lib/qt5/plugins/platforms.[-]openshot-qt does not start in nix-shell[/-][+]Qt applications fail due to xcb plugin mismatch[/+]abbradar commentedon Apr 4, 2017
Related discussion: #24133
For now one should remove everything that installs Qt plugins (not input ones, they are good) from their environment to fix this -- usually that's
qtbase,qtEnvor other Qt packages.cc @ttuegel
ttuegel commentedon Apr 8, 2017
I am working on making Qt packages entirely insensitive to their environment.
edolstra commentedon Apr 10, 2017
@ttuegel What would be the implications of that? Isn't the plugin mechanism necessary for certain things (like picking up the open dialog box of the desktop environment, theming etc.)?
ttuegel commentedon Apr 10, 2017
Right now, I have patched our Qt libraries to go spelunking through
NIX_PROFILESin addition toQT_PLUGIN_PATH. I'm not going to remove plugin support, I'm just going to stop going throughNIX_PROFILESlooking for every possible plugin. 😃 All the desktop integration and theming plugins are currently provided by Qt or KDE anyway, butQT_PLUGIN_PATHwill still work should it be necessary.glaebhoerl commentedon May 5, 2017
FWIW if anyone wants a quick and ugly hack to just get an application (in my case
kolourpaint) to hopefully start without having to remove or reinstall a bunch of packages:(choose the one that seems appropriate, or just trial and error)
(May or may not fail for applications with more complicated dependencies than
kolourpaint, did not try.)glaebhoerl commentedon May 6, 2017
...hm. I'm not 100% sure if this issue is the culprit, but I rebooted and KDE itself failed to start (error message something like "core shell components could not be found, this is a packaging problem, contact your distro"). I did
nix-env -e kolourpaintand rebooted again and then it worked.ttuegel commentedon May 10, 2017
This is fixed in
master: Qt applications know about the QPA plugins they are built with.CMCDragonkai commentedon Jul 31, 2017
@ttuegel I think I'm getting this error at #27790 is there quick fix for people still on 17.03? @glaebhoerl 's trick did not work for me.
edolstra commentedon Sep 10, 2017
@ttuegel I still this error when running 17.09-based Qt packages on NixOS 17.03 (e.g. Krita or Tribler). For Tribler, I added this line to the wrapper:
which fixes it. Is that the recommended solution?
6 remaining items
jirkadanek commentedon Mar 16, 2018
What helped me was either to 1) declare the application in
/etc/nixos/configuration.nix2) runnix-env -u --leq, the doc says for this parameterjluttine commentedon May 9, 2018
FWIW, I'll add a comment how I fixed this in my case. I ran the failing command with
LD_DEBUG=libs some_failing_commandand then read from the last few lines what library it failed to find. Then added that to the environment and repeat until the command succeeds. For instance, in my case, addingxlibs.libX11andxlibs.libXito the environment solved the issue.Background: I have FHS user env for Conda and when I launched IPython (
ipython --pylabs) installed by Conda, I got the error:This application failed to start because it could not find or load the Qt platform plugin "xcb" in "".So I just needed to add all relevant libraries to this FHS user env. This is probably very different scenario than the OP (or others) had, but just thought I'd share this here in case someone has a similar issue as I did and looks for help here.electron-cash: fix NixOS#24256
alex-ameen commentedon Aug 1, 2019
Hey I was just struggling with this for a few hours trying to run VirtualBox.
This has some obvious flaws that will not make this a great solution for everybody; but if you're in a bind you can give this a shot.
My fix was :
timbertson commentedon Nov 30, 2019
My previous workaround of exporting QT_QPA_PLATFORM_PLUGIN_PATH in my shell caused my (fedora system installed)
vlcto segfault on startup. So I'd definitely vote for qt apps to be self-contained rather than integrating with the desktop, if this is the outcome.kdbg: Add QT pluging path wrapper.
jmercouris commentedon Oct 28, 2020
I just upgraded to 20.09 and am running into this issue with my KDE applications. How to fix?
fadenb commentedon Nov 11, 2020
Same here, experiencing this since upgrading to 20.09.
In my case,
electrumis installed system wide.bhipple commentedon Nov 15, 2020
Perhaps try upgrading everything you have imperatively installed via
nix-env? You may have an old ver in your ~/.nix-profile and a new ver on the system.jmercouris commentedon Nov 15, 2020
I have installed nothing imperatively.
Luz commentedon Sep 18, 2023
I have not found my desired solution in this thread, but in that other one. So I'd like to link it to here, in case anyone else is stumbling upon this.
I suggest to add the following line to the nix-shell file (in my case to a
default.nix):QT_QPA_PLATFORM_PLUGIN_PATH="${qt5.qtbase.bin}/lib/qt-${qt5.qtbase.version}/plugins";