ERRO[0000] process with PID 87408 unexpectedly ended: exit status 1

Hello,
I am trying to run xk6-browser but it fails with this script:

import { chromium } from 'k6/x/browser';

export default function () {
    const browser = chromium.launch({ headless: false });
    const context = browser.newContext();
    const page = context.newPage();

    page.goto('https://test.k6.io', { waitUntil: 'networkidle' })
        .finally(() => {
            page.close();
            browser.close();
        })
}

Error:

ERRO[0000] process with PID 87408 unexpectedly ended: exit status 1  category=browser elapsed="0 ms" goroutine=88
ERRO[0000] GoError: launching browser: browser process ended unexpectedly
        at reflect.methodValueCall (native)
        at file:///.../k6s/ecommerce.js:4:36(6)
        at native  executor=per-vu-iterations scenario=default source=stacktrace

I installed in ubuntu with :
https://k6.io/docs/javascript-api/xk6-browser/get-started/installation/

Anyidea ?

Hi @slamer59,

Welcome to the forum.

I’m unable to reproduce this. Could you give us some more details:

  1. What Ubuntu version are you running?
  2. Which version of xk6-browser did you download or build? Maybe paste the commands you used.
  3. Does this occur every time you run the test?
  4. What happens if you run the following test:
    import { chromium } from 'k6/x/browser';
    import { sleep } from 'k6';
    
    export default function () {
        const browser = chromium.launch({ headless: false });
        const context = browser.newContext();
        const page = context.newPage();
    
        page.goto('https://test.k6.io', { waitUntil: 'networkidle' })
            .then(() => {
              sleep(2);
            })
            .finally(() => {
                page.close();
                browser.close();
            })
    }
    

Cheers,
Ankur

Hello,
sorry I didn’t get the notification.

  • Ubuntu 22.04.1 LTS
  • xk6-browser : k6 v0.42.0 ((devel), go1.19.4, linux/amd64)
  • k6 v0.42.0 (2022-12-20T09:27:48+0000/v0.42.0-0-ga45ab5a4, go1.19.3, linux/amd64)
  1. Yes it occurs everytime
  2. Your script gives the same error

Hi @slamer59 ,

v0.42.0 is the k6 version. I guess the xk6-browser version must be v0.7.0. Is that correct?

I still can’t reproduce the issue with this setup and your script or the script provided by @ankur . You mentioned that you used this guide for installation, but I understand you downloaded a release binary?

I understand you are running this from your local machine with a working installation of Chrome?