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

with latest chrome, browser is just exiting #1117

Open
jonathanong opened this issue Apr 28, 2017 · 17 comments

Comments

@jonathanong
Copy link

commented Apr 28, 2017

not ok 1 Chrome - error
    ---
        message: >
            Error: Browser exited unexpectedly
            Non-zero exit code: null
            Stderr: 
             [0428/112152.254909:ERROR:resource_bundle.cc(767)] Failed to load /Applications/Google Chrome.app/Contents/Versions/58.0.3029.81/Google Chrome Framework.framework/Versions/A/resources.pak
            Some features may not be available.
            
            
        Log: |
            { type: 'error', text: 'Error: Browser exited unexpectedly' }
            { type: 'error', text: 'Non-zero exit code: null' }
            { type: 'error',
              text: '[0428/112152.254909:ERROR:resource_bundle.cc(767)] Failed to load /Applications/Google Chrome.app/Contents/Versions/58.0.3029.81/Google Chrome Framework.framework/Versions/A/resources.pak\nSome features may not be available.\n' }

anyone have any ideas why this happens?

@kris-luminar

This comment has been minimized.

Copy link

commented May 1, 2017

I'm seeing the same issue when trying to create a screenshot from these instructions https://developers.google.com/web/updates/2017/04/headless-chrome .

$ alias chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"
$ chrome --headless --screenshot --window-size=1280,1696 https://www.chromestatus.com/
[0501/145304.402983:ERROR:resource_bundle.cc(767)] Failed to load /Applications/Google Chrome.app/Contents/Versions/58.0.3029.81/Google Chrome Framework.framework/Versions/A/resources.pak
Some features may not be available.
[0501/145304.442912:WARNING:dns_config_service_posix.cc(154)] dns_config has unhandled options!
[1]    56398 segmentation fault  /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --headless
@monkeym4ster

This comment has been minimized.

Copy link

commented May 2, 2017

I have encountered the same issue.

~ chrome --headless --screenshot https://www.chromestatus.com/

chrome --headless --screenshot https://www.chromestatus.com/

[0502/103542.793416:ERROR:resource_bundle.cc(767)] Failed to load /Applications/Google Chrome.app/Contents/Versions/58.0.3029.81/Google Chrome Framework.framework/Versions/A/resources.pak
Some features may not be available.
[1]    85439 segmentation fault  /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --headless
@dpogue

This comment has been minimized.

Copy link

commented May 2, 2017

--headless is only supported in Chrome 59 and higher on Linux and macOS. Chrome 58 is not supported (although I seem to recall that it works on Linux).

Chrome 59 is currently on the beta channel.

@wi-ski

This comment has been minimized.

Copy link

commented May 10, 2017

Im using this on heroku and experiencing it simply crashing... Is there some issue running with the --headless flag when you lack a sound card??

@dpogue

This comment has been minimized.

Copy link

commented May 10, 2017

You should also specify --disable-gpu according to https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md

@johanneswuerbach

This comment has been minimized.

Copy link
Member

commented May 10, 2017

Seems like a duplicate of #1106

@wi-ski

This comment has been minimized.

Copy link

commented May 10, 2017

I also passed it that flag and it still seg-faults

@joppa27

This comment has been minimized.

Copy link

commented May 27, 2017

seeing a similar error in travis:
https://travis-ci.org/poteto/ember-pipeline/jobs/223030769

Update
@jonathanong
got past that error in travis!! Pretty much just copied the packages installed in this image:
https://github.com/alpeware/chrome-headless-stable/blob/master/Dockerfile#L8

my travis.yml packages now looks like this:
https://github.com/joppa27/ember-pipeline/blob/more-params/.travis.yml#L16-L24

 packages:
      - google-chrome-stable
      - libnss3 
      - libnss3-tools 
      - libfontconfig1 
      - wget 
      - ca-certificates 
      - apt-transport-https 
      - inotify-tools

testem.js has these browser_args:
https://github.com/joppa27/ember-pipeline/blob/more-params/testem.js

  "browser_args": {
    "Chrome": [
      "--headless",
      "--disable-gpu",
      "--remote-debugging-port=9222",
      "--remote-debugging-address=0.0.0.0",
      "--no-sandbox",
      "--user-data-dir=/tmp"
    ]
}

see the passing run in travis here:
https://travis-ci.org/poteto/ember-pipeline/builds/236777062?utm_source=github_status&utm_medium=notification

poteto/ember-pipeline#12

@xdumaine

This comment has been minimized.

Copy link

commented Dec 13, 2017

We are still getting this error with latest testem. Everyone here seems to indicate it's working, but we're still getting the crash when passing those args. Any ideas?

@jbelmont

This comment has been minimized.

Copy link

commented Dec 14, 2017

This is occuring with Chromium version 65, we have the following testem config js file

module.exports = {
    test_page: ['tests/index.html?filter=Acceptance%20|','tests/index.html?filter=!Acceptance%20|'],
    disable_watching: true,
    launchers: {
        chromium: {
            exe: chromium.path,
            args: [
                '--headless',
                '--disable-gpu',
                '--remote-debugging-port=9222',
                '--remote-debugging-address=0.0.0.0',
                '--no-sandbox',
                '--user-data-dir=/tmp/testem-3394',
                '--no-default-browser-check',
                '--no-first-run',
                '--ignore-certificate-errors',
                '--test-type',
                '--disable-renderer-backgrounding',
                '--disable-background-timer-throttling'
            ],
            protocol: 'browser'
        }
    },

    launch_in_ci: [
        'chromium'
    ],
    launch_in_dev: [
        'chromium'
    ],
    browser_args: {
        chromium: [
            '--headless',
            '--disable-gpu',
            '--remote-debugging-port=9222',
            '--remote-debugging-address=0.0.0.0',
            '--no-sandbox',
            '--user-data-dir=/tmp/testem-3394',
            '--no-default-browser-check',
            '--no-first-run',
            '--ignore-certificate-errors',
            '--test-type',
            '--disable-renderer-backgrounding',
            '--disable-background-timer-throttling'
        ]
    },
    reporter: multiReporter
};

