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

execvp trying run app #580

Closed
gen4sp opened this issue Jul 17, 2014 · 10 comments
Closed

execvp trying run app #580

gen4sp opened this issue Jul 17, 2014 · 10 comments

Comments

@gen4sp
Copy link

gen4sp commented Jul 17, 2014

i try run app, but receive this error:

execvp(): No such file or directory

it's happens only if i use "-x" key and not forever, but if it happens once on machine its happens always.
How to reproduce - don't know, looks like random.
Are you using a cluster module? - no

pm2 version: 0.9.1
nodejs v0.10.25

debuging:

Error when unlinking PID file { [Error: ENOENT, no such file or directory '/root/.pm2/pids/app.pid0.pid']
  errno: 34,
  code: 'ENOENT',
  path: '/root/.pm2/pids/app.pid0.pid',
  syscall: 'unlink' }

Why is it possible ? how to fix and prevent that?

@gen4sp
Copy link
Author

gen4sp commented Jul 17, 2014

no forking, clustering or something like that inside my app

@soyuka
Copy link
Collaborator

soyuka commented Jul 17, 2014

Please read: https://github.com/Unitech/pm2/blob/master/CONTRIBUTING.md and use the "edit" button.

Thanks.

@gen4sp
Copy link
Author

gen4sp commented Jul 17, 2014

sorry, my fault.
updated.

@gen4sp
Copy link
Author

gen4sp commented Jul 18, 2014

can you give me any advice?
why its happens and what i should to do to fix that?
Thank you!

@soyuka
Copy link
Collaborator

soyuka commented Jul 18, 2014

execvp seems to be a system call from child_process. Can you try running it without -x? Any trace of execvp(): No such file or directory error (eg: code line, function etc.)?

@gen4sp
Copy link
Author

gen4sp commented Jul 18, 2014

If i run without -x - everything is ok.
no any errors
trace:

root@BETA-GAMER-G0:~# NODE_ENV=beta DEBUG=pm2:* PM2_DEBUG=true pm2 --no-daemon start /app/app.js -o /var/log/gw/app.log -e /var/log/gw/app_errors.log --run-as-user root
pm2 launched in no-daemon mode (you can add DEBUG="*" env variable to get more messages)
  pm2:satan Trying to connect to server +0ms
  pm2:satan Daemon not launched +115ms
  pm2:satan Trying to connect to server +1ms
  pm2:satan Daemon not launched +105ms
[[[[ PM2/God daemon launched ]]]]
RPC interface [READY] on 6666:localhost
BUS system [READY] on  6667:localhost
  pm2:satan Daemon alive +28ms
  pm2:satan Launching RPC client on port 6666 localhost +0ms
  pm2:satan Connected to Daemon +3ms
Entering in node wrap logic (cluster_mode) for script /app/app.js
/app/app.js - id0 worker online
  pm2:satan process:online +67ms
PM2 Process launched
  pm2:satan log:out +102ms
┌──────────┬────┬─────────┬──────┬────────┬───────────┬────────┬─────────────┬─────────────┐
│ App name │ id │ mode    │ PID  │ status │ restarted │ uptime │      memory │    watching │
├──────────┼────┼─────────┼──────┼────────┼───────────┼────────┼─────────────┼─────────────┤
│ app      │ 0  │ cluster │ 2020 │ online │         0 │ 0s     │ 18.531 MB   │ unactivated │
└──────────┴────┴─────────┴──────┴────────┴───────────┴────────┴─────────────┴─────────────┘
 Use `pm2 desc[ribe] <id>` to get more details
--no-daemon option enabled = do not exit pm2 CLI
PM2 dameon PID = 2013
  pm2:satan log:out +53ms
[0 2014-07-18T06:24:24] ed ]]]]
[0 2014-07-18T06:24:24] 2014-07-18T10:22:22.050Z : RPC interface [READY] on 6666:localhost
[0 2014-07-18T06:24:24] 2014-07-18T10:22:22.051Z : BUS system [READY] on  6667:localhost
[0 2014-07-18T06:24:24] 2014-07-18T10:22:27.605Z : No processes launched
[0 2014-07-18T06:24:24] 2014-07-18T10:22:27.605Z : pm2 has been killed by command line
[0 2014-07-18T06:24:24] 2014-07-18T10:23:36.332Z : [[[[ PM2/God daemon launched ]]]]
[0 2014-07-18T06:24:24] 2014-07-18T10:23:36.337Z : RPC interface [READY] on 6666:localhost
[0 2014-07-18T06:24:24] 2014-07-18T10:23:36.337Z : BUS system [READY] on  6667:localhost
[0 2014-07-18T06:24:24] 2014-07-18T10:24:10.441Z : Entering in node wrap logic (cluster_mode) for script /app/app.js
[0 2014-07-18T06:24:24] 2014-07-18T10:24:10.557Z : /app/app.js - id0 worker online
[0 2014-07-18T06:24:24] 2014-07-18T10:24:21.054Z : process with pid 1989 still not killed, retrying...
[0 2014-07-18T06:24:24] 2014-07-18T10:24:21.105Z : process with pid 1989 still not killed, retrying...
[0 2014-07-18T06:24:24] 2014-07-18T10:24:21.126Z : Script /app/app.js 0 exited code 100
[0 2014-07-18T06:24:24] 2014-07-18T10:24:21.156Z : process with pid 1989 successfully killed
[0 2014-07-18T06:24:24] 2014-07-18T10:24:21.261Z : No processes launched
[0 2014-07-18T06:24:24] 2014-07-18T10:24:21.261Z : pm2 has been killed by command line

execvp-error has no any context.

