Startx giving errors and not starting

I get the following when i run the command startx

startx
hostname: No address associated with hostname
xauth: (stdin):1:  bad display name "XXXXXXX:0" in "add" command

XXXXXXX is the UUID of the device.

I am not sure how to fix this.

Hi Morrissey,
If your project is on Github, can you please send me a link to it?
else, can you please send me your scripts for starting up X-org?

Maybe it will also help you to look at https://github.com/resin-io/resin-electronjs which is an example of running x-org in a resin.io container.

Hi,
Sorry if it’s bad form to jump on another thread, but I’m getting the same error messages as Morrissey. I’m currently just trying to run the resin-electronjs example from the link Megan gave, and it won’t start any window server at all.
I’ve made the device available for support to view, if that helps.

Many Thanks,
Ben

Just a quick note with what I have experienced when putting the resin-electronjs project on a RPi3 with ResinOS 2.7.8. The HDMI output displays the text “Hello, World” with an ASCII unicorn beneath it. The fleet configuration is {“RESIN_HOST_CONFIG_gpu_mem”: “128”}. The logs are as follows:

10.01.18 17:29:41 (+0000) Starting application 'registry2.resin.io/electronjs/1b73fbd7a561edbbd211663c3e323aac4d3ed442'
10.01.18 17:29:41 (+0000) Application is already running 'registry2.resin.io/electronjs/1b73fbd7a561edbbd211663c3e323aac4d3ed442'
10.01.18 17:29:32 (+0000) Systemd init system enabled.
10.01.18 17:29:32 (+0000) systemd 215 running in system mode. (+PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR)
10.01.18 17:29:32 (+0000) Detected virtualization 'other'.
10.01.18 17:29:32 (+0000) Detected architecture 'arm'.
10.01.18 17:29:32 (+0000) Set hostname to <snip_uuid>.
10.01.18 17:29:35 (+0000) hostname: No address associated with hostname
10.01.18 17:29:35 (+0000) xauth: (stdin):1:  bad display name "snip_uuid:0" in "add" command
10.01.18 17:29:35 (+0000) 
10.01.18 17:29:35 (+0000) 
10.01.18 17:29:35 (+0000) X.Org X Server 1.18.4
10.01.18 17:29:35 (+0000) Release Date: 2016-07-19
10.01.18 17:29:35 (+0000) X Protocol Version 11, Revision 0
10.01.18 17:29:35 (+0000) Build Operating System: Linux 4.4.26-v7+ armv7l Raspbian
10.01.18 17:29:35 (+0000) Current Operating System: Linux snip_uuid 4.9.50 #2 SMP Fri Nov 17 17:19:45 UTC 2017 armv7l
10.01.18 17:29:35 (+0000) Kernel command line: 8250.nr_uarts=0 bcm2708_fb.fbwidth=1184 bcm2708_fb.fbheight=624 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 console=null root=/dev/mmcblk0p2 rootfstype=ext4 rootwait vt.global_cursor_default=0
10.01.18 17:29:35 (+0000) Build Date: 11 November 2016  11:59:59AM
10.01.18 17:29:35 (+0000) xorg-server 2:1.18.4-2+rpi1 (https://www.debian.org/support) 
10.01.18 17:29:35 (+0000) Current version of pixman: 0.33.3
10.01.18 17:29:35 (+0000) 	Before reporting problems, check http://wiki.x.org
10.01.18 17:29:35 (+0000) 	to make sure that you have the latest version.
10.01.18 17:29:35 (+0000) Markers: (--) probed, (**) from config file, (==) default setting,
10.01.18 17:29:35 (+0000) 	(++) from command line, (!!) notice, (II) informational,
10.01.18 17:29:35 (+0000) 	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
10.01.18 17:29:35 (+0000) (==) Log file: "/var/log/Xorg.0.log", Time: Wed Jan 10 17:29:35 2018
10.01.18 17:29:35 (+0000) (==) Using system config directory "/usr/share/X11/xorg.conf.d"
10.01.18 17:29:41 (+0000) [178:0110/172941.953955:WARNING:audio_manager.cc(295)] Multiple instances of AudioManager detected
10.01.18 17:29:41 (+0000) [178:0110/172941.954320:WARNING:audio_manager.cc(254)] Multiple instances of AudioManager detected
10.01.18 17:29:42 (+0000) [209:0110/172942.838911:ERROR:sandbox_linux.cc(343)] InitializeSandbox() called with multiple threads in process gpu-process. 

Hi,

Is there any update on how to resolve this issue? I’m facing the same problem.

-Prateek

Hi @surekap , have you set that correct GPU memory split as mentioned above by @sqweelygig ? Can you also describe in a bit more in detail the set up you have. I the screen a simple HDMI screen or another type of screen. Was this working and then a new push broke it or did a hostOS upgrade break the functionality or was this a newly provisioned device?

Hi @shaunmulligan, my fleet config is {“RESIN_HOST_CONFIG_gpu_mem”: “160”} with zero redefines. I am running a fleet of 10 raspberry pi 3 devices.

Each device is connected via HDMI to a Zebtronics ZEB 16-A Amazon Link monitor.

The entire setup was working until commit 5afa80c and today when I rebooted a test device it updated to a later revision and everything broke. I looked my diffs but I can’t find anything off. I’m posting a consolidated diff here:

I’m pretty much using a stock https://github.com/resin-io/resin-electronjs

start.sh

# pages we need more.
umount /dev/shm && mount -t tmpfs shm /dev/shm

+# start the flask server
+get_pip() {
+   if hash pip 2>/dev/null; then
+       echo "Found pip. Skipping install."
+   else
+       if [ ! -f get-pip.py ]; then
+           wget https://bootstrap.pypa.io/get-pip.py
+       fi
+       python get-pip.py
+   fi
+}
+
+get_pip
+/usr/local/bin/pip install -U flask
+/usr/local/bin/pip install -U flask-cors
+/usr/local/bin/pip install -U pyserial
+python /usr/src/app/escpos/app.py &
+
 # using local electron module instead of the global electron lets you
 # easily control specific version dependency between your app and electron itself.
 # the syntax below starts an X istance with ONLY our electronJS fired up,
 # it saves you a LOT of resources avoiding full-desktops envs

-wget https://bootstrap.pypa.io/get-pip.py
-python get-pip.py
-pip install flask
-python /usr/src/app/escpos/app.py &
-
 rm /tmp/.X0-lock &>/dev/null || true
 startx /usr/src/app/node_modules/electron/dist/electron /usr/src/app --enable-logging

How do I revert back to the old commit to see if everything works there?

Hey @surekap, why did the device only update to the new commit after a reboot? do you have your code holding the update lock or something like that?

There are two ways to rollback to the previous commit:

  1. ) on your local git, reset the HEAD to the commit you want and make a new branch, then push that branch to resin by doing git push resin my-branch:master
    2.) use the staged rollout functionality described here: https://github.com/resin-io-playground/staged-releases to make that single test device point to a specific build.

