This repository was archived by the owner on Nov 24, 2018. It is now read-only.
This repository was archived by the owner on Nov 24, 2018. It is now read-only.
Open
Description
Hello, I just deployed the proxy lambda. I am getting two variations of ECONNREFUSED 127.0.0.1:9222
Worth noting this is not a reliability issue (as in 1 of every X requests errors out), I have not been able to get a single successful request.
My code is simply setting the HTML content and then getting a PDF. However, I also tried just fetching a URL and getting a PDF.
await chromeless.setHtml(processedHtml).pdf()
The first request errors out like so:
NOTE: I've cleaned up the logs from Cloudwatch a little bit (removing request IDs and timestamps)
START RequestId: Version: $LATEST
@serverless-chrome/lambda: Spawning headless shell
@serverless-chrome/lambda: ChromeLauncher No debugging port found on port 9222, launching a new Chrome.
@serverless-chrome/lambda: Launcher Chrome running with pid 12 on port 9222.
@serverless-chrome/lambda: Waiting for Chrome 0
@serverless-chrome/lambda: Waiting for Chrome 1
@serverless-chrome/lambda: Started Chrome
@serverless-chrome/lambda: It took 526ms to spawn chrome.
Invoked with data: cjfcv2jwf000001p8ldqmprfu
{
"debug": false,
"waitTimeout": 10000,
"remote": {
"endpointUrl": "https://XXXXXXXX.execute-api.us-east-1.amazonaws.com/dev",
"apiKey": "<MY_API_KEY>"
},
"implicitWait": true,
"scrollBeforeClick": false,
"launchChrome": true,
"viewport": {
"scale": 1
},
"cdp": {
"host": "localhost",
"port": 9222,
"secure": false,
"closeTab": true
}
}
Connected to AWS IoT broker
Subscribed to chrome/cjfcv2jwf000001p8ldqmprfu/request
Message from chrome/cjfcv2jwf000001p8ldqmprfu/request
{
"type": "setHtml",
"html": "<!DOCTYPE html>\n<html>\n...</html>\n"
}
Chrome result undefined
Message from chrome/cjfcv2jwf000001p8ldqmprfu/request
{
"type": "returnPdf"
}
Message from chrome/cjfcv2jwf000001p8ldqmprfu/end
{
"channelId": "cjfcv2jwf000001p8ldqmprfu",
"client": true,
"disconnected": true
}
Client disconnected.
Ended successfully.
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: connect ECONNREFUSED 127.0.0.1:9222
END RequestId:
Subsequent requests seem to error out like so
START RequestId: Version: $LATEST
@serverless-chrome/lambda: Spawning headless shell
@serverless-chrome/lambda: ChromeLauncher No debugging port found on port 9222, launching a new Chrome.
@serverless-chrome/lambda: Chrome already running with pid 12.
@serverless-chrome/lambda: Waiting for Chrome 0
@serverless-chrome/lambda: Waiting for Chrome 1
@serverless-chrome/lambda: Waiting for Chrome 2
@serverless-chrome/lambda: Waiting for Chrome 3
@serverless-chrome/lambda: Waiting for Chrome 4
@serverless-chrome/lambda: Waiting for Chrome 5
@serverless-chrome/lambda: Waiting for Chrome 6
@serverless-chrome/lambda: Waiting for Chrome 7
@serverless-chrome/lambda: Waiting for Chrome 8
@serverless-chrome/lambda: Waiting for Chrome 9
@serverless-chrome/lambda: Waiting for Chrome 10
@serverless-chrome/lambda: Error trying to spawn chrome: { Error: connect ECONNREFUSED 127.0.0.1:9222
at Object.exports._errnoException (util.js:1018:11)
at exports._exceptionWithHostPort (util.js:1041:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 9222 }
Metadata
Metadata
Assignees
Labels
No labels