question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Failed to launch chrome!

See original GitHub issue

Steps to reproduce

Tell us about your environment: I’m running Puppeteer in Heroku Hobby hosting. Using

  • Puppeteer version: 6.4.1
  • Platform / OS version: whatever heroku uses
  • Node.js version: 10.16.3

What steps will reproduce the problem? It just crashes whenever I try to access a route that uses it to crawl a URL. It doesn’t happens every time. Only after a few successful requests it starts failing and I have to restart heroku.

Here’s my whole code for that route:

var express = require('express');
var puppeteer = require('puppeteer');
var cors = require('cors')

var router = express.Router();

/* GET home page. */
router.get('/', cors(), function(req, res, next) 
    var scrapePage = async (req, Admin) => {
        const browser = await puppeteer.launch({
            args: [
                '--no-sandbox',
                '--disable-setuid-sandbox',
            ]
        });
        const page = await browser.newPage();
        await page.goto(req.query.url);
    
        //loading a .js file to use it those functions on page load
        await page.addScriptTag({path: "./models/admin.js"});

        const scrapedData = await page.evaluate(function(){

            //query stuff from window and document variables
         
            return {
                whatever: here
            };
        });
    
        await browser.close();
        return scrapedData;    
    };
    
    const test = new Promise((resolve, reject) => {
        scrapePage(req, Admin)
        .then(data => {
            res.json(data);
        })
        .catch(function(err){
            console.log(err);
            res.send(err);
        });
    });
});
module.exports = router;

What happens instead?

I get this error in the logs:

