Unitech / pm2

Node.js Production Process Manager with a built-in Load Balancer.
https://pm2.keymetrics.io/docs/usage/quick-start/
Other
41.61k stars 2.62k forks source link

`pm2 deploy <env> setup` goes wrong on the first set up remoting server #5005

Open manh-vv opened 3 years ago

manh-vv commented 3 years ago

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?

{
  // ...
  deploy: {
    stage: {
      user: 'ubuntu',
      host: '--',
      ref: 'origin/canary',
      repo: 'git@gitlab.com:--/--.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
dimitriaatos commented 6 months ago

What's the error? Perhaps the repo is private and you don't have permission to access it.