serverless-plugin: ECONNREFUSED
See original GitHub issue@adieuadieu Thanks for starting such an awesome project. I’m trying to follow the README for the project’s serverless plugin, but found that the steps documented did not work for me.
Here’s what I’ve tried.
package.json
{
"name": "serverless-chrome-plugin",
"version": "0.0.1",
"description": "hello, does it work?",
"main": "index.js",
"scripts": {
"deploy": "serverless deploy -v"
},
"author": "",
"license": "ISC",
"dependencies": {
"chrome-remote-interface": "0.24.5"
},
"devDependencies": {
"serverless": "1.21.0",
"serverless-plugin-chrome": "1.0.0-11"
}
}
serverless.yml
service: hello-serverless-chrome-plugin
frameworkVersion: "1.21.0"
provider:
name: aws
runtime: nodejs6.10
region: us-west-2
stage: dev
profile: lithiumdev
plugins:
- serverless-plugin-chrome
functions:
hello:
handler: handler.hello
description: try out this ol' lambda thing
memorySize: 1536
timeout: 60
events:
- http:
path: hello
method: get
handler.js
const CDP = require('chrome-remote-interface')
module.exports.hello = (event, context, callback, chrome) => {
// Chrome is already running!
CDP.Version()
.then((versionInfo) => {
callback(null, {
statusCode: 200,
body: JSON.stringify({
versionInfo,
chrome,
}),
})
})
.catch((error) => {
callback(null, {
statusCode: 500,
body: JSON.stringify({
error,
}),
})
})
}
When I invoke on lambda, I get this response:
{"error":{"code":"ECONNREFUSED","errno":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":9222}}
I’m a bit new to both node and CDP. I was wondering, could you suggest what might be going wrong?
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
node.js - deployment of serverless 1.65.0 returns error ...
Try 1 of 4 Serverless: Recoverable error occurred (connect ECONNREFUSED 127.0.0.1:4567), sleeping for ~7 seconds. Try 2 of 4 Serverless: ...
Read more >Connection to local database refused (testing Go function)
My lambda function written in Golang is not able to connect to the postgres database ... tcp 127.0.0.1:5432: connect: connection refused"}.
Read more >connect ECONNREFUSED 127.0.0.1:27017 - Ops and Admin
I keep getting this error when I launch node app.js. Mongo shell connects, service MongoDB running (win11), me desperate.
Read more >APM Connection Errors - Datadog Docs
If the application with the tracing library cannot reach the Datadog Agent, look for connection errors in the tracer startup logs or tracer...
Read more >Serverless Offline - ECONNREFUSED Elasticmq with Docker ...
Serverless Offline - ECONNREFUSED Elasticmq with Docker-Compose ... Version: 2.17.0 (local) serverless | Plugin Version: 4.4.1 serverless ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi,
I have a similar issue, I am getting: “errorMessage”: “connect ECONNREFUSED 127.0.0.1:9222”, “errorType”: “Error”, “stackTrace”: [ “Object.exports._errnoException (util.js:1018:11)”, “exports._exceptionWithHostPort (util.js:1041:20)”, “TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)” ]
when I try to run chrome on lambda serverless. I deploy from mac.
Thanks!
@carlosbaraza @adieuadieu confirmed … Once I upgraded to serverless 1.21.1, issue was resolved for me. Thanks!