Ecosystem.json overwritten during deployment

Our deployment for only one of our two nodejs servers rewrites the eccosystem.json for pm2, How can this behaviour be managed

Hello Richard,

We are hoping you can provide us with more information on how you are confirming that the ecosystem file is being overwritten. Additionally, are you experiencing any difficulties accessing the site immediately after a deployment?

My recollection of using the PM2 panel shown was that changes made within the editor were preserved. That seems to be not the case today. I was able to find that the .cleavr…config.js however is the source of the ecosystem.json file, or at least the changes there are what counts. I am pondering whether to uninstall and reinstall cleavr because perhaps it’s state has been corrupted. I’ll probably not do that as it is on a production system though.

Hello Richard,

If I’m understanding your concern correctly any changes made to ecosystem.json file or any other files externally will not be reflected.

You can update PM2 Ecosystem from Deployment Workflow > PM2 > PM2 Ecosystem. Once you update the config from there and click the update button you need to re-deploy the application for the changes to be reflected.

Additinally, any files created locally on the server will not be included in the next deployment. Only files stored in the repository and those that are symlinked will persist across deployments.

Not exactly what I intended. I meant that the changes to the ecosystem.json file made via the GUI are not saved, but overwritten in the deployment process. This is not the behavior that I remember

Hi Richard,

We’ve noticed that the PM2 Ecosystem for med.anydish.me is not updating due to a syntax error. Unfortunately, the UI is currently hiding the error message.

We are working to resolve this issue and make the error message visible again. In the meantime, please check the ecosystem config for any syntax errors.

Thanks that a bit beyond the call to duty, but it also explains a great deal. We have two deployments on that server, one for staging and one for production. On the staging server any changes made with the UI are persisted, so I’ll look at the syntax of the file an correct any errors then try again.

Thanks

OK. Looks good. Took the ecosystem.json from the GUI for staging then copied it over the one for production, made the changes and lo and behold, any changes are saved and things are back to working well. Thanks

1 Like