question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Firefox 68.x won't run (from inside docker)

See original GitHub issue

I’ve used FirefoxHeadless inside docker just fine for a long time - but with v68 of ffox it just won’t work.

19:02:46 09 08 2019 17:02:44.991:INFO [launcher]: Starting browser FirefoxHeadless
19:03:54 09 08 2019 17:03:45.123:WARN [launcher]: FirefoxHeadless have not captured in 60000 ms, killing.
19:03:54 09 08 2019 17:03:45.598:INFO [launcher]: Trying to start FirefoxHeadless again (1/2).
19:04:54 09 08 2019 17:04:45.602:WARN [launcher]: FirefoxHeadless have not captured in 60000 ms, killing.
19:04:54 09 08 2019 17:04:45.724:INFO [launcher]: Trying to start FirefoxHeadless again (2/2).
19:05:50 09 08 2019 17:05:45.855:WARN [launcher]: FirefoxHeadless have not captured in 60000 ms, killing.
19:05:50 09 08 2019 17:05:47.109:ERROR [launcher]: FirefoxHeadless failed 2 times (timeout). Giving up.

Karma config:

// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html

//https://hackernoon.com/running-karma-tests-with-headless-chrome-inside-docker-ae4aceb06ed3
const isDocker = require('is-docker')();


module.exports = function (config) {
  config.set({
    concurrency: 1, // avoid clash when ffox and chrome run at the same time
    customLaunchers: {
      ChromeCustom: {
        base: 'ChromeHeadless',
        // We must disable the Chrome sandbox when running Chrome inside Docker (Chrome's sandbox needs
        // more permissions than Docker allows by default)
        flags: isDocker ? ['--no-sandbox'] : []
      }
    },
    basePath: '',
    frameworks: ['jasmine', '@angular-devkit/build-angular'],
    plugins: [
      require('karma-jasmine'),
      require('karma-coverage'),
      require('karma-coverage-istanbul-reporter'),
      require('karma-chrome-launcher'),
      require('karma-firefox-launcher'),
      require('karma-junit-reporter'),
      //require('karma-remap-istanbul'),
      require('@angular-devkit/build-angular/plugins/karma')
    ],
    files: [
    ],
    preprocessors: {
      './src/app/**/*.ts': ['coverage']
    },
    coverageReporter: {
      type:'lcov',
      dir:'target/coverage'
    },
    mime: {
      'text/x-typescript': ['ts','tsx']
    },
    angularCli: {
      config: './angular-cli.json',
      environment: 'dev'
    },
    reporters: config.angularCli && config.angularCli.codeCoverage
              ? ['progress', 'junit','coverage-istanbul','coverage']
              : ['progress', 'junit'],
    junitReporter: {
      outputDir: 'target/junit-reports'
      //outputDir: 'target/junit-dir: require('path').join(__dirname, 'coverage'), reports'
    },
    port: 9876,
    colors: true,
    autoWatch: true,
    browsers: ['FirefoxHeadless','ChromeCustom'],
    singleRun: false
  });
};

Image I am using: https://hub.docker.com/r/evryfs/node-dev-docker/ (node12 tag)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:49

github_iconTop GitHub Comments

5reactions
lazkacommented, Apr 6, 2020

Facing the same problem with gitlab-ci using firefox-esr 68 from debian buster.

Setting MOZ_FORCE_DISABLE_E10S=true made things work again.

2reactions
birtlescommented, Aug 19, 2019

I am also seeing this:

16 08 2019 08:01:24.483:INFO [launcher]: Starting browser FirefoxHeadless

16 08 2019 08:04:51.187:ERROR [launcher]: Cannot start FirefoxHeadless

	*** You are running in headless mode.

[Parent 134, Gecko_IOThread] WARNING: pipe error: Broken pipe: file /builds/worker/workspace/build/src/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 727

Oh, that’s super helpful. So know we now that at least it is finding the binary.

Digging into related issues, this seems really promising:

Specifically, it points to problems with shared memory affecting firefox running in docker containers and includes:

Why did this happen in the move from FF 67 to FF 68? Because I did disable SHM usage in FF by disabling E10s using user_pref(“browser.tabs.remote.autostart”, false);, but as this bug (https://bugzilla.mozilla.org/show_bug.cgi?id=1548941) says, support for this flag was removed in FF 68.

karma-firefox-launcher likewise includes user_pref("browser.tabs.remote.autostart", false) (and user_pref("browser.tabs.remote.autostart.2", false)).

The solution seems to be running docker with --shm-size 2g or mounting -v /dev/shm:/dev/shm.

See:

Ultimately, though it seems like this is tracked by:

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firefox hangs with Xephyr, both running inside an LXC ...
X11-unix is bind-mounted inside the container in read-only, so the Xephyr running inside the container cannot create its socket there.
Read more >
Reproducing the Linux builds of Firefox 68 - glandium.org
The command output will give you a docker run -ti ... command to try. Run it. It will open a shell in the...
Read more >
Full Ubuntu GUI in a Container Displayed on Windows (XServer)
Run Ubuntu Desktop Environment in a Docker Container and Display on Windows.---00:00 Introduction00:34 XServer on Windows00:52 Build Lubuntu ...
Read more >
Headless firefox docker - cittafamiglia.it
This is a headless Firefox image, with Splinter running. ... Firefox 68 headless is not working inside docker containers x won t run...
Read more >
Firefox/Tweaks - ArchWiki - Arch Linux
Set image.mem.max_decoded_image_kb to at least 512K. Now scrolling should flow smoothly. Run Firefox inside an nspawn container. See systemd- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found