checkbox remote did not use env var DISPLAY

Bug #1849872 reported by Taihsiang Ho
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Next Generation Checkbox (CLI)
Fix Released
High
Sylvain Pineau

Bug Description

The recent desktop sru jobs failed as a false alarm like this one

camera/multiple-resolution-images_video0

No protocol specified
Unable to init server: Could not connect: Connection refused
No protocol specified
Unable to init server: Could not connect: Connection refused
No protocol specified
Unable to init server: Could not connect: Connection refused

(camera_test:8297): Clutter-CRITICAL **: 06:35:32.231: Unable to initialize Clutter: Could not initialize Gdk
No protocol specified
Unable to init server: Could not connect: Connection refused

(camera_test:8297): Gtk-WARNING **: 06:35:32.231: cannot open display: :0

from
http://10.101.50.238:8080/job/cert-stock-sru-bionic-desktop-201606-22344/181/ and https://certification.canonical.com/hardware/201606-22344/submission/153352/

I figured out it is because that way we enable checkbox slave differs for this merge request https://code.launchpad.net/~sylvain-pineau/checkbox-ng/+git/packaging_remote_service/+merge/373394

The merge request makes the slave process will be started by root rather than a typical user (e.g. ubuntu for desktop sru jobs)

[More Information]

By specifying User=ubuntu in [Service] session we could fix this issue for desktop. However it may be not a good solution because the user name will differ in the other jenkins jobs.

Tags: taipei-lab

Related branches

Revision history for this message
Taihsiang Ho (tai271828) wrote :

As a short term workaround, we could update the systemd file and reload/restart the corresponding service without touching checkbox-ng source.

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

Our plan about remote is to run the service as root at switch to a normal user on demand, this way needless to setup a sudoer rule. Stopping the service and running it as ubuntu user is a short term solution.

For the long term, I'll propose a fix to set DISPLAY when there's actually a desktop session running (unity or gnome).

Changed in checkbox-ng:
status: New → Triaged
Revision history for this message
Taihsiang Ho (tai271828) wrote :
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

@Tai, please try to set the normal user to ubuntu in your launcher:

https://checkbox.readthedocs.io/en/latest/launcher-tutorial.html#daemon-specific-configuration

It will be a prerequisite for the DISPLAY fix

Changed in checkbox-ng:
milestone: none → 1.6.0
assignee: nobody → Sylvain Pineau (sylvain-pineau)
importance: Undecided → High
status: Triaged → In Progress
Changed in checkbox-ng:
status: In Progress → Fix Committed
Revision history for this message
Taihsiang Ho (tai271828) wrote :
Download full text (5.6 KiB)

The merge request has a regression:

Application Malfunction Detected

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/guacamole/core.py", line 248, in eat
    return self._dispatch()
  File "/usr/lib/python3/dist-packages/guacamole/core.py", line 298, in _dispatch
    result = ingredient.dispatch(self.context)
  File "/usr/lib/python3/dist-packages/guacamole/ingredients/cmdtree.py", line 152, in dispatch
    return self._dispatch(context, 0)
  File "/usr/lib/python3/dist-packages/guacamole/ingredients/cmdtree.py", line 179, in _dispatch
    return self._dispatch_None(context, level, retval, command)
  File "/usr/lib/python3/dist-packages/guacamole/ingredients/cmdtree.py", line 208, in _dispatch_None
    return self._dispatch(context, level + 1)
  File "/usr/lib/python3/dist-packages/guacamole/ingredients/cmdtree.py", line 165, in _dispatch
    retval = command.invoked(context)
  File "/usr/lib/python3/dist-packages/checkbox_ng/launcher/master.py", line 141, in invoked
    self.connect_and_run(ctx.args.host, port)
  File "/usr/lib/python3/dist-packages/checkbox_ng/launcher/master.py", line 198, in connect_and_run
    }[state]()
  File "/usr/lib/python3/dist-packages/checkbox_ng/launcher/master.py", line 221, in new_session
    tps = self.sa.start_session(configuration)
  File "/usr/lib/python3/dist-packages/plainbox/vendor/rpyc/core/netref.py", line 199, in __call__
    return syncreq(_self, consts.HANDLE_CALL, args, kwargs)
  File "/usr/lib/python3/dist-packages/plainbox/vendor/rpyc/core/netref.py", line 75, in syncreq
    return conn.sync_request(handler, proxy, *args)
  File "/usr/lib/python3/dist-packages/plainbox/vendor/rpyc/core/protocol.py", line 471, in sync_request
    return self.async_request(handler, *args, timeout=timeout).value
  File "/usr/lib/python3/dist-packages/plainbox/vendor/rpyc/core/async_.py", line 97, in value
    raise self._obj
