NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.08k stars 14.06k forks source link

plover.dev and plover.stable will not start. Error is: Xlib.error.DisplayConnectionError: Can't connect to display ":0": b'No protocol specified\n' #141797

Open JonathanReeve opened 3 years ago

JonathanReeve commented 3 years ago

Describe the bug

A clear and concise description of what the bug is.

Launching plover from a terminal or launcher won't work, whether in an X session or a Wayland session. Launching it from a terminal gives this error:

Unexpected error: Traceback (most recent call last):
  File "/nix/store/qp2ph70y9cy7s9jn1k0vfvi6zpwqivwn-python3.6-plover-4.0.0.dev8/lib/python3.6/site-packages/plover/main.py", line 128, in main
    code = gui.main(config)
  File "/nix/store/qp2ph70y9cy7s9jn1k0vfvi6zpwqivwn-python3.6-plover-4.0.0.dev8/lib/python3.6/site-packages/plover/gui_qt/main.py", line 88, in main
    app = Application(config, use_qt_notifications)
  File "/nix/store/qp2ph70y9cy7s9jn1k0vfvi6zpwqivwn-python3.6-plover-4.0.0.dev8/lib/python3.6/site-packages/plover/gui_qt/main.py", line 28, in __init__
    from plover.gui_qt.main_window import MainWindow
  File "/nix/store/qp2ph70y9cy7s9jn1k0vfvi6zpwqivwn-python3.6-plover-4.0.0.dev8/lib/python3.6/site-packages/plover/gui_qt/main_window.py", line 13, in <module>
    from plover.oslayer import wmctrl
  File "/nix/store/qp2ph70y9cy7s9jn1k0vfvi6zpwqivwn-python3.6-plover-4.0.0.dev8/lib/python3.6/site-packages/plover/oslayer/wmctrl.py", line 34, in <module>
    wmctrl = WmCtrl()
  File "/nix/store/qp2ph70y9cy7s9jn1k0vfvi6zpwqivwn-python3.6-plover-4.0.0.dev8/lib/python3.6/site-packages/plover/oslayer/xwmctrl.py", line 9, in __init__
    self._display = display.Display()
  File "/nix/store/lh8vq3yy413k8bfnx2cigsp3wywd6i3y-python3.6-xlib-0.25/lib/python3.6/site-packages/Xlib/display.py", line 89, in __init__
    self.display = _BaseDisplay(display)
  File "/nix/store/lh8vq3yy413k8bfnx2cigsp3wywd6i3y-python3.6-xlib-0.25/lib/python3.6/site-packages/Xlib/display.py", line 71, in __init__
    protocol_display.Display.__init__(self, *args, **keys)
  File "/nix/store/lh8vq3yy413k8bfnx2cigsp3wywd6i3y-python3.6-xlib-0.25/lib/python3.6/site-packages/Xlib/protocol/display.py", line 166, in __init__
    raise error.DisplayConnectionError(self.display_name, r.reason)
Xlib.error.DisplayConnectionError: Can't connect to display ":0": b'No protocol specified\n'

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.

fish: Job 1, 'plover' terminated by signal SIGABRT (Abort)

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install plover via nix-env -iA nixos.plover.dev or nix-env -iA nixos.plover.stable, or by adding plover.dev to your list of programs in configuration.nix.
  2. Launch plover in a terminal
  3. Notice that it doesn't launch, and instead you get the error above.

Expected behavior

I expected plover to start.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

Notify maintainers

@twey @KoviRobi

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

 - system: `"x86_64-linux"`
 - host os: `Linux 5.14.9-xanmod1-cacule, NixOS, 21.11 (Porcupine)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.5pre20211007_844dd90`
 - channels(root): `"nixos-20.09.4393.068984c00e0"`
 - channels(jon): `"home-manager, nixpkgs-21.05pre276604.8e1891d5b8d"`
 - nixpkgs: `/home/jon/.nix-defexpr/channels/nixpkgs`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
 - plover.dev
 - plover.stable
