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

Problems running chimpy on Gitlab Error: unknown error: Chrome failed to start: exited abnormally #131

Closed
thebarty opened this issue Sep 15, 2018 · 6 comments

Comments

@thebarty
Copy link

thebarty commented Sep 15, 2018

Hi guys,

this one is causing me a lot of headache right now and I really need some help. :-O

I am trying to run Chimpy on Gitlab (CE self-hosted) and I always end up with this error:

[chimp] Running...
RUNNING CHIMP AT URL http://localhost:3000

[chimp][helper] setupBrowserAndDDP had error
{ Error: unknown error: Chrome failed to start: exited abnormally
    at initBrowser (/usr/lib/node_modules/chimpy/dist/lib/chimp-helper.js:189:43)
    at Object.setupBrowserAndDDP (/usr/lib/node_modules/chimpy/dist/lib/chimp-helper.js:264:7)
    at Context.<anonymous> (/usr/lib/node_modules/chimpy/dist/lib/mocha/mocha-helper.js:13:15)
    at /usr/lib/node_modules/chimpy/dist/lib/utils/fiberize.js:29:22
    (unknown error: DevToolsActivePort file doesn't exist)
    (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
    (Driver info: chromedriver=2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706),platform=Linux 4.4.0-131-generic x86_64)
    at new RuntimeError (/usr/lib/node_modules/chimpy/node_modules/webdriverio/build/lib/utils/ErrorHandler.js:143:12)
    at Request._callback (/usr/lib/node_modules/chimpy/node_modules/webdriverio/build/lib/utils/RequestHandler.js:316:39)
    at Request.self.callback (/usr/lib/node_modules/chimpy/node_modules/request/request.js:185:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (/usr/lib/node_modules/chimpy/node_modules/request/request.js:1161:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at IncomingMessage.<anonymous> (/usr/lib/node_modules/chimpy/node_modules/request/request.js:1083:12)
    at IncomingMessage.g (events.js:292:16)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickDomainCallback (internal/process/next_tick.js:128:9)
  details: undefined,
  message: 'unknown error: Chrome failed to start: exited abnormally\n  (unknown error: DevToolsActivePort file doesn\'t exist)\n  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)\n  (Driver info: chromedriver=2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706),platform=Linux 4.4.0-131-generic x86_64)',
  type: 'RuntimeError',
  seleniumStack: 
   { type: 'UnknownError',
     message: 'An unknown server-side error occurred while processing the command.',
     orgStatusMessage: 'unknown error: Chrome failed to start: exited abnormally\n  (unknown error: DevToolsActivePort file doesn\'t exist)\n  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)\n  (Driver info: chromedriver=2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706),platform=Linux 4.4.0-131-generic x86_64)' } }
Error: unknown error: Chrome failed to start: exited abnormally
    at initBrowser (/usr/lib/node_modules/chimpy/dist/lib/chimp-helper.js:189:43)
    at Object.setupBrowserAndDDP (/usr/lib/node_modules/chimpy/dist/lib/chimp-helper.js:264:7)
    at Context.<anonymous> (/usr/lib/node_modules/chimpy/dist/lib/mocha/mocha-helper.js:13:15)
    at /usr/lib/node_modules/chimpy/dist/lib/utils/fiberize.js:29:22
    (unknown error: DevToolsActivePort file doesn't exist)
    (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
    (Driver info: chromedriver=2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706),platform=Linux 4.4.0-131-generic x86_64)
    at new RuntimeError (/usr/lib/node_modules/chimpy/node_modules/webdriverio/build/lib/utils/ErrorHandler.js:143:12)
    at Request._callback (/usr/lib/node_modules/chimpy/node_modules/webdriverio/build/lib/utils/RequestHandler.js:316:39)
    at Request.self.callback (/usr/lib/node_modules/chimpy/node_modules/request/request.js:185:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (/usr/lib/node_modules/chimpy/node_modules/request/request.js:1161:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at IncomingMessage.<anonymous> (/usr/lib/node_modules/chimpy/node_modules/request/request.js:1083:12)
    at IncomingMessage.g (events.js:292:16)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickDomainCallback (internal/process/next_tick.js:128:9)
Mocha failed
Chimp CI exited with code 2

I am using the docker-image "blurri/meteor-node" (see https://hub.docker.com/r/blurri/meteor-node/~/dockerfile/)

Those are the package-versions I am using

chimpy -version; node --version; npm --version; java -version; meteor --version; google-chrome --version;
0.54.0
v6.11.3
3.10.10
java version "1.8.0_144"
Meteor 1.4.4.1
Google Chrome 69.0.3497.92 

This is the way I call chimpy

node chimpy.js;

chimpy.js script

#!/usr/bin/env node
"use strict";
var path = require('path');
var extend = require('util')._extend;
var baseDir = path.resolve(__dirname, '../');
console.log('baseDir', baseDir)
var srcDir = path.resolve(`${baseDir}/src`);
var source = require(srcDir + '/node_modules/shell-source');
var processes = require('./processes.js');

var startTestApp = function(onStarted, options) {
  return processes.start({
    name: 'Test App',
    command: 'meteor test --full-app --driver-package tmeasday:acceptance-test-driver --port 3000 --allow-superuser',
    waitForMessage: 'App running at: http://localhost:3000',
    options: {
      cwd: srcDir,
      env: extend(process.env, options)
    }
  }, function() {
    console.log("Meteor is running ...");
    onStarted();
  });
};

var startChimpCi = function() {
  const command = 'chimpy ./tests/_chimp_config.js --ddp=http://localhost:3000 --path=tests --mocha'
  processes.start({
    name: 'Chimp CI',
    command: command,
    options: { cwd: srcDir },
  });
};

startTestApp(startChimpCi)

Any ideas what else to try?

@lucetius
Copy link
Member

It looks like Chrome problem. Can you paste ./tests/_chimp_config.js file?

@thebarty
Copy link
Author

@lucetius Thanks a lot for your help, man! I really appreciate it…

This is my ./tests/_chimp_config.js.

Do you need any more infos?

/**
 * Settings that are used in CircleCi to adapt Chimps behaviour.
 * For further possible settings look at the file
 *  https://github.com/xolvio/chimp/blob/master/src/bin/default.js
 */
module.exports = {
  // - - - - MOCHA  - - - -
  mochaCommandLineOptions: ['--color'],
  mochaConfig: {
    tags: '@pass1, @pass2, @pass3, @pass4, @pass5',  // tags and grep only work when watch mode is false
    grep: null,
    timeout: 120000,  // 2 minutes
    // reporter: 'spec',  // default only to console (WORKS, but does NOT output CircleCi-compatible data)
    reporter: 'mocha-circleci-reporter',  // default for CircleCi https://www.npmjs.com/package/mocha-circleci-reporter
    slow: 10000,
  },

  // - - - - WEBDRIVER-IO  - - - -
  webdriverio: {
    waitforTimeout: 10000, // time to wait until element appears.
                           // => p.e. for modals to appear, so make it quite long
                           // => default is 500
    waitforInterval: 250,  // KEEP SMALL (!!!) this is the INTERVAL in which waitFor* is looped for checks
  },

  // - - - - DEBUGGING  - - - -
  // log: 'info',
  // debug: true,
}

@lucetius
Copy link
Member

Try to change webdriverio section to:

  // - - - - WEBDRIVER-IO  - - - -
  webdriverio: {
    desiredCapabilities: {
      browserName: 'chrome',
      chromeOptions: { args: ['--no-sandbox', '--headless'] },
    },
    waitforTimeout: 10000, // time to wait until element appears.
                           // => p.e. for modals to appear, so make it quite long
                           // => default is 500
    waitforInterval: 250,  // KEEP SMALL (!!!) this is the INTERVAL in which waitFor* is looped for checks
  },

in your ./tests/_chimp_config.js

@thebarty
Copy link
Author

YES! This one did the trick!!!!

The next issue just came up - chimp does NOT run all my tests. But it's my first iteration on CI and I'll try to figure it out… thanks for your help again!

@thebarty
Copy link
Author

thebarty commented Sep 19, 2018

@lucetius I am seeing those errors in my tests. For some reasons chimpy does not seem to be able to connect to meteor. PLUS after only a few tests it exits.

Can you guide me to a best-practise example on how to setup chimpy with meteor on ci?

                 *   waiting for element to exist "div#__blaze-root"
stdout:                  *   waiting for element to exist "div#__blaze-root"
stderr: Unhandled rejection Error: connect ECONNREFUSED 127.0.0.1:3000
    at Object.exports._errnoException (util.js:1020:11)
    at exports._exceptionWithHostPort (util.js:1043:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)

@thebarty thebarty reopened this Sep 19, 2018
@thebarty
Copy link
Author

I've got it!

It was maxBuffer set too small when executing via child_process.exec().

See
meteor/todos#273
meteor/todos#274

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