Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is `node.js` dying when called from inside python/uwsgi?

From the shell this python code which start and communicates with a node.js process works fine:

> from subprocess import *
> js = "(function(m) { console.log(m) })('hello world')"
> (out,err) = Popen(["node"], stdin=PIPE, stdout=PIPE, stderr=PIPE, shell=False).communicate(js)
> out
"hello world\n"

But when I run the same code from within uwsgi I instead get this in err:

'FATAL ERROR: v8::Context::New() V8 is no longer usable\n'

Any insights from either the wsgi community or the node.js community? I'm at a loss.

like image 458
Chris W. Avatar asked Jul 17 '26 20:07

Chris W.


1 Answers

Check if you are running uWSGI with memory constraints (like --limit-as or a cgroup/jail). Processes spawned from it will inherit those limits. Even check for environment variables v8 could expect (like HOME)

like image 72
roberto Avatar answered Jul 19 '26 10:07

roberto



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!