I installed both from git clone and with the master zip, but I get the same results
`> npm install -g serverless
serverless create -u https://github.com/adieuadieu/serverless-chrome/tree/master/examples/serverless-framework/aws
npm run deploy
npm ERR! Linux 4.13.0-32-generic
npm ERR! argv "/home/garym/.nvm/versions/node/v6.11.1/bin/node" "/home/garym/.nvm/versions/node/v6.11.1/bin/npm" "run" "deploy"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! missing script: deploy
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues
npm ERR! Please include the following file with any support request:
npm ERR! .
npm-debug.log
/serverless-chrome-master/npm-debug.log
`
I also tried without the git source, in a fresh empty directory, deploy then complains of no package.json
I've included the log in case it is useful -- I'm trying to deploy on Ubuntu 17.10; I don't have much experience with npm, but I notice the package.json file in the root directory doesn't include a deploy definition (if that's important)
@teledyn Try:
git clone https://github.com/adieuadieu/serverless-chrome.git
cd serverless-chrome/examples/serverless-framework/aws
npm install
npm deploy
Before doing npm deploy make sure you've set up your AWS credentials
thanks for helping out in this, but still no go,
> git clone https://github.com/adieuadieu/serverless-chrome.git
> cd serverless-chrome/examples/serverless-framework/aws/
> npm install
no issues reported here except ..
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
set | grep AWS confirms that my credentials are available but npm deploy responds to say 'deploy' is invalid:
Usage: npm <command>
where <command> is one of:
access, adduser, bin, bugs, c, cache, completion, config,
ddp, dedupe, deprecate, dist-tag, docs, edit, explore, get,
help, help-search, i, init, install, install-test, it, link,
list, ln, login, logout, ls, outdated, owner, pack, ping,
prefix, prune, publish, rb, rebuild, repo, restart, root,
run, run-script, s, se, search, set, shrinkwrap, star,
stars, start, stop, t, tag, team, test, tst, un, uninstall,
unpublish, unstar, up, update, v, version, view, whoami
npm <cmd> -h quick help on <cmd>
npm -l display full usage info
npm help <term> search for help on <term>
npm help npm involved overview
Specify configs in the ini-formatted file:
/home/garym/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
[email protected] /home/garym/.nvm/versions/node/v6.11.1/lib/node_modules/npm
I was however, able to run
serverless deploy -v
which I found in the package.json file, and this gives me the urls to call but when I call them I get a internal server error, nonetheless I get something which means there's something going on and gives me a puzzle to solve tomorrow :)
making progress with the API call, but still getting connect ECONNREFUSED 127.0.0.1:9222 for screenshot -- this implies either headless chrome isn't running or just that the security settings do not permit the connection? On the other hand, the API test on /pdf returns a block of data, presumably the pdf image...
oh wait, just learned how to read lambda logs! Seems it is just a matter of headless-chrome roulette ...
19:52:41
REPORT RequestId: 9e200934-0852-11e8-b90f-d14d5212ebd4 Duration: 5016.26 ms Billed Duration: 5100 ms Memory Size: 1536 MB Max Memory Used: 1082 MB
19:54:06
START RequestId: d3b97fa8-0852-11e8-ab74-d1aaa6d90e6c Version: $LATEST
19:54:06
2018-02-02T19:54:06.742Z d3b97fa8-0852-11e8-ab74-d1aaa6d90e6c @serverless-chrome/lambda: Spawning headless shell
19:54:06
2018-02-02T19:54:06.743Z d3b97fa8-0852-11e8-ab74-d1aaa6d90e6c @serverless-chrome/lambda: ChromeLauncher No debugging port found on port 9222, launching a new Chrome.
19:54:06
2018-02-02T19:54:06.743Z d3b97fa8-0852-11e8-ab74-d1aaa6d90e6c @serverless-chrome/lambda: Chrome already running with pid 12.
19:54:06
2018-02-02T19:54:06.743Z d3b97fa8-0852-11e8-ab74-d1aaa6d90e6c @serverless-chrome/lambda: Waiting for Chrome 0
19:54:07
2018-02-02T19:54:07.259Z d3b97fa8-0852-11e8-ab74-d1aaa6d90e6c @serverless-chrome/lambda: Waiting for Chrome 1
...
19:54:11
2018-02-02T19:54:11.771Z d3b97fa8-0852-11e8-ab74-d1aaa6d90e6c @serverless-chrome/lambda: Waiting for Chrome 10
19:54:11
2018-02-02T19:54:11.771Z d3b97fa8-0852-11e8-ab74-d1aaa6d90e6c @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', sysca
19:54:11
2018-02-02T19:54:11.772Z d3b97fa8-0852-11e8-ab74-d1aaa6d90e6c @serverless-chrome/lambda: stdout log:
19:54:11
2018-02-02T19:54:11.772Z d3b97fa8-0852-11e8-ab74-d1aaa6d90e6c @serverless-chrome/lambda: stderr log: [0202/191759.133565:WARNING:resource_bundle.cc(368)] locale_file_path.empty() for locale prctl(PR_SET_NO_NEW_PRIVS) failed [0202/191759.242028:ERROR:instance.cc(49)] Unable to locate service manifest for metrics [0202/191759.242052:ERROR:service_manager.cc(890)] Failed to resolve service name: met
19:54:11
=2&lm=0&ln=1&r=0&em=0&en=0&d=55071969%3A290429649%3A588294249%3A120091287849&qs=1&zGSRC=1&gu=https%3A%2F%2Fwww.cnet.com%2F&bo=4
19:54:11
2018-02-02T19:54:11.772Z d3b97fa8-0852-11e8-ab74-d1aaa6d90e6c Error occured in serverless-plugin-chrome wrapper when trying to ensure Chrome for default() handler. { flags: [ '--window-size=1280x1696', '--hide-scrollbars' ], chromePath: '/var/task/headless-chromium' } Error: Unable to start Chrome. If you have the DEBUG env variable set,there will be more in the logs. at /var/task/src/handle
19:54:11
END RequestId: d3b97fa8-0852-11e8-ab74-d1aaa6d90e6c
@teledyn I have the same error
I'm having basically the same issue ... it seems to be unreliable.
START RequestId: bac334e1-147e-11e8-b318-cb1f0ca291c9 Version: $LATEST
2018-02-18T07:38:36.688Z bac334e1-147e-11e8-b318-cb1f0ca291c9 @serverless-chrome/lambda: Spawning headless shell
2018-02-18T07:38:36.690Z bac334e1-147e-11e8-b318-cb1f0ca291c9 @serverless-chrome/lambda: ChromeLauncher No debugging port found on port 9222, launching a new Chrome.
2018-02-18T07:38:36.690Z bac334e1-147e-11e8-b318-cb1f0ca291c9 @serverless-chrome/lambda: Chrome already running with pid 12.
2018-02-18T07:38:36.690Z bac334e1-147e-11e8-b318-cb1f0ca291c9 @serverless-chrome/lambda: Waiting for Chrome 0
2018-02-18T07:38:37.191Z bac334e1-147e-11e8-b318-cb1f0ca291c9 @serverless-chrome/lambda: Waiting for Chrome 1
2018-02-18T07:38:37.692Z bac334e1-147e-11e8-b318-cb1f0ca291c9 @serverless-chrome/lambda: Waiting for Chrome 2
2018-02-18T07:38:38.193Z bac334e1-147e-11e8-b318-cb1f0ca291c9 @serverless-chrome/lambda: Waiting for Chrome 3
2018-02-18T07:38:38.695Z bac334e1-147e-11e8-b318-cb1f0ca291c9 @serverless-chrome/lambda: Waiting for Chrome 4
2018-02-18T07:38:39.200Z bac334e1-147e-11e8-b318-cb1f0ca291c9 @serverless-chrome/lambda: Waiting for Chrome 5
2018-02-18T07:38:39.710Z bac334e1-147e-11e8-b318-cb1f0ca291c9 @serverless-chrome/lambda: Waiting for Chrome 6
2018-02-18T07:38:40.212Z bac334e1-147e-11e8-b318-cb1f0ca291c9 @serverless-chrome/lambda: Waiting for Chrome 7
2018-02-18T07:38:40.712Z bac334e1-147e-11e8-b318-cb1f0ca291c9 @serverless-chrome/lambda: Waiting for Chrome 8
2018-02-18T07:38:41.215Z bac334e1-147e-11e8-b318-cb1f0ca291c9 @serverless-chrome/lambda: Waiting for Chrome 9
2018-02-18T07:38:41.716Z bac334e1-147e-11e8-b318-cb1f0ca291c9 @serverless-chrome/lambda: Waiting for Chrome 10
2018-02-18T07:38:41.718Z bac334e1-147e-11e8-b318-cb1f0ca291c9 @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 }
2018-02-18T07:38:41.718Z bac334e1-147e-11e8-b318-cb1f0ca291c9 @serverless-chrome/lambda: stdout log:
2018-02-18T07:38:41.718Z bac334e1-147e-11e8-b318-cb1f0ca291c9 @serverless-chrome/lambda: stderr log: [0218/071352.367214:WARNING:resource_bundle.cc(368)] locale_file_path.empty() for locale
prctl(PR_SET_NO_NEW_PRIVS) failed
[0218/071352.474787:ERROR:instance.cc(49)] Unable to locate service manifest for metrics
[0218/071352.474836:ERROR:service_manager.cc(890)] Failed to resolve service name: metrics
[0218/071352.477853:ERROR:gpu_process_transport_factory.cc(1009)] Lost UI shared context.
DevTools listening on ws://127.0.0.1:9222/devtools/browser/68795c78-121a-4324-9e73-e79706b5147d
[0218/071352.509565:VERBOSE1:webrtc_internals.cc(109)] Could not get the download directory.
Fontconfig warning: "/etc/fonts/conf.d/30-metric-aliases.conf", line 84: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/30-metric-aliases.conf", line 84: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/30-metric-aliases.conf", line 93: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/30-metric-aliases.conf", line 93: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/30-metric-aliases.conf", line 102: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/30-metric-aliases.conf", line 102: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 33: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 33: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 33: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 33: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 33: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 33: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 33: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 33: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 33: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 33: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 33: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 33: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 33: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 33: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 33: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 33: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 33: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 33: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 59: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 59: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 59: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 59: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 59: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 59: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 59: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 59: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 59: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 59: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 59: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 59: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 59: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 59: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 59: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 59: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 59: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 59: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 59: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 68: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 68: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 79: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 79: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 79: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 88: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 23: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 23: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 23: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 23: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 23: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 23: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 23: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 23: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 39: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 39: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 39: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 39: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 39: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 39: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 39: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 39: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 39: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 56: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 56: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 56: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 56: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 56: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 56: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 56: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 56: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 56: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 56: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 66: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 66: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 66: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 75: Having multiple <family> in <alias> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 75: Having multiple <family> in <alias> isn't supported and may not work as expected
[0218/073422.178981:WARNING:sandbox_ipc_linux.cc(121)] poll: Operation not permitted (1)
[0218/073422.313663:WARNING:histograms.cc(40)] Started multiple compositor clients (Browser, Renderer) in one process. Some metrics will be disabled.
[0218/073422.315390:INFO:child_thread_impl.cc(802)] ChildThreadImpl::EnsureConnected()
2018-02-18T07:38:41.718Z bac334e1-147e-11e8-b318-cb1f0ca291c9 Error occured in serverless-plugin-chrome wrapper when trying to ensure Chrome for default() handler. { flags: [ '--window-size=1280x1696', '--hide-scrollbars' ],
chromePath: '/var/task/headless-chromium' } Error: Unable to start Chrome. If you have the DEBUG env variable set,there will be more in the logs.
at /var/task/src/handlers/pdf.js:3407:13
at throw (native)
at step (/var/task/src/handlers/pdf.js:3341:191)
at /var/task/src/handlers/pdf.js:3341:402
at process._tickDomainCallback (internal/process/next_tick.js:135:7)
END RequestId: bac334e1-147e-11e8-b318-cb1f0ca291c9
Has anyone had this problem and resolved it somehow ?
Ping, same issue here
Possible duplicate of #89
Since you're getting this on AWS try installing serverless-webpack 4.2.0 or higher. Apparently that fixed the problem on AWS here
Most helpful comment
I'm having basically the same issue ... it seems to be unreliable.
Has anyone had this problem and resolved it somehow ?