Error: Failed to launch chrome!
Error: Failed to launch chrome!
Error: Failed to launch chrome!
[1203/190259.931677:ERROR:platform_thread_posix.cc(129)] pthread_create: Resource temporarily unavailable (11)
[1203/190259.931677:ERROR:platform_thread_posix.cc(129)] pthread_create: Resource temporarily unavailable (11)
[1203/190259.931677:ERROR:platform_thread_posix.cc(129)] pthread_create: Resource temporarily unavailable (11)
[1203/190259.931960:ERROR:platform_thread_posix.cc(129)] pthread_create: Resource temporarily unavailable (11)
[1203/190259.931960:ERROR:platform_thread_posix.cc(129)] pthread_create: Resource temporarily unavailable (11)
[1203/190259.931960:ERROR:platform_thread_posix.cc(129)] pthread_create: Resource temporarily unavailable (11)
[1203/190259.932341:ERROR:platform_thread_posix.cc(129)] pthread_create: Resource temporarily unavailable (11)
[1203/190259.932341:ERROR:platform_thread_posix.cc(129)] pthread_create: Resource temporarily unavailable (11)
[1203/190259.932341:ERROR:platform_thread_posix.cc(129)] pthread_create: Resource temporarily unavailable (11)
[1203/190259.933572:ERROR:platform_thread_posix.cc(129)] pthread_create: Resource temporarily unavailable (11)
[1203/190259.933572:ERROR:platform_thread_posix.cc(129)] pthread_create: Resource temporarily unavailable (11)
[1203/190259.933572:ERROR:platform_thread_posix.cc(129)] pthread_create: Resource temporarily unavailable (11)
[1203/190259.945855:ERROR:platform_thread_posix.cc(129)] pthread_create: Resource temporarily unavailable (11)
[1203/190259.945855:ERROR:platform_thread_posix.cc(129)] pthread_create: Resource temporarily unavailable (11)
[1203/190259.945855:ERROR:platform_thread_posix.cc(129)] pthread_create: Resource temporarily unavailable (11)
[1203/190259.945888:FATAL:backend_impl.cc(120)] Check failed: StartWithOptions(base::Thread::Options(base::MessagePumpType::IO, 0)).
[1203/190259.945888:FATAL:backend_impl.cc(120)] Check failed: StartWithOptions(base::Thread::Options(base::MessagePumpType::IO, 0)).
[1203/190259.945888:FATAL:backend_impl.cc(120)] Check failed: StartWithOptions(base::Thread::Options(base::MessagePumpType::IO, 0)).
#0 0x55f4501f0e29 base::debug::CollectStackTrace()
#0 0x55f4501f0e29 base::debug::CollectStackTrace()
#0 0x55f4501f0e29 base::debug::CollectStackTrace()
#1 0x55f450154ee3 base::debug::StackTrace::StackTrace()
#1 0x55f450154ee3 base::debug::StackTrace::StackTrace()
#1 0x55f450154ee3 base::debug::StackTrace::StackTrace()
#2 0x55f4501696b3 logging::LogMessage::~LogMessage()
#2 0x55f4501696b3 logging::LogMessage::~LogMessage()
#2 0x55f4501696b3 logging::LogMessage::~LogMessage()
#3 0x55f4505522ab base::LazyInstance<>::Get()
#3 0x55f4505522ab base::LazyInstance<>::Get()
#3 0x55f4505522ab base::LazyInstance<>::Get()
#4 0x55f45054ae50 disk_cache::BackendImpl::BackendImpl()
#4 0x55f45054ae50 disk_cache::BackendImpl::BackendImpl()
#4 0x55f45054ae50 disk_cache::BackendImpl::BackendImpl()
#5 0x55f45054a833 (anonymous namespace)::CacheCreator::Run()
#5 0x55f45054a833 (anonymous namespace)::CacheCreator::Run()
#5 0x55f45054a833 (anonymous namespace)::CacheCreator::Run()
#6 0x55f45054a9e1 (anonymous namespace)::CacheCreator::TryCreateCleanupTrackerAndRun()
#6 0x55f45054a9e1 (anonymous namespace)::CacheCreator::TryCreateCleanupTrackerAndRun()
#6 0x55f45054a9e1 (anonymous namespace)::CacheCreator::TryCreateCleanupTrackerAndRun()
#7 0x55f45054a65a disk_cache::CreateCacheBackendImpl()
#7 0x55f45054a65a disk_cache::CreateCacheBackendImpl()
#7 0x55f45054a65a disk_cache::CreateCacheBackendImpl()
#8 0x55f45054aa42 disk_cache::CreateCacheBackend()
#8 0x55f45054aa42 disk_cache::CreateCacheBackend()
#8 0x55f45054aa42 disk_cache::CreateCacheBackend()
#9 0x55f44e358979 gpu::ShaderDiskCache::Init()
#9 0x55f44e358979 gpu::ShaderDiskCache::Init()
#9 0x55f44e358979 gpu::ShaderDiskCache::Init()
#10 0x55f44e3588b9 gpu::ShaderCacheFactory::Get()
#10 0x55f44e3588b9 gpu::ShaderCacheFactory::Get()
#10 0x55f44e3588b9 gpu::ShaderCacheFactory::Get()
#11 0x55f451544104 viz::GpuHostImpl::EstablishGpuChannel()
#11 0x55f451544104 viz::GpuHostImpl::EstablishGpuChannel()
#11 0x55f451544104 viz::GpuHostImpl::EstablishGpuChannel()
#12 0x55f451542488 viz::GpuClient::EstablishGpuChannel()
#12 0x55f451542488 viz::GpuClient::EstablishGpuChannel()
#12 0x55f451542488 viz::GpuClient::EstablishGpuChannel()
#13 0x55f44e18328b base::internal::Invoker<>::RunOnce()
#13 0x55f44e18328b base::internal::Invoker<>::RunOnce()
#13 0x55f44e18328b base::internal::Invoker<>::RunOnce()
#14 0x55f45019fd6f base::TaskAnnotator::RunTask()
#14 0x55f45019fd6f base::TaskAnnotator::RunTask()
#14 0x55f45019fd6f base::TaskAnnotator::RunTask()
#15 0x55f4501affba base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl()
#15 0x55f4501affba base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl()
#15 0x55f4501affba base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl()
#16 0x55f4501afd98 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoSomeWork()
#16 0x55f4501afd98 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoSomeWork()
#16 0x55f4501afd98 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoSomeWork()
#17 0x55f4502075f9 base::MessagePumpLibevent::Run()
#17 0x55f4502075f9 base::MessagePumpLibevent::Run()
#17 0x55f4502075f9 base::MessagePumpLibevent::Run()
#18 0x55f4501b07d9 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run()
#18 0x55f4501b07d9 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run()
#18 0x55f4501b07d9 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run()
#19 0x55f450189687 base::RunLoop::Run()
#19 0x55f450189687 base::RunLoop::Run()
#19 0x55f450189687 base::RunLoop::Run()
#20 0x55f44e644884 content::BrowserProcessSubThread::IOThreadRun()
#20 0x55f44e644884 content::BrowserProcessSubThread::IOThreadRun()
#20 0x55f44e644884 content::BrowserProcessSubThread::IOThreadRun()
#21 0x55f4501c3dbf base::Thread::ThreadMain()
#21 0x55f4501c3dbf base::Thread::ThreadMain()
#21 0x55f4501c3dbf base::Thread::ThreadMain()
#22 0x55f45020119e base::(anonymous namespace)::ThreadFunc()
#22 0x55f45020119e base::(anonymous namespace)::ThreadFunc()
#22 0x55f45020119e base::(anonymous namespace)::ThreadFunc()
#23 0x7fd6c68356db start_thread
#23 0x7fd6c68356db start_thread
#23 0x7fd6c68356db start_thread
#24 0x7fd6c08cf88f clone
#24 0x7fd6c08cf88f clone
#24 0x7fd6c08cf88f clone
Task trace:
Task trace:
Task trace:
#0 0x55f45154207b viz::GpuClient::PreEstablishGpuChannel()
#0 0x55f45154207b viz::GpuClient::PreEstablishGpuChannel()
#0 0x55f45154207b viz::GpuClient::PreEstablishGpuChannel()
#1 0x55f44fdd7286 headless::HeadlessShell::OnStart()
#1 0x55f44fdd7286 headless::HeadlessShell::OnStart()
#1 0x55f44fdd7286 headless::HeadlessShell::OnStart()
#2 0x55f44fdd7286 headless::HeadlessShell::OnStart()
#2 0x55f44fdd7286 headless::HeadlessShell::OnStart()
#2 0x55f44fdd7286 headless::HeadlessShell::OnStart()



