likeastore / dokku-pm2

Dokku plugin to utilize the power of pm2
MIT License
26 stars 5 forks source link

remote: /bin/bash: /app/.pm2: No such file or directory #1

Closed naartjie closed 10 years ago

naartjie commented 10 years ago

Hi.

I am getting this error as part of the -----> Running pm2 script, when I try to git push to dokku:

remote: /bin/bash: /app/.pm2: No such file or directory

It seems like only pre-deploy is getting invoked, and not post-build, as I cannot see any output of -----> Injecting pm2 script. How can I make sure this post-build is also run?

I should also mention that I don't have a default.yaml anywhere in /var/lib/dokku/plugins/ tree. Do I need to create one automatically?

alexbeletsky commented 10 years ago

@naartjie dokku-pm2 is not completely ready, only basic version of it implemented.

There are few reasons why it doesn't work.

  1. When I tried that I've noticed one disadvantage of current pm2 implementation. It didn't allow to run pm2 in process mode (only daemon), so it was impossible to use it in docker container. There is issue for that and it seems to be resolved now, but I didn't try it.
  2. You are probably using dokku 0.2.x where post-build step is not executed. I've created plugin for 0.3.x which supposed to appear really soon, but it didn't happen.
  3. default.yaml is not implemented and probably it would not, since all you can specify inside on processes.json.. that would just my initial idea.

So, to make it useful few things need to be done.

  1. Merge to scripts into pre-deploy so it would work on dokku 0.2.x
  2. In Procfile it should be web: pm2 --no-daemon processes.json to start it properly.
naartjie commented 10 years ago

Thanks for the quick reply @alexanderbeletsky. I have upgraded my dokku the latest version. And pm2 already has --no-deaemon merged in.

Now I am getting this:

-----> Injecting pm2 script
remote: Unable to find image '/bin/bash' locally
remote: 2014/02/19 18:35:57 Invalid namespace name (), only [a-z0-9_] are allowed, size between 4 and 30

Any ideas? Do I need to specify somewhere that bash is one of the dependencies? I saw you opened https://github.com/progrium/dokku/issues/356 a while back, is it at all related?

alexbeletsky commented 10 years ago

@naartjie the issue you referred is not that related but it gave some clues..

I just pushed some changes, it would be nice if you try and let me know results.

naartjie commented 10 years ago

Thanks again @alexanderbeletsky!! I pulled your changes in, but it's still giving that same remote: Unable to find image '/bin/bash' locally.

BTW, I think the line in Procfile should read web: pm2 --no-daemon start processes.json, anyways, it's failing before that, but I just thought I'd mention it, in case someone else reads this ;-)

naartjie commented 10 years ago

in post-build#L3 $IMAGE is not getting set:

APP="$1"; IMAGE="$2"

I added an echo after this line, and $IMAGE was blank. Has the way it's being passed to the script changed?

alexbeletsky commented 10 years ago

damn it.. in hurry, just forgot to save that file, so changes were missing in prev commit. Please try again :)

naartjie commented 10 years ago

Cool, those errors are now gone :-]

My app now deploys without errors (only warnings), but still doesn't look like it's running on the host (I've tried ps -eaf | grep pm2 and ps -eaf | grep node just to make sure, but they are both showing nothing). I guess I now have some different issues, so I'm closing this one. Thanks for your help!!

alexbeletsky commented 10 years ago

@naartjie hey, just want to follow-up :) did you manage to run it?

naartjie commented 10 years ago

@alexanderbeletsky no I did not, eventually I ditched dokku, and am just using plain vanilla digital ocean droplet + pm2, no dokku.

EDIT: thanks for checking... BTW, have you had any luck running it in any envs?

alexbeletsky commented 10 years ago

@naartjie thx for update, it's clear.. just thought to recover the project, so wanted to clarify the latest status :)