pm2 icon indicating copy to clipboard operation
pm2 copied to clipboard

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

Open manh-vv opened this issue 4 years ago • 1 comments

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

manh-vv avatar Mar 07 '21 16:03 manh-vv

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

dimitriaatos avatar May 29 '24 18:05 dimitriaatos