Received signal 6
Received signal 6
Received signal 6
#0 0x55f4501f0e29 base::debug::CollectStackTrace()
#0 0x55f4501f0e29 base::debug::CollectStackTrace()
#0 0x55f4501f0e29 base::debug::CollectStackTrace()
#1 0x55f450154ee3 base::debug::StackTrace::StackTrace()
#1 0x55f450154ee3 base::debug::StackTrace::StackTrace()
#1 0x55f450154ee3 base::debug::StackTrace::StackTrace()
#2 0x55f4501f09b1 base::debug::(anonymous namespace)::StackDumpSignalHandler()
#2 0x55f4501f09b1 base::debug::(anonymous namespace)::StackDumpSignalHandler()
#2 0x55f4501f09b1 base::debug::(anonymous namespace)::StackDumpSignalHandler()
#3 0x7fd6c6840890 <unknown>
#3 0x7fd6c6840890 <unknown>
#3 0x7fd6c6840890 <unknown>
#4 0x7fd6c07ece97 gsignal
#4 0x7fd6c07ece97 gsignal
#4 0x7fd6c07ece97 gsignal
#5 0x7fd6c07ee801 abort
#5 0x7fd6c07ee801 abort
#5 0x7fd6c07ee801 abort
#6 0x55f4501ef815 base::debug::BreakDebugger()
#6 0x55f4501ef815 base::debug::BreakDebugger()
#6 0x55f4501ef815 base::debug::BreakDebugger()
#7 0x55f450169af9 logging::LogMessage::~LogMessage()
#7 0x55f450169af9 logging::LogMessage::~LogMessage()
#7 0x55f450169af9 logging::LogMessage::~LogMessage()
#8 0x55f4505522ab base::LazyInstance<>::Get()
#8 0x55f4505522ab base::LazyInstance<>::Get()
#8 0x55f4505522ab base::LazyInstance<>::Get()
#9 0x55f45054ae50 disk_cache::BackendImpl::BackendImpl()
#9 0x55f45054ae50 disk_cache::BackendImpl::BackendImpl()
#9 0x55f45054ae50 disk_cache::BackendImpl::BackendImpl()
#10 0x55f45054a833 (anonymous namespace)::CacheCreator::Run()
#10 0x55f45054a833 (anonymous namespace)::CacheCreator::Run()
#10 0x55f45054a833 (anonymous namespace)::CacheCreator::Run()
#11 0x55f45054a9e1 (anonymous namespace)::CacheCreator::TryCreateCleanupTrackerAndRun()
#11 0x55f45054a9e1 (anonymous namespace)::CacheCreator::TryCreateCleanupTrackerAndRun()
#11 0x55f45054a9e1 (anonymous namespace)::CacheCreator::TryCreateCleanupTrackerAndRun()
#12 0x55f45054a65a disk_cache::CreateCacheBackendImpl()
#12 0x55f45054a65a disk_cache::CreateCacheBackendImpl()
#12 0x55f45054a65a disk_cache::CreateCacheBackendImpl()
#13 0x55f45054aa42 disk_cache::CreateCacheBackend()
#13 0x55f45054aa42 disk_cache::CreateCacheBackend()
#13 0x55f45054aa42 disk_cache::CreateCacheBackend()
#14 0x55f44e358979 gpu::ShaderDiskCache::Init()
#14 0x55f44e358979 gpu::ShaderDiskCache::Init()
#14 0x55f44e358979 gpu::ShaderDiskCache::Init()
#15 0x55f44e3588b9 gpu::ShaderCacheFactory::Get()
#15 0x55f44e3588b9 gpu::ShaderCacheFactory::Get()
#15 0x55f44e3588b9 gpu::ShaderCacheFactory::Get()
#16 0x55f451544104 viz::GpuHostImpl::EstablishGpuChannel()
#16 0x55f451544104 viz::GpuHostImpl::EstablishGpuChannel()
#16 0x55f451544104 viz::GpuHostImpl::EstablishGpuChannel()
#17 0x55f451542488 viz::GpuClient::EstablishGpuChannel()
#17 0x55f451542488 viz::GpuClient::EstablishGpuChannel()
#17 0x55f451542488 viz::GpuClient::EstablishGpuChannel()
#18 0x55f44e18328b base::internal::Invoker<>::RunOnce()
#18 0x55f44e18328b base::internal::Invoker<>::RunOnce()
#18 0x55f44e18328b base::internal::Invoker<>::RunOnce()
#19 0x55f45019fd6f base::TaskAnnotator::RunTask()
#19 0x55f45019fd6f base::TaskAnnotator::RunTask()
#19 0x55f45019fd6f base::TaskAnnotator::RunTask()
#20 0x55f4501affba base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl()
#20 0x55f4501affba base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl()
#20 0x55f4501affba base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl()
#21 0x55f4501afd98 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoSomeWork()
#21 0x55f4501afd98 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoSomeWork()
#21 0x55f4501afd98 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoSomeWork()
#22 0x55f4502075f9 base::MessagePumpLibevent::Run()
#22 0x55f4502075f9 base::MessagePumpLibevent::Run()
#22 0x55f4502075f9 base::MessagePumpLibevent::Run()
#23 0x55f4501b07d9 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run()
#23 0x55f4501b07d9 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run()
#23 0x55f4501b07d9 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run()
#24 0x55f450189687 base::RunLoop::Run()
#24 0x55f450189687 base::RunLoop::Run()
#24 0x55f450189687 base::RunLoop::Run()
#25 0x55f44e644884 content::BrowserProcessSubThread::IOThreadRun()
#25 0x55f44e644884 content::BrowserProcessSubThread::IOThreadRun()
#25 0x55f44e644884 content::BrowserProcessSubThread::IOThreadRun()
#26 0x55f4501c3dbf base::Thread::ThreadMain()
#26 0x55f4501c3dbf base::Thread::ThreadMain()
#26 0x55f4501c3dbf base::Thread::ThreadMain()
#27 0x55f45020119e base::(anonymous namespace)::ThreadFunc()
#27 0x55f45020119e base::(anonymous namespace)::ThreadFunc()
#27 0x55f45020119e base::(anonymous namespace)::ThreadFunc()
#28 0x7fd6c68356db start_thread
#28 0x7fd6c68356db start_thread
#28 0x7fd6c68356db start_thread
#29 0x7fd6c08cf88f clone
#29 0x7fd6c08cf88f clone
#29 0x7fd6c08cf88f clone
r8: 0000000000000000  r9: 00007fd6b4721910 r10: 0000000000000008 r11: 0000000000000246
r8: 0000000000000000  r9: 00007fd6b4721910 r10: 0000000000000008 r11: 0000000000000246
r8: 0000000000000000  r9: 00007fd6b4721910 r10: 0000000000000008 r11: 0000000000000246
r12: 00007fd6b4722bd0 r13: 00007fd6b4721bb8 r14: 00007fd6b4722bd8 r15: 00007fd6b4721bd0
r12: 00007fd6b4722bd0 r13: 00007fd6b4721bb8 r14: 00007fd6b4722bd8 r15: 00007fd6b4721bd0
r12: 00007fd6b4722bd0 r13: 00007fd6b4721bb8 r14: 00007fd6b4722bd8 r15: 00007fd6b4721bd0
di: 0000000000000002  si: 00007fd6b4721910  bp: 00007fd6b4721b60  bx: 00007fd6b4721bb8
di: 0000000000000002  si: 00007fd6b4721910  bp: 00007fd6b4721b60  bx: 00007fd6b4721bb8
di: 0000000000000002  si: 00007fd6b4721910  bp: 00007fd6b4721b60  bx: 00007fd6b4721bb8
dx: 0000000000000000  ax: 0000000000000000  cx: 00007fd6c07ece97  sp: 00007fd6b4721910
dx: 0000000000000000  ax: 0000000000000000  cx: 00007fd6c07ece97  sp: 00007fd6b4721910
dx: 0000000000000000  ax: 0000000000000000  cx: 00007fd6c07ece97  sp: 00007fd6b4721910
ip: 00007fd6c07ece97 efl: 0000000000000246 cgf: 7472000000000033 erf: 0000000000000000
ip: 00007fd6c07ece97 efl: 0000000000000246 cgf: 7472000000000033 erf: 0000000000000000
ip: 00007fd6c07ece97 efl: 0000000000000246 cgf: 7472000000000033 erf: 0000000000000000
trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]
[end of stack trace]
[end of stack trace]
Calling _exit(1). Core file will not be generated.
Calling _exit(1). Core file will not be generated.
Calling _exit(1). Core file will not be generated.






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



at onClose (/app/node_modules/puppeteer/lib/Launcher.js:348:14)
at onClose (/app/node_modules/puppeteer/lib/Launcher.js:348:14)
at onClose (/app/node_modules/puppeteer/lib/Launcher.js:348:14)
at ChildProcess.<anonymous> (/app/node_modules/puppeteer/lib/Launcher.js:338:60)
at ChildProcess.<anonymous> (/app/node_modules/puppeteer/lib/Launcher.js:338:60)
at ChildProcess.<anonymous> (/app/node_modules/puppeteer/lib/Launcher.js:338:60)
at ChildProcess.emit (events.js:215:7)
at ChildProcess.emit (events.js:215:7)
at ChildProcess.emit (events.js:215:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
GET /admin?url=http://alvarotrigo.com/fullPage/extensions/test.html 304 678.130 ms - -
GET /admin?url=http://alvarotrigo.com/fullPage/extensions/test.html 304 678.130 ms - -
GET /admin?url=http://alvarotrigo.com/fullPage/extensions/test.html 304 678.130 ms - -

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:5

github_iconTop GitHub Comments

1reaction
qiao-twcommented, Jul 8, 2022

I just met this problem as well.

0reactions
OrKoNcommented, Sep 6, 2022

Does it still repro using the latest version? does it happen outside of the Heroku environment? Please re-open the issue with the latest repro. The original failure looks like some dependencies (mentioned in troubleshooting.md) might be missing on Heroku or it was a bug in that version of Chromium.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to launch chrome #807 - puppeteer/puppeteer - GitHub
When I deployed in my EC2 I am getting this error. Couldn't find a past issue related to this. What happens instead? It...
Read more >
Can't Use Puppeteer -- Error: Failed to launch chrome
This occurs when the test code is run in the Gitlab CI. However, it works fine locally. Someone please help? 2039 Error: Failed...
Read more >
Troubleshooting - Puppeteer
UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process! This means that the browser was downloaded but failed to be extracted correctly.
Read more >
Internal browser error: Failed to launch the browser process!
Internal browser error : Failed to launch the browser process!
Read more >
puppeteer on Chrome! - Google Groups
localhost /usr/local/lib/node_modules/puppeteer # node test.js (node:19830) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found