Skip to content
This repository was archived by the owner on Mar 14, 2020. It is now read-only.
This repository was archived by the owner on Mar 14, 2020. It is now read-only.

Errror: ECONNREFUSED #36

Open
Open

Description

@justin22

This is similar to #30, but even with the latest version, getting the following error.

"errorType": "Error",
    "errorMessage": "connect ECONNREFUSED 127.0.0.1:41901",
    "code": "ECONNREFUSED",
    "errno": "ECONNREFUSED",
    "syscall": "connect",
    "address": "127.0.0.1",
    "port": 41901,
    "stack": [
        "Error: connect ECONNREFUSED 127.0.0.1:41901",
        "    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1128:14)"
    ]

Any idea what could be wrong?

lighthouse-lambda: 3.1.1

code is basically the started template from the readme file

Activity

  1. trevsewell commented on Dec 8, 2019

    @trevsewell

    I'm getting the same thing with 3.1.1

  2. kevsersrca commented on Dec 13, 2019

    @kevsersrca

    Same as my error, getting runtime lambda nodejs 10.x and 12.x . but working runtime nodejs8.10

  3. brandysnaps commented on Dec 18, 2019

    @brandysnaps

    I'm seeing the same issue. Working fine for 8.10 but not 10.x or 12.x.

  4. dordax commented on Jan 17, 2020

    @dordax

    I've made a quick workaround using this lib instead @serverless-chromium: https://github.com/alixaxel/chrome-aws-lambda.

    Works with 10.x and 12.x.

    npm install chrome-aws-lambda --save-prod

    In https://github.com/joytocode/lighthouse-lambda/blob/master/lib/index.js:

    const chromium = require('chrome-aws-lambda')
    const chromeLauncher = require('chrome-launcher')
    const lighthouse = require('lighthouse')
    
    const defaultFlags = [
      '--headless',
      '--disable-dev-shm-usage',
      '--disable-gpu',
      '--no-zygote',
      '--no-sandbox',
      '--single-process',
      '--hide-scrollbars'
    ]
    
    module.exports = async function createLighthouse (url, options = {}, config) {
      options.output = options.output || 'html'
      const log = options.logLevel ? require('lighthouse-logger') : null
      if (log) {
        log.setLevel(options.logLevel)
      }
      const chromeFlags = options.chromeFlags || defaultFlags
      return chromeLauncher.launch({ chromeFlags, chromePath: await chromium.executablePath })
        .then((chrome) => {
          options.port = chrome.port
          return {
            chrome,
            log,
            start () {
              return lighthouse(url, options, config)
            }
          }
        })
    }
    
  5. AlanSwenson commented on Jan 31, 2020

    @AlanSwenson

    @dordax this workaround 'almost' works for me but now I get a bunch of warn Caught exception: NO_TRACING_STARTED for each type of audit and the final report is just filled with errors instead of the data. My lambda works fine on 8.10 but just wanted to upgrade to keep with the times. Anything you changed in your handler function to go from 8.10 -> 12?

  6. AlanSwenson commented on Jan 31, 2020

    @AlanSwenson

    if anyone else runs into this issue trying to use node 12, I did what @dordax did but I needed to remove '--single-process' to get the performance tests on lighthouse to stop returning errors

  7. smcelhinney commented on Feb 26, 2020

    @smcelhinney

    Well consider 8.10 is now in maintenance (https://nodejs.org/en/about/releases/) this should probably be updated. I have a fork Im working on, if it works for me I'll open a PR.

  8. AlanSwenson commented on Feb 28, 2020

    @AlanSwenson

    @smcelhinney did you get it working?
    I forked it a few weeks ago and changed a lot of things and got it working on node 12 on the local docker AWS instance but could never get it going on the actual lambda.

  9. smcelhinney commented on Feb 28, 2020

    @smcelhinney

    I gave up on Lambda and moved my code to Google Cloud Run and Pub Sub topics :)

  10. AlanSwenson commented on Mar 12, 2020

    @AlanSwenson

    I finally have a working solution in #37

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions