Running NodeJS applications within containers fails with "Assertion ` (0) == (uv_thread_create(t.get(), start_thread, this))' failed"

Solution Verified - Updated -

Issue

  • Running NodeJS applications from within a containerized environment results in an error when the process attempts to fork or clone a new process:
bash-5.1$ npm -v
/usr/bin/node[2]: ../src/node_platform.cc:68:std::unique_ptr<long unsigned int> node::WorkerThreadsTaskRunner::DelayedTaskScheduler::Start(): Assertion `(0) == (uv_thread_create(t.get(), start_thread, this))' failed.
 1: 0x55aa6803e9f4 node::Abort() [/usr/bin/node]
 2: 0x55aa6803ed31 node::Assert(node::AssertionInfo const&) [/usr/bin/node]
 3: 0x55aa680bf48c node::WorkerThreadsTaskRunner::WorkerThreadsTaskRunner(int) [/usr/bin/node]
 4: 0x55aa680bf5f7 node::NodePlatform::NodePlatform(int, v8::TracingController*, v8::PageAllocator*) [/usr/bin/node]
 5: 0x55aa67ffb3ec node::V8Platform::Initialize(int) [/usr/bin/node]
 6: 0x55aa67ff7893 node::InitializeOncePerProcess(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, node::ProcessFlags::Flags) [/usr/bin/node]
 7: 0x55aa67ff7d33 node::Start(int, char**) [/usr/bin/node]
 8: 0x7fe9a082eeb0  [/lib64/libc.so.6]
 9: 0x7fe9a082ef60 __libc_start_main [/lib64/libc.so.6]
10: 0x55aa67f657a5 _start [/usr/bin/node]
Aborted (core dumped)
  • This can occur in an application executing or during an invocation of simple nodejs application, such as npm.

Environment

  • Red Hat Enterprise Linux
  • Red Hat OpenShift Container Platform
  • Red Hat build of NodeJS, tested on version 18 but all versions should be applicable

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content