Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM2][ERROR] Process failed to launch spawn E2BIG #3271

Closed
liujb opened this issue Nov 10, 2017 · 4 comments
Closed

[PM2][ERROR] Process failed to launch spawn E2BIG #3271

liujb opened this issue Nov 10, 2017 · 4 comments

Comments

@liujb
Copy link

liujb commented Nov 10, 2017

Your issue may already be reported!
Please search on the issue tracker before creating one.

What's going wrong?

When I use supervisord to hosted my pm2 process using --no-daemon on production env at docker.

Nodejs version 6.10.3
PM2 version 2.7.2

How could we reproduce this issue?

Supporting information

Please run the following command (available on PM2 >= 2.6)

$ pm2 report
@vmarchaud
Copy link
Contributor

Not related on PM2 but on your process configuration :

E2BIG: Argument list too long; used when the arguments passed to a new program being executed with one of the exec functions

@linweiwei123
Copy link

linweiwei123 commented Jul 17, 2019

I have the same problem. @vmarchaud is right! It's the env problem. I use docker to deploy my applications. The env data start with 'TEST_xxx' grow as my applications get more and more . It take 99% percent of the env length. I solve this problem by change a little code of pm2 as followed:

Change pm2 lib/Common.js line 199 as the picture shows:

image

It's not good. But it works for me. The problem is your env data is too big, you can check by these commands:

node
> process.env

@inerc
Copy link

inerc commented Feb 11, 2020

I have the same problem. @vmarchaud is right! It's the env problem. I use docker to deploy my applications. The env data start with 'TEST_xxx' grow as my applications get more and more . It take 99% percent of the env length. I solve this problem by change a little code of pm2 as followed:

Change pm2 lib/Common.js line 199 as the picture shows:

image

It's not good. But it works for me. The problem is your env data is too big, you can check by these commands:

node
> process.env

I made special configs to configure these settings. Here is PR in lib support me)
#4596

@foxliu
Copy link

foxliu commented Apr 27, 2021

Another way to solve this problem:
In dockerfile change CMD to:
CMD env -i /bin/bash -c "export PATH=/bin:/usr/bin:/sbin:/usr/sbin && pm2 start"
It is important to note that, PATH must had the node path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants