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 list: cannot read string of undefined #1137

Closed
MichielDeMey opened this issue Mar 29, 2015 · 5 comments
Closed

pm2 list: cannot read string of undefined #1137

MichielDeMey opened this issue Mar 29, 2015 · 5 comments

Comments

@MichielDeMey
Copy link
Contributor

Possibly related to #1029 and #1009

Ubuntu 14.04 LTS (Server) inside Vagrant
PM2 v0.12.9
io.js v1.6.2

I simply saved my processes using
pm2 save

Then generated a startup script using
sudo pm2 startup -u vagrant

Then rebooted the server to see if it worked.

Here's the callstack I get when trying to list PM2 processes using pm2 list:

> pm2 list

/usr/lib/node_modules/pm2/node_modules/cli-table/lib/index.js:182
      var contents = item.toString().split("\n").reduce(function (memo, l) {
                         ^
TypeError: Cannot read property 'toString' of undefined
    at /usr/lib/node_modules/pm2/node_modules/cli-table/lib/index.js:182:26
    at Array.forEach (native)
    at generateRow (/usr/lib/node_modules/pm2/node_modules/cli-table/lib/index.js:181:11)
    at /usr/lib/node_modules/pm2/node_modules/cli-table/lib/index.js:275:16
    at Table.forEach (native)
    at Table.toString (/usr/lib/node_modules/pm2/node_modules/cli-table/lib/index.js:258:10)
    at Object.UX.dispAsTable (/usr/lib/node_modules/pm2/lib/CliUx.js:193:25)
    at /usr/lib/node_modules/pm2/lib/CLI.js:1748:12
    at /usr/lib/node_modules/pm2/node_modules/pm2-axon-rpc/lib/client.js:45:10
    at Parser.<anonymous> (/usr/lib/node_modules/pm2/node_modules/pm2-axon/lib/sockets/req.js:67:8)

On a side-note, I am able to check the processes using pm2 info and pm2 monit, so I assume this is most likely just a visual bug.

Executing pm2 update fixes the error message.

@jshkurti
Copy link
Contributor

It shouldn't happen with pm2 v0.12.9.
Maybe you had an older version of pm2 running in memory ?
Did pm2 update fixed it permanently or does it happen again if you reboot the server ?

@MichielDeMey
Copy link
Contributor Author

It happens again on reboot,
I have to execute pm2 update on every restart.

@jshkurti jshkurti self-assigned this Mar 30, 2015
jshkurti added a commit that referenced this issue Mar 30, 2015
@jshkurti
Copy link
Contributor

Can you npm i -g git://github.com/Unitech/PM2#development and try again please ? :)

@MichielDeMey
Copy link
Contributor Author

That worked!

Both while PM2 is running and using a clean install.

@MichielDeMey
Copy link
Contributor Author

Waiting for this to reach stable. :)

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

2 participants