Hi @shaunmulligan,

There is no update lock - some devices are periodically turned off as they are moved around for training since we are going through a pilot phase.

I was successfully able to roll back and the error is still visible on this old commit. I am posting the relevant part of the log below:

09.02.18 18:51:01 (+0530) xauth:  file /root/.Xauthority does not exist
09.02.18 18:51:01 (+0530) xauth: (stdin):1:  bad display name "762407c:0" in "add" command
09.02.18 18:51:01 (+0530)
09.02.18 18:51:01 (+0530)
09.02.18 18:51:01 (+0530) X.Org X Server 1.18.4
09.02.18 18:51:01 (+0530) Release Date: 2016-07-19
09.02.18 18:51:01 (+0530) X Protocol Version 11, Revision 0
09.02.18 18:51:01 (+0530) Build Operating System: Linux 4.4.26-v7+ armv7l Raspbian
09.02.18 18:51:01 (+0530) Current Operating System: Linux 762407c 4.9.50 #2 SMP FriNov 17 17:19:45 UTC 2017 armv7l
09.02.18 18:51:01 (+0530) Kernel command line: 8250.nr_uarts=0 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 console=null root=/dev/mmcblk0p2 rootfstype=ext4 rootwait vt.global_cursor_default=0
09.02.18 18:51:01 (+0530) Build Date: 11 November 2016  11:59:59AM
09.02.18 18:51:01 (+0530) xorg-server 2:1.18.4-2+rpi1 (https://www.debian.org/support)
09.02.18 18:51:01 (+0530) Current version of pixman: 0.33.3
09.02.18 18:51:01 (+0530)       Before reporting problems, check http://wiki.x.org
09.02.18 18:51:01 (+0530)       to make sure that you have the latest version.
09.02.18 18:51:01 (+0530) Markers: (--) probed, (**) from config file, (==) defaultsetting,
09.02.18 18:51:01 (+0530)       (++) from command line, (!!) notice, (II) informational,
09.02.18 18:51:01 (+0530)       (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
09.02.18 18:51:01 (+0530) (==) Log file: "/var/log/Xorg.0.log", Time: Fri Feb  9 13:21:01 2018
09.02.18 18:51:01 (+0530) (==) Using system config directory "/usr/share/X11/xorg.conf.d"
09.02.18 18:51:01 (+0530) Traceback (most recent call last):
09.02.18 18:51:01 (+0530)   File "/usr/src/app/escpos/app.py", line 3, in <module>
09.02.18 18:51:01 (+0530)     from flask_cors import CORS
09.02.18 18:51:01 (+0530) ImportError: No module named flask_cors
09.02.18 18:51:08 (+0530) [239:0209/132108.103165:WARNING:audio_manager.cc(293)] Multiple instances of AudioManager detected
09.02.18 18:51:08 (+0530) [239:0209/132108.104747:WARNING:audio_manager.cc(254)] Multiple instances of AudioManager detected
09.02.18 18:51:08 (+0530) [262:0209/132108.781007:ERROR:sandbox_linux.cc(343)] InitializeSandbox() called with multiple threads in process gpu-process.
09.02.18 18:51:08 (+0530) [239:0209/132108.798522:ERROR:browser_gpu_channel_host_factory.cc(103)] Failed to launch GPU process.
09.02.18 18:51:08 (+0530) [239:0209/132108.798680:ERROR:browser_gpu_channel_host_factory.cc(103)] Failed to launch GPU process.
09.02.18 18:51:08 (+0530) [239:0209/132108.798784:ERROR:browser_gpu_channel_host_factory.cc(103)] Failed to launch GPU process.
09.02.18 18:51:08 (+0530) [239:0209/132108.798877:ERROR:browser_gpu_channel_host_factory.cc(103)] Failed to launch GPU process.
09.02.18 18:51:08 (+0530) [239:0209/132108.799495:ERROR:browser_gpu_channel_host_factory.cc(103)] Failed to launch GPU process.

The flask_cors issue is a problem with my application code which is why I did the commit in the first place.

@surekap so did you rollback doing a repush or using the scripts I pointed to? Also the commit you rolled back to was previously working on this device?

I made the code changes to reflect that commit and did a repush.
This code was definitely working on this device earlier.

Okay, in that case, my suspicion is that something has changed in the base image. What is the FROM line in your Dockerfile? If it is not a date frozen base image, then it will automatically pull in the latest base image changes whenever a new -node:6 image is built. Do you know the date of the last time this was known to be working? If you know that date, we can probably change the base image to a date tagged one and see if that fixes the problem, then we will know that the base images have added a change that broke this.

I’m not able to say when this broke. It was working on the old commit this morning.

FROM resin/%%RESIN_MACHINE_NAME%%-node:6

The error seems to be some problem related to google-chrome.

@surekap can you go to the “releases” page of the application and see the build date of the last know release that was working. From there we can try switch to an older base image based on that date. Looking at the base images changelog, it seems there was a change in the sources.list for RPI (https://github.com/resin-io-library/base-images/blob/master/CHANGELOG.md#2017-12-07) which could potentially have introduced the change

Jan 11th 2018, 12:33 am

Could you try changing your base image to:

FROM resin/%%RESIN_MACHINE_NAME%%-node:6-20171229

I just realised something.

All the production devices run on the Zebtronics which has a native resolution of 1920x1080.

The device is currently hooked up to my test bench which has a 4K panasonic LCD (though r-pi probably still downscales that to 1920x1080). Could that be the source of the issue?

its worth a shot.

I fixed the problem by pulling the latest commit (f73d84f) of resin-electronjs
Turns out the issues were with the version of electron and gpu acceleration.