flightplan-tool / flightplan

Search for award inventory using Node.js and Headless Chrome!
Apache License 2.0
142 stars 41 forks source link

Failef to launch chrome with ubuntu 16.04 #2

Closed mm7mm7mm7 closed 6 years ago

mm7mm7mm7 commented 6 years ago

what happen ?

root@hhi-VirtualBox:~/flightpaln# flightplan search Airline website to search (2-letter code)? CX Departure city (3-letter code)? SFO Arrival city (3-letter code)? HKG Desired cabin class (first/business/premium/economy)? first Start date of search range (YYYY-MM-DD)? 2019-03-02 End date of search range (YYYY-MM-DD)? 2019-03-06 Searching 5 days of award inventory: 03/02/2019 - 03/06/2019

Error: Failed to launch chrome! [9259:9259:0713/021928.407785:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.

TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

at onClose (/usr/local/share/.config/yarn/global/node_modules/puppeteer/lib/Launcher.js:285:14)
at Interface.helper.addEventListener (/usr/local/share/.config/yarn/global/node_modules/puppeteer/lib/Launcher.js:274:50)
at emitNone (events.js:111:20)
at Interface.emit (events.js:208:7)
at Interface.close (readline.js:368:8)
at Socket.onend (readline.js:147:10)
at emitNone (events.js:111:20)
at Socket.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)

root@hhi-VirtualBox:~/flightpaln#

jd20 commented 6 years ago

As the error message says, headless chrome won't start under root user, unless your disable sandbox, which is not recommended. Run flightplan under a non-root account, or modify the src/base/engine.js file to pass --no-sandbox to chromium, at your own risk.