Can't Activate New Deployment on Github Branch

I’m trying to set up 3 sites on the same server for production, staging, and dev synced with corresponding Github branches of the same repo.

I can get the main branch up without issue. But any other branch fails on Activate New Deployment with this type of error:

Activate New Deployment 20220513020507912
Activated /home/cleavr/zmcfuwmmvbmk25b43466.cleaver.rocks/releases/20220513020507912/dist/ssr
PM2 ecosystem file is not linked. Linking...
PM2 ecosystem config hasn't changed since the last deployment. Reloading the app...
[PM2] Applying action reloadProcessId on app [zmcfuwmmvbmk25b43466.cleaver.rocks](ids: [ 60 ])
[PM2] [zmcfuwmmvbmk25b43466.cleaver.rocks](60) ✓
┌─────┬───────────────────────────────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id  │ name                                  │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├─────┼───────────────────────────────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 56  │ k7tmyepoiuiwmyn23466.cleaver.rocks    │ default     │ 0.0.1   │ cluster │ 1467427  │ 4m     │ 32   │ online    │ 0.3%     │ 7.2mb    │ cleavr   │ disabled │
│ 60  │ zmcfuwmmvbmk25b43466.cleaver.rocks    │ default     │ 0.0.1   │ cluster │ 1468766  │ 0s     │ 16   │ online    │ 0%       │ 37.4mb   │ cleavr   │ disabled │
└─────┴───────────────────────────────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
Force restarting the app
[PM2] Applying action deleteProcessId on app [zmcfuwmmvbmk25b43466.cleaver.rocks](ids: [ 60 ])
[PM2] [zmcfuwmmvbmk25b43466.cleaver.rocks](60) ✓
┌─────┬───────────────────────────────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id  │ name                                  │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├─────┼───────────────────────────────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 56  │ k7tmyepoiuiwmyn23466.cleaver.rocks    │ default     │ 0.0.1   │ cluster │ 1467427  │ 4m     │ 32   │ online    │ 0%       │ 7.5mb    │ cleavr   │ disabled │
└─────┴───────────────────────────────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
[PM2][WARN] Current process list is not synchronized with saved list. App zmcfuwmmvbmk25b43466.cleaver.rocks differs. Type 'pm2 save' to synchronize.
[PM2][WARN] Applications zmcfuwmmvbmk25b43466.cleaver.rocks not running, starting...
[PM2][ERROR] Error: Script not found: /home/cleavr/zmcfuwmmvbmk25b43466.cleaver.rocks/current/index.js

k7tmyepoiuiwmyn23466.cleaver.rocks is the “main” branch that works as expected.
zmcfuwmmvbmk25b43466.cleaver.rocks is set up to follow the “stage” branch on the repo.

I understand Cleavr has a staging feature that syncs files from one site to another. My motivation here is to leverage separate code bases with pull requests as a means to update dev, stage, and prod sites.

Any suggestions as to where I took a wrong turn? Or should I be using the Staging/Sync option with one single repo branch?

Many Thanks…

Hello there,

These look like Quasar apps with dist/ssr as artifact paths. If so, all you need to do is point cwd (current working directory) in your pm2 config file to artifact rather than current (current by default points to the “whole” directory and it is not finding index.js file, which is inside /dist/ssr folder and is actually pointed by artifact) and then redeploy:


cwd: “/home/cleavr/zmcfuwmmvbmk25b43466.cleaver.rocks/current”,

cwd: "/home/cleavr/zmcfuwmmvbmk25b43466.cleaver.rocks/artifact",

You can change your pm2 config from within Cleavr by going to Deployment > Settings > Build

Since we no longer save pm2 config for security reasons (it could contain passwords and what not), this is a manual change for now. We are considering how to make this automatic for new sites.

Please let me know if that resolves for you or not.

2 Likes

I appreciate your help despite the lack of full info on my part. Yes, these are indeed Quasar apps. I’ve updated the pm2 settings to point to the artifact file and deployment works as expected. Thank you!