@gen4sp
Copy link
Author

gen4sp commented Jul 18, 2014

and this happens only with one of my app, other starts fine with -x on the same machine

@soyuka
Copy link
Collaborator

soyuka commented Jul 18, 2014

So, where is the execvp error? Is it your app that is throwing it?

@gen4sp
Copy link
Author

gen4sp commented Jul 19, 2014

seems like it throwing by pm2.
this is whole trace:

vagrant@DEV-GAMER-G0:~$ DEBUG=pm2:* PM2_DEBUG=true pm2 --no-daemon start /app/app.js --name GAMER  --run-as-user root -x
pm2 launched in no-daemon mode (you can add DEBUG="*" env variable to get more messages)
  pm2:satan Trying to connect to server +0ms
  pm2:satan Daemon not launched +106ms
  pm2:satan Trying to connect to server +1ms
  pm2:satan Daemon not launched +104ms
[[[[ PM2/God daemon launched ]]]]
RPC interface [READY] on 6666:localhost
BUS system [READY] on  6667:localhost
  pm2:satan Daemon alive +25ms
  pm2:satan Launching RPC client on port 6666 localhost +0ms
  pm2:satan Connected to Daemon +2ms
  pm2:god Entering in fork mode +6ms
  pm2:satan process:online +11ms
PM2 Process launched
  pm2:satan log:out +61ms
  pm2:satan log:out +18ms
┌──────────┬────┬──────┬──────┬────────┬───────────┬────────┬─────────────┬─────────────┐
│ App name │ id │ mode │ PID  │ status │ restarted │ uptime │      memory │    watching │
├──────────┼────┼──────┼──────┼────────┼───────────┼────────┼─────────────┼─────────────┤
│ GAMER    │ 0  │ fork │ 2424 │ online │         0 │ 0s     │ 14.328 MB   │ unactivated │
└──────────┴────┴──────┴──────┴────────┴───────────┴────────┴─────────────┴─────────────┘
 Use `pm2 desc[ribe] <id>` to get more details
--no-daemon option enabled = do not exit pm2 CLI
PM2 dameon PID = 2417
[0 2014-07-19T06:21:15] ess with pid 2037 still not killed, retrying...
[0 2014-07-19T06:21:15] 2014-07-19T06:18:03.379Z : process with pid 2037 still not killed, retrying...
[0 2014-07-19T06:21:15] 2014-07-19T06:18:03.430Z : process with pid 2037 still not killed, retrying...
[0 2014-07-19T06:21:15] 2014-07-19T06:18:03.431Z : Script /app/app.js 0 exited code 0
[0 2014-07-19T06:21:15] 2014-07-19T06:18:03.434Z : Error when unlinking PID file { [Error: ENOENT, no such file or directory '/home/vagrant/.pm2/pids/GAMER.pid0.pid']
[0 2014-07-19T06:21:15]   errno: 34,
[0 2014-07-19T06:21:15]   code: 'ENOENT',
[0 2014-07-19T06:21:15]   path: '/home/vagrant/.pm2/pids/GAMER.pid0.pid',
[0 2014-07-19T06:21:15]   syscall: 'unlink' }
[0 2014-07-19T06:21:15] 2014-07-19T06:18:03.481Z : process with pid 2037 successfully killed
[0 2014-07-19T06:21:15] 2014-07-19T06:18:03.484Z : No processes launched
[0 2014-07-19T06:21:15] 2014-07-19T06:18:03.484Z : pm2 has been killed by command line
[0 2014-07-19T06:21:15] 2014-07-19T06:20:59.353Z : [[[[ PM2/God daemon launched ]]]]
[0 2014-07-19T06:21:15] 2014-07-19T06:20:59.356Z : RPC interface [READY] on 6666:localhost
[0 2014-07-19T06:21:15] 2014-07-19T06:20:59.356Z : BUS system [READY] on  6667:localhost
[0 2014-07-19T06:21:15] 2014-07-19T06:20:59.516Z : No processes launched
[0 2014-07-19T06:21:15] 2014-07-19T06:20:59.517Z : pm2 has been killed by command line
  pm2:satan log:out +194ms
  pm2:satan log:err +103ms
  pm2:satan log:err +194ms
  pm2:satan log:out +261ms
  pm2:satan log:err +147ms
  pm2:satan log:out +234ms
  pm2:satan log:out +11ms
  pm2:satan log:out +4ms
  pm2:satan log:out +16ms
  pm2:satan log:out +7ms
  pm2:satan log:out +4ms
  pm2:satan log:out +28ms
  pm2:satan log:out +0ms
  pm2:satan log:out +20ms
  pm2:satan log:out +1ms
  pm2:satan log:out +8ms
  pm2:satan log:out +1ms
  pm2:satan log:out +4ms
  pm2:satan log:out +3ms

if i try launch with no --name key usally the same thing happens, but

path: '/home/vagrant/.pm2/pids/app.pid0.pid',

@soyuka
Copy link
Collaborator

soyuka commented Jul 19, 2014

You are using vagrant?
Maybe this can help: #289 (comment).

What I read is that your app is killing itself:

[0 2014-07-19T06:21:15] ess with pid 2037 still not killed, retrying...
[0 2014-07-19T06:21:15] 2014-07-19T06:18:03.379Z : process with pid 2037 still not killed, retrying...
[0 2014-07-19T06:21:15] 2014-07-19T06:18:03.430Z : process with pid 2037 still not killed, retrying...
[0 2014-07-19T06:21:15] 2014-07-19T06:18:03.431Z : Script /app/app.js 0 exited code 0

@soyuka soyuka closed this as completed Aug 10, 2014
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