plainbox.vendor.rpyc.core.vinegar/psutil._exceptions._get_exception_class.<locals>.Derived: None

========= Remote Traceback (1) =========
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/psutil/_pslinux.py", line 1390, in wrapper
    return fun(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/psutil/_pslinux.py", line 1512, in environ
    with open_text("%s/%s/environ" % (self._procfs_path, self.pi...

Read more...

Revision history for this message
Taihsiang Ho (tai271828) wrote :

may* have. Let me dive into it a bit, e.g. to see if the normal_user is assigned correctly.

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

This permission error, are you sure you're running the service via systemd? I mean the one that that deb package installs? You should not start one yourself now (i.e from the ubuntu user session)

Revision history for this message
Taihsiang Ho (tai271828) wrote :

The latest run looks good now.

Revision history for this message
Taihsiang Ho (tai271828) wrote :
Download full text (4.5 KiB)

The job running on bionic is good. However, the psutil version on Xenial seems not compatible

                        Application Malfunction Detected

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/guacamole/core.py", line 248, in eat
    return self._dispatch()
  File "/usr/lib/python3/dist-packages/guacamole/core.py", line 298, in _dispatch
    result = ingredient.dispatch(self.context)
  File "/usr/lib/python3/dist-packages/guacamole/ingredients/cmdtree.py", line 152, in dispatch
    return self._dispatch(context, 0)
  File "/usr/lib/python3/dist-packages/guacamole/ingredients/cmdtree.py", line 179, in _dispatch
    return self._dispatch_None(context, level, retval, command)
  File "/usr/lib/python3/dist-packages/guacamole/ingredients/cmdtree.py", line 208, in _dispatch_None
    return self._dispatch(context, level + 1)
  File "/usr/lib/python3/dist-packages/guacamole/ingredients/cmdtree.py", line 165, in _dispatch
    retval = command.invoked(context)
  File "/usr/lib/python3/dist-packages/checkbox_ng/launcher/master.py", line 141, in invoked
    self.connect_and_run(ctx.args.host, port)
  File "/usr/lib/python3/dist-packages/checkbox_ng/launcher/master.py", line 198, in connect_and_run
    }[state]()
  File "/usr/lib/python3/dist-packages/checkbox_ng/launcher/master.py", line 221, in new_session
    tps = self.sa.start_session(configuration)
  File "/usr/lib/python3/dist-packages/plainbox/vendor/rpyc/core/netref.py", line 199, in __call__
    return syncreq(_self, consts.HANDLE_CALL, args, kwargs)
  File "/usr/lib/python3/dist-packages/plainbox/vendor/rpyc/core/netref.py", line 75, in syncreq
    return conn.sync_request(handler, proxy, *args)
  File "/usr/lib/python3/dist-packages/plainbox/vendor/rpyc/core/protocol.py", line 471, in sync_request
    return self.async_request(handler, *args, timeout=timeout).value
  File "/usr/lib/python3/dist-packages/plainbox/vendor/rpyc/core/async_.py", line 97, in value
    raise self._obj
_get_exception_class.<locals>.Derived: 'Process' object has no attribute 'environ'

========= Remote Traceback (1) =========
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/plainbox/vendor/rpyc/core/protocol.py", line 329, in _dispatch_request
    res = self._HANDLERS[handler](self, *args)
  File "/usr/lib/python3/dist-packages/plainbox/v...

Read more...

Changed in checkbox-ng:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.