When i run multiple sitespeed docker , i faced this error
[2020-04-02 22:14:11] INFO: Versions OS: linux 3.10.0-1062.1.2.el7.x86_64 nodejs: v10.16.0 sitespeed.io: 10.0.1 browsertime: 6.0.1 coach: 4.0.1
[2020-04-02 22:14:11] ERROR: Error: _XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
(EE)
Fatal server error:
(EE) Cannot establish any listening sockets - Make sure an X server isn't already running(EE)
at ChildProcess.self._process.on (/usr/src/app/node_modules/@cypress/xvfb/index.js:189:23)
at ChildProcess.emit (events.js:198:13)
at maybeClose (internal/child_process.js:982:16)
at Socket.stream.socket.on (internal/child_process.js:389:11)
at Socket.emit (events.js:198:13)
at Pipe._handle.close (net.js:606:12)
To fix this i have to add 2 parameters to sitespeed command:
--browsertime.xvfb "true" --browsertime.xvfbParams.display "$(((RANDOM % 1000)+100))"
It turned out that the above fix will kill the video capture. After looking through my change log, the option “–name ” was actually the root cause. It looks like when we use the –name option, docker will reuse the socket. The final fix was to remove that option (–name)