module:
Artturin commented 3 years ago

your root nixos channel is quite old which is probably the reason you're having this problem as plover is coming from that. in nixos 21.05 and unstable there's a qt wrapper applied which fixes this

JonathanReeve commented 3 years ago

@Artturin , I'm using flakes, rather than channels, so I'm on unstable. Even with today's updates, the error persists. Maybe it works for you or for others if you have QT plugins or libraries installed independently? Try opening plover in a pure shell and running it.

Artturin commented 3 years ago

the plover you're running is python3.6-plover but if it was from on unstable it would be python3.9-plover

Try opening plover in a pure shell and running it.

works

check if the plover file is qt wrapped vim $(which plover)

JonathanReeve commented 3 years ago

Looks like the plover I'm running is python3.9-plover-4.0.0.dev10, actually. Here are the contents of which plover:

#! /nix/store/wadmyilr414n7bimxysbny876i2vlm5r-bash-5.1-p8/bin/bash -e
export PATH='/nix/store/97w52ckcjnfiz89h3lh7zf1kysgfm2s8-python3-3.9.6/bin:/nix/store/0lvvkx4cwqjdk0ns7lp4qxrqbd4c3kya-python3.9-plover-4.0.0.dev10/bin:/nix/store/6q53iqnb97lcxjfr8h9c7w0pvqyhgbdn-python3.9-Babel-2.9.1/bin:/nix/store/s3021pj3fwwr4zqb7qm4rjmpjdh3cc3d-qtdeclarative-5.15.2-bin/bin:/nix/store/qq35n3bxx8cyhw24hmf8694lrr57vahi-python3.9-PyQt5-5.15.4/bin:/nix/store/hdmaipax6qf9g3bsr4nh9x58mkwp4rh8-python3.9-pyserial-3.5/bin'${PATH:+':'}$PATH
export PYTHONNOUSERSITE='true'
export QT_PLUGIN_PATH='/nix/store/w2p7rzhx5bwn4j7h96l9gbbm4nlcbj65-qtbase-5.15.2-bin/lib/qt-5.15.2/plugins'${QT_PLUGIN_PATH:+':'}$QT_PLUGIN_PATH
export QT_PLUGIN_PATH='/nix/store/qvybkp3s09j49ybyd342jh7jqqnqiif0-qtsvg-5.15.2-bin/lib/qt-5.15.2/plugins'${QT_PLUGIN_PATH:+':'}$QT_PLUGIN_PATH
export QT_PLUGIN_PATH='/nix/store/s3021pj3fwwr4zqb7qm4rjmpjdh3cc3d-qtdeclarative-5.15.2-bin/lib/qt-5.15.2/plugins'${QT_PLUGIN_PATH:+':'}$QT_PLUGIN_PATH
export QML2_IMPORT_PATH='/nix/store/s3021pj3fwwr4zqb7qm4rjmpjdh3cc3d-qtdeclarative-5.15.2-bin/lib/qt-5.15.2/qml'${QML2_IMPORT_PATH:+':'}$QML2_IMPORT_PATH
export QML2_IMPORT_PATH='/nix/store/nj5mwrrybhnymcxg4f41p7h66sjxbgm6-qtquickcontrols-5.15.2/lib/qt-5.15.2/qml'${QML2_IMPORT_PATH:+':'}$QML2_IMPORT_PATH
export QT_PLUGIN_PATH='/nix/store/f8a5plhlc1j3x01ji64l790wjcgdblr7-qtwayland-5.15.2-bin/lib/qt-5.15.2/plugins'${QT_PLUGIN_PATH:+':'}$QT_PLUGIN_PATH
export QML2_IMPORT_PATH='/nix/store/f8a5plhlc1j3x01ji64l790wjcgdblr7-qtwayland-5.15.2-bin/lib/qt-5.15.2/qml'${QML2_IMPORT_PATH:+':'}$QML2_IMPORT_PATH
exec -a "$0" "/nix/store/0lvvkx4cwqjdk0ns7lp4qxrqbd4c3kya-python3.9-plover-4.0.0.dev10/bin/.plover-wrapped"  "$@"

Is that qt-wrapped? Either way, it still doesn't work. Here's the error there (error posted above was probably from a nix-env installed version, but it's basically the same error as this one, from the configuration.nix installed version:

Unexpected error: Traceback (most recent call last):
  File "/nix/store/0lvvkx4cwqjdk0ns7lp4qxrqbd4c3kya-python3.9-plover-4.0.0.dev10/lib/python3.9/site-packages/plover/scripts/main.py", line 131, in main
    code = gui.main(config, controller)
  File "/nix/store/0lvvkx4cwqjdk0ns7lp4qxrqbd4c3kya-python3.9-plover-4.0.0.dev10/lib/python3.9/site-packages/plover/gui_qt/main.py", line 98, in main
    app = Application(config, controller, use_qt_notifications)
  File "/nix/store/0lvvkx4cwqjdk0ns7lp4qxrqbd4c3kya-python3.9-plover-4.0.0.dev10/lib/python3.9/site-packages/plover/gui_qt/main.py", line 31, in __init__
    from plover.gui_qt.main_window import MainWindow
  File "/nix/store/0lvvkx4cwqjdk0ns7lp4qxrqbd4c3kya-python3.9-plover-4.0.0.dev10/lib/python3.9/site-packages/plover/gui_qt/main_window.py", line 16, in <module>
    from plover.oslayer import wmctrl
  File "/nix/store/0lvvkx4cwqjdk0ns7lp4qxrqbd4c3kya-python3.9-plover-4.0.0.dev10/lib/python3.9/site-packages/plover/oslayer/wmctrl.py", line 34, in <module>
    wmctrl = WmCtrl()
  File "/nix/store/0lvvkx4cwqjdk0ns7lp4qxrqbd4c3kya-python3.9-plover-4.0.0.dev10/lib/python3.9/site-packages/plover/oslayer/xwmctrl.py", line 9, in __init__
    self._display = display.Display()
  File "/nix/store/240yih21agqh8cffi2i7i3xsvzb0s6lm-python3.9-xlib-0.29/lib/python3.9/site-packages/Xlib/display.py", line 89, in __init__
    self.display = _BaseDisplay(display)
  File "/nix/store/240yih21agqh8cffi2i7i3xsvzb0s6lm-python3.9-xlib-0.29/lib/python3.9/site-packages/Xlib/display.py", line 71, in __init__
    protocol_display.Display.__init__(self, *args, **keys)
  File "/nix/store/240yih21agqh8cffi2i7i3xsvzb0s6lm-python3.9-xlib-0.29/lib/python3.9/site-packages/Xlib/protocol/display.py", line 166, in __init__
    raise error.DisplayConnectionError(self.display_name, r.reason)
Xlib.error.DisplayConnectionError: Can't connect to display ":0": b'No protocol specified\n'

Exception ignored in: <function Application.__del__ at 0x7f51e9ea9280>
Traceback (most recent call last):
  File "/nix/store/0lvvkx4cwqjdk0ns7lp4qxrqbd4c3kya-python3.9-plover-4.0.0.dev10/lib/python3.9/site-packages/plover/gui_qt/main.py", line 71, in __del__
    del self._win
AttributeError: _win
Artturin commented 3 years ago

now you're using the newer version as there's no

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.
Artturin commented 3 years ago

what is your de/wm?

JonathanReeve commented 3 years ago

I use i3, but I'm getting the same error on GNOME, too.

stale[bot] commented 2 years ago

I marked this as stale due to inactivity. → More info

JonathanReeve commented 2 years ago

This is still a problem. Plover still doesn't start.