Unitech / pm2-deploy

Deploy part of PM2
http://pm2.keymetrics.io/docs/usage/deployment/
MIT License
178 stars 71 forks source link

errors on pm2 deploy - works on other machines, broken on this machine #105

Open BrandonCopley opened 7 years ago

BrandonCopley commented 7 years ago

I have multiple machines that run pm2 deploy's. This one though has an error when deploying:

Deploying to test environment --> on host xx.xx.xx.xx ○ deploying origin/paypal ○ executing pre-deploy-local ○ hook pre-deploy ○ fetching updates bash: line 0: cd: /Users/Username/github/test_project/~/pm2/source: No such file or directory

fetch failed

Deploy failed

My other computers are on the same codebase and have no issues pushing, I'm assuming some configuration is wrong here. Any ideas?

BrandonCopley commented 7 years ago

It has something to do with this in the ecosystem file: "path": "~/pm2",

I'm unsure why it is looking at this when doing a deploy, but it's looking for this folder locally which is incorrect.

BrandonCopley commented 7 years ago

This seems to be a bug since pm2 v2.0 v1.1.3 runs just fine.

BrandonCopley commented 7 years ago

This appears to be fixed with log files, however relative paths in the "path" object still does NOT work for deployments.

However, giving it an exact path does work.

A1iAshoor commented 6 years ago

I am facing the same issue @BrandonCopley not working here as well

arcreative commented 6 years ago

Thansk @BrandonCopley... I feel like I encounter an issue like this every time I deal with PM2...

vanskins commented 6 years ago

Hi I'm encountering this error right now. Can you help me with this ?

vanskins commented 6 years ago

bash: line 0: cd: /root/app/source: No such file or directory

fetch failed

this is my error

RomainLegouverneur commented 6 years ago

@vanskins http://pm2.keymetrics.io/docs/usage/deployment/#simple-deploy

You need to setup before or use --force pm2 deploy production setup and you can deploy after that

Enjoy

Kunalpaul12 commented 5 years ago

Thanks @RomainLegouverneur

barkdoll commented 5 years ago

I would like to stress that on first time deployment, what fixed it for me was first running

pm2 deploy production setup

and then running

pm2 deploy production update

like @RomainLegouverneur said.

ghost commented 5 years ago

Hello there, I want to add a question to this thread (actually it's the only one I found during the last 24h). I added the command - pm2 deploy ecosystem.config.js production setup before - pm2 deploy ecosystem.config.js production and I must say everything 'works'... Except the fact pm2 created a folder source and copied inside all my files.

Is it a normal behavior ?! Why can't my nodeJS server be started from the ~/projet2/ folder, which is the one where my files are sent during the push from gitlab ? The exec cwd is /home/ubuntu/projet2/source and I never created such a folder. The remote server is messed up with every single file copied into this source folder and I don't understand why :(

Hypermona commented 3 years ago

@vanskins http://pm2.keymetrics.io/docs/usage/deployment/#simple-deploy

You need to setup before or use --force pm2 deploy production setup and you can deploy after that

Enjoy

ur, really a lifesaver. thanks, bro it works

elhe26 commented 2 years ago

Hello there, I want to add a question to this thread (actually it's the only one I found during the last 24h). I added the command - pm2 deploy ecosystem.config.js production setup before - pm2 deploy ecosystem.config.js production and I must say everything 'works'... Except the fact pm2 created a folder source and copied inside all my files.

Is it a normal behavior ?! Why can't my nodeJS server be started from the ~/projet2/ folder, which is the one where my files are sent during the push from gitlab ? The exec cwd is /home/ubuntu/projet2/source and I never created such a folder. The remote server is messed up with every single file copied into this source folder and I don't understand why :(

Any updates regarding this? Is there a way to change source folder to <PROJECT_NAME>?

Wexyshewn commented 2 years ago

I wonder how is the pm2 infrastructure package.json in Glitch. how should it be