Baremetal deploy fails on Starting serve serve process step - pm2
See original GitHub issueI 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 commandyarn 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
- I have run
- 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?
- I am expecting that this step should be running
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:
- Created a year ago
- Comments:14 (14 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
#5139 merged - adds “save” step to baremetal and add docs for baremetal startup
continuing on local/global pm2 options
Going to close this along with the PR, thanks again for working on it!