pm2
pm2 copied to clipboard
`pm2 deploy <env> setup` goes wrong on the first set up remoting server
What's going wrong?
pm2 deploy <env> setup goes wrong on the first set up remoting server. The error happens because the git clone does not work well on the remote server.
How could we reproduce this issue?
- set up a fresh remote server for deployment
- create ecosystem.conifg.js which has deployment session (repo link uses ssh)
{
// ...
deploy: {
stage: {
user: 'ubuntu',
host: '--',
ref: 'origin/canary',
repo: '[email protected]:--/--.git',
path: '/home/ubuntu/app',
'pre-deploy-local': '',
'post-deploy': 'yarn && yarn build && pm2 reload ecosystem.config.js --env stage',
'pre-setup': '',
},
}
}
Supporting information
I remote to the remoting server using ssh and run this command for fixing the problem.
ssh-keyscan gitlab.com >> ~/.ssh/known_hosts
What's the error? Perhaps the repo is private and you don't have permission to access it.