GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Exit code is null when using headless chrome · Issue #16399 · nodejs/node

Exit code is null when using headless chrome #16399

New issue
Copy link
New issue
Copy link
Closed
Closed
Exit code is null when using headless chrome#16399
Copy link
Labels
questionIssues asking questions about Node.js.wrong repoIssues that should be opened in another repository.

Description

@ORESoftware
ORESoftware
opened on Oct 23, 2017
Issue body actions
  • Node v6
  • Darwin

I am getting a null exit code after launching and killing a child process. This probably should never happen? It's happening when I launch chrome in headless mode:

When using the 'chrome-launcher' module, everything works normally:

 const cl = require('chrome-launcher');
  cl.launch({
        startingUrl: `http://localhost:${port}/suman_testing?data=${testData}`,
        chromeFlags: []
      })
      .then(c => {

        // c.launcher.chrome is a child process instance
         c.launcher.chrome.once('exit', function(code){
          // exit code is an integer
        });

      });

but when I use headless mode:

 const cl = require('chrome-launcher');
  cl.launch({
        startingUrl: `http://localhost:${port}/suman_testing?data=${testData}`,
        chromeFlags: ['--headless']  // <<< use headless mode <<<
      })
      .then(c => {
         c.launcher.chrome.once('exit', function(code){
          // exit code is null !! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
        });
      });

is this expected? I am assuming this should never happen.

Activity

  1. ORESoftware commented on Oct 23, 2017

    @ORESoftware
    ORESoftware
    on Oct 23, 2017
    ContributorAuthor
    More actions

    I am killing chrome with a SIGINT in both cases
    not sure why, but in "headed" mode, I get:

    exit message => { code: 0, signal: null }

    but in headless mode, I get:

    exit message => { code: null, signal: 'SIGINT' }

    so I guess it exits with a null code if there is a SIGINT?

  2. mscdex commented on Oct 23, 2017

    @mscdex
    mscdex
    on Oct 23, 2017
    Contributor
    More actions

    I think you posted this to the wrong repo?

  3. mscdex
    added
    questionIssues asking questions about Node.js.
    wrong repoIssues that should be opened in another repository.
    on Oct 23, 2017
  4. ORESoftware commented on Oct 23, 2017

    @ORESoftware
    ORESoftware
    on Oct 23, 2017
    ContributorAuthor
    More actions

    oh damn...happen to know why a child process would ever exit with a null code?

  5. bnoordhuis commented on Oct 23, 2017

    @bnoordhuis
    bnoordhuis
    on Oct 23, 2017
    Member
    More actions

    When it's terminated by a signal. I'm guessing headless Chrome doesn't install a SIGINT handler.

  6. bnoordhuis
    closed this as completedon Oct 23, 2017
  7. ORESoftware commented on Oct 23, 2017

    @ORESoftware
    ORESoftware
    on Oct 23, 2017
    ContributorAuthor
    More actions

    ok thanks, sorry false alarm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionIssues asking questions about Node.js.wrong repoIssues that should be opened in another repository.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.