question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Baremetal deploy fails on Starting serve serve process step - pm2

See original GitHub issue

I am happy to do additional testing and contribute patches, etc to help solve this issue.

Main issue

  • What happens
    • I have run yarn rw setup deploy baremetal and made the necessary config settings (below)
    • When i run yarn rw deploy baremetal --firstrun all steps succeed until i get to “Starting serve process ofr the first time”. At that step i get an error that the Deploy Failed running the command yarn pm2 start ecosystem.config.js --only serve
    • If i ssh into the server i can manually start the service using the “manual” pm2 command of pm2 start ecosystem.config.js
  • What is expected
    • I am expecting that this step should be running pm2 start ecosystem.config.js to install the initial api services. I cannot find a reference to using yarn to run the pm2 command. I suspect i am missing something in my packages config possibly?

Additional thoughts

  • I found it necessary to run pm2 save to make my settings persist, this would be helpful to add
  • possibly a statement about pm2 startup to discuss injecting pm2 into the systems normal services so it will run on reboot

Relevant configs

deploy.toml
[[servers]]
host = "redwood"
username = "zach"
agentForward = false
privateKey = "/Users/zachpeters/.ssh/id_rsa"
migrate = false
sides = ["api","web"]
path = "/var/www/oblique-strategies"
processNames = ["serve"]
package.json (root)
{
  "private": true,
  "workspaces": {
    "packages": [
      "api",
      "web",
      "packages/*"
    ]
  },
  "devDependencies": {
    "@redwoodjs/core": "^1.0.0",
    "node-ssh": "^12.0.4"
  },
  "eslintConfig": {
    "extends": "@redwoodjs/eslint-config",
    "root": true
  },
  "engines": {
    "node": ">=14.19 <=16.x",
    "yarn": ">=1.15"
  },
  "prisma": {
    "seed": "yarn rw exec seed"
  },
  "packageManager": "yarn@3.2.0"
}
ecosystem.config.js
module.exports = {
  apps: [
    {
      name: 'api',
      script: 'node_modules/.bin/rw',
      args: 'serve api',
      instances: 'max',
      exec_mode: 'cluster',
      wait_ready: false,
      listen_timeout: 10000,
    },
  ],
}

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
zpeterscommented, Apr 14, 2022

#5139 merged - adds “save” step to baremetal and add docs for baremetal startup

continuing on local/global pm2 options

0reactions
cannikincommented, Apr 25, 2022

Going to close this along with the PR, thanks again for working on it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problems during baremetal deploy - RedwoodJS Community
First, when I tried to run “yarn rw deploy baremetal --first-run”, It got stuck in the “Building web” step. In the VPS, it...
Read more >
Deployment - PM2
Advanced process manager for production Node.js applications. Load balancer, logs facility, startup script, micro service management, at a glance.
Read more >
Chapter 4. Troubleshoot Bare Metal Provisioning
If your Bare Metal Provisioning system is not getting the right hostname, it means that cloud-init is failing. To fix this, connect the...
Read more >
How to Deploy, Manage and Scale Node.js Apps with PM2
PM2 is an open-source process manager for Node.js applications that ... Go ahead and start the server for your application in development ...
Read more >
How to Set Up Apache as Frontend Proxy Server for Node.js ...
Next, press CTRL + C to stop the application. Step 4 – Install and Configure PM2 to Manage Node.js Application. PM2 is a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found