One thing to note is that we are running this in Jenkins and I see this error in the Jenkins Log:

Test Failure - error
Error: Browser exited unexpectedly
Non-zero exit code: 1
Stderr:
[1214/034233.949149:ERROR:gpu_process_transport_factory.cc(1067)] Lost UI shared context.

We are using the chromium npm package.

Anybody know why testem would blow up like this. All the tests seem to pass this error stops the build from passing. The script above is a custom launcher for testem

@progand

This comment has been minimized.

Copy link

commented Jan 10, 2018

@joppa27 Thanks! I've changed my testem.js:

"browser_args": {
    "Chrome": [
      "--headless",
      "--disable-gpu",
      "--remote-debugging-port=9222",
      "--remote-debugging-address=0.0.0.0",
      "--no-sandbox",
      "--user-data-dir=/tmp"
    ]
}

and now it works fine

@scottkidder

This comment has been minimized.

Copy link

commented Feb 9, 2018

Anyone still seeing Error: Browser disconnected check here

@searls

This comment has been minimized.

Copy link
Contributor

commented Feb 9, 2018

I'm on testem@2.0.0 and I couldn't get Chrome headless to work locally or on travis until finding @joppa27's post. Since phantomjs is now unmaintained, it seems like a headless guide that incorporates these flags & packages would be really useful in the README/docs. Do folks agree?

@JHKennedy4

This comment has been minimized.

Copy link

commented May 15, 2018

Also crashing with the following output:

DEPRECATION: An addon is trying to access project.nodeModulesPath. This is not a reliable way to discover npm modules. Instead, consider doing: require("resolve").sync(something, { basedir: project.root }). Accessed from:   DependencyVersionChecker.NPMDependencyVersionChecker (/data/app/kochiku-worker/shared/build-partition/sq/invoice-fe/node_modules/ember-try/node_modules/ember-cli-version-checker/src/npm-dependency-version-checker.js:11:32)
Could not start watchman
Visit https://ember-cli.com/user-guide/#watchman for more info.
ember-cli-sentry will not be loaded from bower installation
cleaning up...
Built project successfully. Stored in "/data/app/kochiku-worker/shared/build-partition/sq/invoice-fe/tmp/class-tests_dist-f4XmztuR.tmp".
not ok 1 Chrome - error
    ---
        message: >
            Error: Browser failed to connect within 30s. testem.js not loaded?
            Stderr: 
             [0515/184532.964775:ERROR:gpu_process_transport_factory.cc(1007)] Lost UI shared context.
            
            DevTools listening on ws://127.0.0.1:46394/devtools/browser/f1139e46-5dbf-4b0e-8791-2739c68e27c2
            Fontconfig warning: "/etc/fonts/fonts.conf", line 146: blank doesn't take any effect anymore. please remove it from your fonts.conf
            
            
        Log: |
            { type: 'error',
              text: 'Error: Browser failed to connect within 30s. testem.js not loaded?' }
            { type: 'error',
              text: '[0515/184532.964775:ERROR:gpu_process_transport_factory.cc(1007)] Lost UI shared context.\n\nDevTools listening on ws://127.0.0.1:46394/devtools/browser/f1139e46-5dbf-4b0e-8791-2739c68e27c2\nFontconfig warning: "/etc/fonts/fonts.conf", line 146: blank doesn\'t take any effect anymore. please remove it from your fonts.conf\n' }
    ...

1..1
# tests 1
# pass  0
# skip  0
# fail  1
Testem finished with non-zero exit code. Tests failed.

Using the following flags:

args: [
        "--headless",
        "--disable-gpu",
        "--remote-debugging-port=9222",
        "--remote-debugging-address=0.0.0.0",
        "--no-sandbox",
        "--user-data-dir=/tmp"
      ]
@belgoros

This comment has been minimized.

Copy link

commented Aug 13, 2019

The solution of @progand worked for Chrome Version 76.0.3809.100 (Official Build) (64-bit) on macOS. Thank you!

@mehulkar

This comment has been minimized.

Copy link

commented Aug 14, 2019

I still see this issue, but removing the --disable-software-rasterizer option from Chrome seems to fix the issue.

I went to about:gpu in Chrome (with direct launch of Chrome.app and with the testem launcher) and compared the results and I see that the one with testem is launched like this:

with --disable-software-rasterizer option in testem config

Command Line	/Applications/Google Chrome.app/Contents/MacOS/Google Chrome --user-data-dir=/var/folders/rx/sck1q_1s6q956kjxpny3jv4r0000gn/T/testem-24785410789419-M28j1i --no-default-browser-check --no-first-run --ignore-certificate-errors --test-type --disable-renderer-backgrounding --disable-background-timer-throttling --flag-switches-begin --flag-switches-end http://localhost:7357/24785410789419/tests/index.html?hidepassed&filter=home%20page

normal Chrome launch from Applications:

Command Line	/Applications/Google Chrome.app/Contents/MacOS/Google Chrome --flag-switches-begin --flag-switches-end

This is kind of confusing because that disable option doesn't even seem to be passed to Chrome when launching, but maybe this means something more to someone else?

I'm on 76.0.3809.100 on a 13" macbook pro.

@gorner

This comment has been minimized.

Copy link

commented Aug 15, 2019

Looks like removing the --disable-gpu flag may fix the Chrome v76 issue as well. Unclear whether one or the other is the "more correct" fix. ember-cli/ember-cli#8774

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.