Skip to content

Mixing incompatible Qt library (version 0x50902) with this library (version 0x50901) #30551

Closed

Description

@yrashk

Issue description

In certain (mixed 17.09/unstable) setups, when both qt-5.9.2 and qt-5.9.1 are present, tools like VirtualBox or wpa_gui can't start and fail with this error:

Qt FATAL: Cannot mix incompatible Qt library (version 0x50902) with this library (version 0x50901)

This might be related to the fact that the recent update to 5.9.2 that still keeps qtwebkit at 5.9.1 (since qtwebkit-5.9.2 is not available):

https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/qt-5/5.9/srcs.nix#L285-L300

Steps to reproduce

On 17.09, install dropbox from the unstable channel. wpa_gui and VirtualBox from stable will exhibit the error.

Technical details

  • System: 17.09.1756.c99239bca0 (Hummingbird)
  • Nix version: nix-env (Nix) 1.11.15
  • Nixpkgs version: "17.09.1756.c99239bca0"
  • Sandboxing enabled: false

cc/ht @woffs

Activity

  1. timokau commented on Oct 18, 2017

    @timokau
    Member

    As I said in #30255, I experience the same problem with qutebrowser.

    But, if I install the exact same qutebrowser package in my user environment instead of the global one, it works:

    # ls -lah $(which qutebrowser)                                                                                                                                              ~
    Permissions Size User Date Modified Name
    lrwxrwxrwx    77 root 31 Dec  1969  /run/current-system/sw/bin/qutebrowser -> /nix/store/87dk7zl5cam1rz0j1912188vf9drmadi-qutebrowser-1.0.2/bin/qutebrowser
    # qutebrowser                                                                                                                                                               ~
    16:40:24 CRITICAL: Cannot mix incompatible Qt library (version 0x50901) with this library (version 0x50902)
    Fatal Python error: Aborted
    
    Current thread 0x00007f2ca7b63580 (most recent call first):
      File "/nix/store/87dk7zl5cam1rz0j1912188vf9drmadi-qutebrowser-1.0.2/lib/python3.6/site-packages/qutebrowser/misc/sql.py", line 95 in init
      File "/nix/store/87dk7zl5cam1rz0j1912188vf9drmadi-qutebrowser-1.0.2/lib/python3.6/site-packages/qutebrowser/app.py", line 444 in _init_modules
      File "/nix/store/87dk7zl5cam1rz0j1912188vf9drmadi-qutebrowser-1.0.2/lib/python3.6/site-packages/qutebrowser/app.py", line 163 in init
      File "/nix/store/87dk7zl5cam1rz0j1912188vf9drmadi-qutebrowser-1.0.2/lib/python3.6/site-packages/qutebrowser/app.py", line 137 in run
      File "/nix/store/87dk7zl5cam1rz0j1912188vf9drmadi-qutebrowser-1.0.2/lib/python3.6/site-packages/qutebrowser/qutebrowser.py", line 186 in main
      File "/nix/store/87dk7zl5cam1rz0j1912188vf9drmadi-qutebrowser-1.0.2/bin/..qutebrowser-wrapped-wrapped", line 12 in <module>
    [1]    1627 abort      qutebrowser
    
    # nix-env -f /home/timo/nixpkgs -i qutebrowser                                                                                                                        (134) ~
    installing ‘qutebrowser-1.0.2’
    
    # ls -lah $(which qutebrowser)                                                                                                                                              ~
    Permissions Size User Date Modified Name
    lrwxrwxrwx    77 root 31 Dec  1969  /run/current-system/sw/bin/qutebrowser -> /nix/store/87dk7zl5cam1rz0j1912188vf9drmadi-qutebrowser-1.0.2/bin/qutebrowser
    
    # qutebrowser --version                                                                                                                                                     ~
    qutebrowser v1.0.2
    

    Regarding @ttuegel's remark about the user environment: I don't have anything installed in my user environment (and why could that even be the problem? Shouldn't the dependencies be independent of the environment?).

  2. mickours commented on Oct 19, 2017

    @mickours
    Contributor

    FYI there is a thread on Archlinux forum on this issue:
    https://bbs.archlinux.org/viewtopic.php?id=227943

    It seems that @yrashk is right about the root cause of the problem: the mix of two Qt version.

  3. ttuegel commented on Oct 19, 2017

    @ttuegel
    Member

    the mix of two Qt version.

    Yes, you cannot have anything installed with Qt 5.9.1 and Qt 5.9.2 at the same time. This is mainly a NixOS problem, which I will explain in a moment.

    However: QtWebkit is not part of Qt anymore, so the QtWebkit version has nothing whatsoever to do with the Qt version. Our QtWebkit 5.9.1 is built with Qt 5.9.2. As @Eisfreak7 found by installing qutebrowser into a user profile, the problem is not QtWebkit 5.9.1, but something else in your system is pulling in Qt 5.9.1.

    Shouldn't the dependencies be independent of the environment?

    No, not for Qt programs. Qt loads plugins at runtime for most features. We let it search your environment for plugins so that you can do things like use themes and run Qt applications outside KDE. Unfortunately, Qt freaks out if it even sees an old plugin, so if you have anything old hanging around it will cause problems. This problem can be circumvented by installing something in the user profile because that profile will be searched first (so if Qt finds the plugin it needs in the user environment, it never runs into the bad plugin in the global environment).

    I don't have anything installed in my user environment

    @Eisfreak7
    That is very surprising. Could you please post a log of strace qutebrowser for the failing package?

  4. added
    6.topic: qt/kde
    on Oct 19, 2017
  5. mickours commented on Oct 19, 2017

    @mickours
    Contributor

    I tried to nix-env -u but I still had the problem. But, thanks to strace, I find out where the problem comes from and fixed it, at least in my case... (thxs @ttuegel 👍 )

    First I ran sudo strace VirtualBox and I found this in the trace:

    open("/home/mmercier/.nix-profile/lib/qt-5.9/plugins/xcbglintegrations", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 10
    open("/nix/store/pn43bh64fnvdclj4j8gaxq2xxywcwarp-qtbase-5.9.1-bin/lib/qt-5.9/plugins/xcbglintegrations/libqxcb-egl-integration.so", O_RDONLY|O_CLOEXEC) = 10
    

    So it looks like my current profile links to the old Qt plugins as expected.
    Then I used the nix-store superpowers to see the reverse dependencies of it:

    nix-store --query --referrers /nix/store/nwvydrhhmfvf5g8ybh135rgpl9xyzvvb-qtbase-5.9.1 
    /nix/store/pn43bh64fnvdclj4j8gaxq2xxywcwarp-qtbase-5.9.1-bin
    /nix/store/nwvydrhhmfvf5g8ybh135rgpl9xyzvvb-qtbase-5.9.1
    /nix/store/5rflm7chjb5ddpg11v12d747ij47w7w8-qtsvg-5.9.1
    /nix/store/pn43bh64fnvdclj4j8gaxq2xxywcwarp-qtbase-5.9.1-bin
    /nix/store/028968dblhg78d6khsp8whs9iv7av4vy-qtsvg-5.9.1-bin
    /nix/store/0qzr6cd8ivi7mjfh4v1yyjsva42wmgrd-qtdeclarative-5.9.1
    /nix/store/h1ig4qqy65sfrcs7b3v3c0b83n4pkm39-qtwebchannel-5.9.1
    /nix/store/zfhjbc6h88fqi4hzbx4fbhrhjhwam878-qtxmlpatterns-5.9.1
    /nix/store/qk7fzd4pw5bvynm527rjqvv012h1qcx7-qtdeclarative-5.9.1-bin
    /nix/store/2hj9rzcpv113cywydvsfq9ysx6vjkqiv-qtwebchannel-5.9.1-bin
    /nix/store/7m1q6kvs45bpviq5ns5qka80a8pj8ggi-qtlocation-5.9.1
    /nix/store/3nc44b8zi0nkg6k2yl7dv8vlmdqz5as7-qtwebengine-5.9.1
    /nix/store/6aard33vnrycv9fqnj5kxyqyacx8azff-qtx11extras-5.9.1
    /nix/store/vira350bp6kklpw0phxfs6s4402jgcf7-qtsensors-5.9.1
    /nix/store/88kvlc9vkfqb1cw23jpkwak87jmmgnlb-qtsensors-5.9.1-bin
    /nix/store/afy4qncsi225224rnkc5lj61w74hps7r-qtquickcontrols-5.9.1
    /nix/store/fahw70iy5y7ig49z3pg5v41vafyyyhpc-virtualbox-5.1.26
    /nix/store/c6mv5fr6rkxqhjg3qpyx5q8was6lswmc-references.nix
    /nix/store/g6gs0gcq91aqb2433sdirags3w3pnhyl-qtmultimedia-5.9.1
    /nix/store/lfnqipvk69mvhbmyy3id4palwzrvcxkg-qtmultimedia-5.9.1-bin
    /nix/store/jkyw1xfdgm3gk9v8w5vhdrbjq3c9154h-qtlocation-5.9.1-bin
    /nix/store/drqzidxc2554lwwjfs823hyw7qpinlj3-qtwebengine-5.9.1-bin
    /nix/store/kr6zrh0rzsxrcfclc3v7skkrw656mfyh-qtwebkit-5.9.1
    /nix/store/r57wn48jg20c7vxfa63k96610h996qdz-python3.6-PyQt-5.8.1
    /nix/store/xa0icbjagi4520n9cqxhbapa9in8yf39-references.nix
    

    And I found out that the PyQt library, that is installed in my python environment, is linked to the old Qt library.
    Removing the python environment nix-env -e python3 do the trick.

    Still there is a problem here: python installed environment contains libraries that are not updated by nix-env -u

    To be clear I installed the environment using nix-env -if python-env.nix where python-env.nix is

    with import <nixpkgs> {};
    
    python36.withPackages (ps: with ps; [ pyqt5 ])
    

    After remove, when I re-install the environment It gets updated correctly.

  6. oyren commented on Oct 25, 2017

    @oyren
    Contributor

    Same problem here.

  7. ttuegel commented on Oct 26, 2017

    @ttuegel
    Member
  8. CMCDragonkai commented on Nov 2, 2017

    @CMCDragonkai
    Member

    No, not for Qt programs. Qt loads plugins at runtime for most features. We let it search your environment for plugins so that you can do things like use themes and run Qt applications outside KDE. Unfortunately, Qt freaks out if it even sees an old plugin, so if you have anything old hanging around it will cause problems. This problem can be circumvented by installing something in the user profile because that profile will be searched first (so if Qt finds the plugin it needs in the user environment, it never runs into the bad plugin in the global environment).

    I found that if I have an environment based on a different hash such as 8fefa85 and I install a qt package into my nix-env from a nixpkgs repository at a newer hash such as e4913c2, this error occurs too. So it seems you need to have compatible "environments" as well. This happened in #27790

  9. LionNatsu commented on Nov 5, 2017

    @LionNatsu

    There must be a plugin which was built with old Qt version.
    Do you have core dump file?

    coredumpctl can show you your core dump 'database'. Find the dump, run coredumpctl info /path/to/execfile, you will get a stack trace.

    Showing the first few lines of stack trace here will be very helpful to find the broken plugin.

  10. LionNatsu commented on Nov 6, 2017

    @LionNatsu

    ebzzry, Emm... I think Virtual Box disabled coredump. Are there any option to enable it?

    Anyway, you may try something like wpa_gui (actually I don't know whether wpa_gui disabled coredump or not)

  11. 7 remaining items

  12. orivej commented on Nov 12, 2017

    @orivej
    Contributor

    Yeah, I've amended my comment, you should remove your user environment from the PATH (probably /home/ebzzry/.nix-profile/bin) to run VirtualBox from the system environment.

  13. orivej commented on Nov 17, 2017

    @orivej
    Contributor

    This bug is caused by this patch: ttuegel/qtbase@efad454 . It works only when there is exactly one copy of Qt 5.9 in PATH (by looking at ../lib/qt-5.9 for each PATH entry). Of course, this breaks when the system and the user environments are in PATH (this is the default) and both contain Qt. We have to find a way to replace that patch.

  14. orivej commented on Nov 22, 2017

    @orivej
    Contributor

    Your $HOME/.nix-profile/lib/qt-5.9/plugins must contain plugins for multiple versions of Qt. Here is a more robust workaround (it creates a new profile just for tdesktop):

    nix-env -f '<nixpkgs>' -p $HOME/tdesktop -iA tdesktop
    PATH=$HOME/tdesktop/bin telegram-desktop
  15. matthiasbeyer commented on Jan 15, 2018

    @matthiasbeyer
    Contributor

    This error can be reproduced with quaternion as well (on 8.03pre125130.3a763b91963 (Impala)):

    $ quaternion 
    Debug:  false
    qrc:///qml/chat.qml:2:1: module "QtQuick.Controls" is not installed
    qrc:///qml/chat.qml:3:1: module "QtQuick.Controls.Styles" is not installed
    qrc:///qml/chat.qml:2:1: module "QtQuick.Controls" is not installed
    qrc:///qml/chat.qml:3:1: module "QtQuick.Controls.Styles" is not installed
    Cannot mix incompatible Qt library (version 0x50902) with this library (version 0x50903)
    Aborted
    

    Reproduce with nix-shell -p quaternion --run quaternion.

  16. simendsjo commented on Feb 21, 2019

    @simendsjo

    I'm getting these errors when starting KDE, so I'm not even able to start the DE.
    The error doesn't refer to anything, so I'm having a hard time locating what might be wrong.

    these paths will be fetched (0.06 MiB download, 0.31 MiB unpacked):
    /nix/store/a6rf8a474z5y01w4ld2v54d24kyqcxag-stdenv-linux
    /nix/store/ial8a56ys2rswfq4j2abm3cl99li5b6p-bash-interactive-4.4-p23-dev
    copying path '/nix/store/ial8a56ys2rswfq4j2abm3cl99li5b6p-bash-interactive-4.4-p23-dev' from 'https://cache.nixos.org'...
    copying path '/nix/store/a6rf8a474z5y01w4ld2v54d24kyqcxag-stdenv-linux' from 'https://cache.nixos.org'...

    • system: "x86_64-linux"
    • host os: Linux 4.14.101, NixOS, 18.09.2203.9bd45dddf81 (Jellyfish)
    • multi-user?: yes
    • sandbox: yes
    • version: nix-env (Nix) 2.1.3
    • channels(root): "nixos-18.09.2243.63a09881b67"
    • channels(simendsjo): ""
    • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos
  17. simendsjo commented on Feb 23, 2019

    @simendsjo

    Think I found my issue. Started uninstalling every GUI thing I installed using nix-env, and found I had xmonad++ installed there. My guess is this broke my system, but I uninstalled it together with a bunch of other packages.

  18. cwoelk commented on Feb 24, 2019

    @cwoelk

    For me it was nomacs-3.10.2 creating the conflicting plugin version $HOME/.nix-profile/lib/qt-5.11. Thanks for the very helpful information in here.

  19. JorelAli commented on Feb 27, 2019

    @JorelAli

    A few days ago, I messed with nix-channel and now qutebrowser and ghostwriter both have this qt issue.

    • system: "x86_64-linux"
    • host os: Linux 4.14.103, NixOS, 18.09.2266.aabc61049c0 (Jellyfish)
    • multi-user?: yes
    • sandbox: yes
    • version: nix-env (Nix) 2.1.3
    • channels(root): "nixos-18.09.2266.aabc61049c0"
    • channels(jorel): "nixpkgs-19.03pre169106.1a88aa9e0cd"
    • nixpkgs: /home/jorel/.nix-defexpr/channels/nixpkgs

    The 'fix' for these have been installing it via nix-env instead of having them in my configuration.nix, however after trying to install sqlitebrowser, the issue hasn't fixed itself (using either nix-env -i or having it in my configuration.nix file)

  20. jtojnar commented on Mar 14, 2019

    @jtojnar
    Member

    Dupe of #37864

  21. nixos-discourse commented on Aug 4, 2023

    @nixos-discourse
  22. nixos-discourse commented on Jul 17, 2024

    @nixos-discourse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    6.topic: qt/kde

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions