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

Errors when running scripts/xephyr #1425

Closed
pawamoy opened this issue Sep 5, 2019 · 6 comments
Closed

Errors when running scripts/xephyr #1425

pawamoy opened this issue Sep 5, 2019 · 6 comments

Comments

@pawamoy
Copy link
Contributor

pawamoy commented Sep 5, 2019

Just pasting the log if it talks to anybody.

% ./scripts/xephyr                                                                                           (master|+1…) 20:23:14
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported high keycode 372 for name <I372> ignored
>                   X11 cannot support keycodes above 255.
>                   This warning only shows for the first high keycode.
> Internal error:   Could not resolve keysym XF86MonBrightnessCycle
> Internal error:   Could not resolve keysym XF86RotationLockToggle
Errors from xkbcomp are not fatal to the X server
xterm: cannot load font "-Misc-Fixed-medium-R-*-*-13-120-75-75-C-120-ISO10646-1"
xterm: cannot load font "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1"
2019-09-05 20:23:25,443 libqtile utils.py:safe_import():L192  Unmet dependencies for optional Widget: '.widget.launchbar.LaunchBar', No module named 'xdg.IconTheme'
2019-09-05 20:23:25,526 libqtile manager.py:setup_python_dbus():L310  importing dbus/gobject failed, dbus will not work.
Traceback (most recent call last):
  File "/media/data/dev/forks/qtile/scripts/../bin/qtile", line 33, in <module>
    qtile.main()
  File "/media/data/dev/forks/qtile/libqtile/scripts/qtile.py", line 130, in main
    q = make_qtile()
  File "/media/data/dev/forks/qtile/libqtile/scripts/qtile.py", line 124, in make_qtile
    state=options.state,
  File "/media/data/dev/forks/qtile/libqtile/core/manager.py", line 193, in __init__
    self._process_screens()
  File "/media/data/dev/forks/qtile/libqtile/core/manager.py", line 404, in _process_screens
    self.groups[i],
  File "/media/data/dev/forks/qtile/libqtile/config.py", line 255, in _configure
    i._configure(qtile, self)
  File "/media/data/dev/forks/qtile/libqtile/bar.py", line 192, in _configure
    self.height
  File "/media/data/dev/forks/qtile/libqtile/drawer.py", line 241, in __init__
    self.height,
  File "/home/pawamoy/data/isolated/virtualenvs/qtile/local/lib/python3.7/site-packages/cairocffi/xcb.py", line 37, in __init__
    p = cairo.cairo_xcb_surface_create(
AttributeError: cffi library 'libcairo.so.2' has no function, constant or global variable named 'cairo_xcb_surface_create'
sys:1: ResourceWarning: unclosed <socket.socket fd=7, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0, raddr=/tmp/.X11-unix/X1>
/usr/lib64/python3.7/asyncio/base_events.py:618: ResourceWarning: unclosed event loop <_UnixSelectorEventLoop running=False closed=False debug=False>
/usr/lib64/python3.7/asyncio/unix_events.py:65: ResourceWarning: Closing the loop <_UnixSelectorEventLoop running=False closed=True debug=False> on interpreter shutdown stage, skipping signal handlers removal
sys:1: ResourceWarning: unclosed <socket.socket fd=12, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0, laddr=/home/pawamoy/.cache/qtile/qtilesocket.:1.0>
xterm: fatal IO error 11 (Resource temporarily unavailable) or KillClient on X server ":1"

I see missing fonts, unsupported keycode, error in cairo, and fatal error with xterm/x. Any idea how to fix that on my end? Did anyone encounter these kind of errors before?

@whatacold
Copy link
Contributor

Hmm, it seems the AttributeError exception is caused by the wrong order of installing dependencies, check out issue #994

@pawamoy
Copy link
Contributor Author

pawamoy commented Sep 7, 2019

Thank you, it is better now.

I fixed the dbus/gobject error message by following the PyGObject installation instructions for ArchLinux at https://pygobject.readthedocs.io/en/latest/getting_started.html#arch-getting-started:

  1. Open a terminal and enter your virtual environment
  2. Execute sudo pacman -S python cairo pkgconf gobject-introspection gtk3 to install the build dependencies and GTK
  3. Execute pip3 install pycairo to build and install Pycairo
  4. Execute pip3 install PyGObject to build and install PyGObject

I still get this traceback though:

Traceback (most recent call last):
  File "/media/data/dev/forks/qtile/scripts/../bin/qtile", line 33, in <module>
    qtile.main()
  File "/media/data/dev/forks/qtile/libqtile/scripts/qtile.py", line 130, in main
    q = make_qtile()
  File "/media/data/dev/forks/qtile/libqtile/scripts/qtile.py", line 124, in make_qtile
    state=options.state,
  File "/media/data/dev/forks/qtile/libqtile/core/manager.py", line 193, in __init__
    self._process_screens()
  File "/media/data/dev/forks/qtile/libqtile/core/manager.py", line 404, in _process_screens
    self.groups[i],
  File "/media/data/dev/forks/qtile/libqtile/config.py", line 255, in _configure
    i._configure(qtile, self)
  File "/media/data/dev/forks/qtile/libqtile/bar.py", line 204, in _configure
    i._configure(qtile, self)
  File "/media/data/dev/forks/qtile/libqtile/widget/base.py", line 440, in _configure
    _TextBox._configure(self, qtile, bar)
  File "/media/data/dev/forks/qtile/libqtile/widget/base.py", line 361, in _configure
    self.formatted_text,
  File "/media/data/dev/forks/qtile/libqtile/widget/base.py", line 317, in formatted_text
    return self.fmt.format(self._text)
KeyError: 'MemUsed'

And the xephyr window looks like this:

xephyr

The terminal within the window is working, but then the test suite gets a lot of ERROR and FAILED (and it's kinda slow, don't know if it's normal):

% pytest
=============== test session starts ===============
platform linux -- Python 3.7.4,
pytest-5.1.2, py-1.8.0, pluggy-0.12.0 --
/home/pawamoy/data/isolated/virtualenvs/qtile/bin/python
cachedir: .pytest_cache
rootdir: /media/data/dev/forks/qtile,
inifile: setup.cfg, testpaths: test
plugins: cov-2.7.1
collected 380 items

test/test_bar.py::test_completion PASSED                      [  0%]
test/test_bar.py::test_draw[GBConfig] ERROR                   [  0%]
test/test_bar.py::test_prompt[GBConfig] ERROR                 [  0%]
test/test_bar.py::test_event[GBConfig] ERROR                  [  1%]
test/test_bar.py::test_textbox[GBConfig] ERROR                [  1%]
test/test_bar.py::test_textbox_errors[GBConfig] ERROR         [  1%]
test/test_bar.py::test_groupbox_button_press[GBConfig] ERROR  [  1%]
test/test_bar.py::test_geometry[GeomConf] ERROR               [  2%]
test/test_bar.py::test_resize[GeomConf] ERROR                 [  2%]
test/test_bar.py::test_incompatible_widget FAILED             [  2%]
test/test_bar.py::test_multiple_stretches FAILED              [  2%]
test/test_bar.py::test_basic FAILED                           [  3%]
test/test_bar.py::test_singlespacer FAILED                    [  3%]
test/test_bar.py::test_nospacer FAILED                        [  3%]
test/test_command.py::test_layout_filter[CallConfig] ERROR    [  3%]
test/test_command.py::test_doc PASSED                         [  4%]
test/test_command.py::test_commands PASSED                    [  4%]
test/test_command.py::test_command PASSED                     [  4%]
test/test_command.py::test_cmd_commands[ServerConfig] ERROR   [  5%]
test/test_command.py::test_call_unknown[ServerConfig] ERROR   [  5%]
...

@pawamoy
Copy link
Contributor Author

pawamoy commented Sep 7, 2019

It seems the errors are all caused by the same thing: AttributeError: module 'pytest' has no attribute 'config':

Typical pytest log:

_______________ test_can_subscribe_to_startup_hooks ___________________
qtile_nospawn = <test.conftest.Qtile object at 0x7fb0f2850250>

    def test_can_subscribe_to_startup_hooks(qtile_nospawn):
        config = BareConfig
        for attr in dir(default_config):
            if not hasattr(config, attr):
                setattr(config, attr, getattr(default_config, attr))
        self = qtile_nospawn
    
        self.startup_once_calls = Value('i', 0)
        self.startup_calls = Value('i', 0)
        self.startup_complete_calls = Value('i', 0)
    
        def inc_startup_once_calls():
            self.startup_once_calls.value += 1
    
        def inc_startup_calls():
            self.startup_calls.value += 1
    
        def inc_startup_complete_calls():
            self.startup_complete_calls.value += 1
    
        libqtile.core.manager.hook.subscribe.startup_once(inc_startup_once_calls)
        libqtile.core.manager.hook.subscribe.startup(inc_startup_calls)
        libqtile.core.manager.hook.subscribe.startup_complete(inc_startup_complete_calls)
    
>       self.start(config)

test/test_hook.py:121: 
_ _ _ _ _ _ _ _ _ _ _ _ 

self = <test.conftest.Qtile object at 0x7fb0f2850250>, config_class = <class 'test.conftest.BareConfig'>

    def start(self, config_class):
        rpipe, wpipe = multiprocessing.Pipe()
    
        def run_qtile():
            llvl = logging.DEBUG if pytest.config.getoption("--debuglog") else logging.INFO
            kore = xcore.XCore()
            try:
                init_log(llvl, log_path=None, log_color=False)
                q = QtileManager(kore, config_class(), self.display, self.sockfile)
                q.loop()
            except Exception:
                wpipe.send(traceback.format_exc())
    
        self.proc = multiprocessing.Process(target=run_qtile)
        self.proc.start()
    
        # First, wait for socket to appear
        if can_connect_qtile(self.sockfile):
            ipc_client = ipc.Client(self.sockfile)
            ipc_command = command_interface.IPCCommandInterface(ipc_client)
            self.c = command_client.InteractiveCommandClient(ipc_command)
            return
        if rpipe.poll(sleep_time):
            error = rpipe.recv()
            raise AssertionError("Error launching Qtile, traceback:\n%s" % error)
>       raise AssertionError("Error launching Qtile")
E       AssertionError: Error launching Qtile

test/conftest.py:286: AssertionError
----------------- Captured stderr setup -----------------
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported high keycode 372 for name <I372> ignored
>                   X11 cannot support keycodes above 255.
>                   This warning only shows for the first high keycode.
> Internal error:   Could not resolve keysym XF86MonBrightnessCycle
> Internal error:   Could not resolve keysym XF86RotationLockToggle
Errors from xkbcomp are not fatal to the X server
----------------- Captured stderr call -----------------
Process Process-38:
Traceback (most recent call last):
  File "/usr/lib64/python3.7/multiprocessing/process.py", line 297, in _bootstrap
    self.run()
  File "/usr/lib64/python3.7/multiprocessing/process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "/media/data/dev/forks/qtile/test/conftest.py", line 265, in run_qtile
    llvl = logging.DEBUG if pytest.config.getoption("--debuglog") else logging.INFO
AttributeError: module 'pytest' has no attribute 'config'
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported high keycode 372 for name <I372> ignored
>                   X11 cannot support keycodes above 255.
>                   This warning only shows for the first high keycode.
> Internal error:   Could not resolve keysym XF86MonBrightnessCycle
> Internal error:   Could not resolve keysym XF86RotationLockToggle
Errors from xkbcomp are not fatal to the X server
---------------- Captured stderr teardown ----------------
Qtile exited with exitcode: 1

@whatacold
Copy link
Contributor

whatacold commented Sep 8, 2019

it's kinda slow, don't know if it's normal

It took me about 50 minutes last time I ran the test suites with a docker container (Here is the Dockerfile in case you're interested ), and I tried to speed it up with pytest-xdist, but resulted in too many errors, don't know why yet.

It seems the errors are all caused by the same thing: AttributeError: module 'pytest' has no attribute 'config':

I encountered this before, you can patch it with #1404 .

@pawamoy
Copy link
Contributor Author

pawamoy commented Sep 8, 2019

Alright, thank you very much @whatacold, I think I'm setup now 🙂 Your patch made the test suite work again. I'll close this issue and split it into new relevant ones.

@pawamoy
Copy link
Contributor Author

pawamoy commented Sep 8, 2019

Closing in favor of more focused issue #1436 and #1435. Will also open a PR to add a troubleshoot section in the docs!

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

No branches or pull requests

2 participants