Reputation: 61
I have a node12 application, which was running fine for weeks on gcloud app engine. Now all of a sudden, it crashes when trying to launch puppeteer:
/workspace/node_modules/puppeteer/.local-chromium/linux-737027/chrome-linux/chrome: error while loading shared libraries: libgbm.so.1: cannot open shared object file: No such file or directory
2020-05-13 14:42:35 default[20200513t163546]
2020-05-13 14:42:35 default[20200513t163546]
2020-05-13 14:42:35 default[20200513t163546] TROUBLESHOOTING:
https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md
2020-05-13 14:42:35 default[20200513t163546]
2020-05-13 14:42:35 default[20200513t163546] at onClose
(/workspace/node_modules/puppeteer/lib/Launcher.js:547:20)
2020-05-13 14:42:35 default[20200513t163546] at Interface.<anonymous>
(/workspace/node_modules/puppeteer/lib/Launcher.js:537:65)
2020-05-13 14:42:35 default[20200513t163546] at Interface.emit (events.js:322:22)
2020-05-13 14:42:35 default[20200513t163546] at Interface.close (readline.js:409:8)
2020-05-13 14:42:35 default[20200513t163546] at Socket.onend (readline.js:187:10)
2020-05-13 14:42:35 default[20200513t163546] at Socket.emit (events.js:322:22)
2020-05-13 14:42:35 default[20200513t163546] at endReadableNT (_stream_readable.js:1187:12)
2020-05-13 14:42:35 default[20200513t163546] at processTicksAndRejections
(internal/process/task_queues.js:84:21)
This is my source code:
const browser = await puppeteer.launch({
timeout: 10000,
headless: true,
args: ['--no-sandbox', '--disable-setuid-sandbox']
});
My app.yaml:
runtime: nodejs12
instance_class: F4_1G
My package.json
{
...
{
"dependencies": {
"@google-cloud/firestore": "^3.7.5",
"@google-cloud/storage": "^4.7.0",
"body-parser": "^1.19.0",
"cors": "^2.8.5",
"express": "^4.17.1",
"fs": "0.0.1-security",
"path": "^0.12.7",
"puppeteer": "^3.0.4",
"resemblejs": "^3.2.4",
"stream": "0.0.2"
},
"engines": {
"node": "12.x.x"
}
}
I had the same problem on other environments like Firebase (node10), Heroku (node12) and some local hosting partners. The main problem seems to be, some modules are missing which are required by puppeteer in order to launch Chrome. However, it's been working for weeks now on Google App Engine as the only environment - and now, it's not working anymore.
Upvotes: 2
Views: 3136
Reputation: 820
I had the same issue and I resolved it using :
-NodeJS 10 and Puppeteer version 2.1.1. -Initialize the browser with the following arguments:
const browser = await puppeteer.launch ({ args: ['--no-sandbox' ] });
It seems that the library is still no added in the runtime.
Upvotes: 0