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

unable to start pm2 flask application #3816

Closed
vijaysagi1 opened this issue Jul 23, 2018 · 3 comments
Closed

unable to start pm2 flask application #3816

vijaysagi1 opened this issue Jul 23, 2018 · 3 comments

Comments

@vijaysagi1
Copy link

What's going wrong?

unable to start the flask application
the error is

[2018-07-23T07:23:29.818Z] PM2 log: ===============================================================================
[2018-07-23T07:23:29.818Z] PM2 error: [PM2] Resurrecting PM2
Be sure to have the latest version by doing npm install pm2@latest -g before doing this procedure.
[PM2] Saving current process list...
/usr/local/lib/node_modules/pm2/node_modules/pidusage/lib/procfile.js:26
buf = Buffer.alloc(SIZE)
^
TypeError: Buffer.alloc is not a function
at readUntilEnd (/usr/local/lib/node_modules/pm2/node_modules/pidusage/lib/procfile.js:26:18)
at /usr/local/lib/node_modules/pm2/node_modules/pidusage/lib/procfile.js:67:5
at FSReqWrap.oncomplete (fs.js:82:15)

How could we reproduce this issue?

pm2 start app.py

Supporting information

nodejs version: 4.2.6
pm2 3.0.0
npm 6.1.0

$ pm2 report



pls suggest the way forward```
@wallet77
Copy link
Contributor

Hi @vijaysagi1

It's because a flask app cannot be started as normal python app.
It should be started with flask run command.

$ export FLASK_APP=hello.py
$ pm2 start "flask run"

@Unitech
Copy link
Owner

Unitech commented Jul 23, 2018

Buffer.alloc requires Node v4.5.0

@vijaysagi1
Copy link
Author

Thank u so much. its working

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

No branches or pull requests

3 participants