502. need to restart after deployment

hey there,

i have a project set up where i get a 502 error very reliably after each deployment.

Restarting/reloading the app leads to the error being gone.

Any ideas?

Let me know if i can help.

Sebastian

Hello Sebastian,

Can you please provide more details? What type of app is this?

I usually see 502’s with NodeJS apps for various reasons. First step is to check out the troubleshooting guide here: NodeJS Deployments Troubleshooting - Cleavr docs

As well as check out the logs: the app logs in the web app section and the logs section under servers are typically the most helpful.

thank you for getting back at me so fast.

i checked the troubleshooting docs before i posted here so no chance here :frowning:

also the error is easily gone by restarting the app which seems like a special case to me. I think we already reported this some time ago.

It’s a nuxt SSR app. Here’s the link to the app if that helps:
https://app.cleavr.io/webapps/36a75894-11dd-4d2a-9f72-48093e30a185/logs

here are some screenshots of the logs. Not sure how to read them properly though:

pm2 logs looking fine:

Thank you for your help. Let me know if can help.

Sebastian

Hello @sebbler,

We’ve figured out the issue. The app runs in cluster mode even after the configs are set to run in fork mode. We made a quick fix a few months ago which was working and suddenly it seems to be stopped working for some reason.

We’ve already started researching the possible causes and fixes to overcome this. We’ll keep you updated about the new changes/progress we’ll make.

2 Likes

Hello @sebbler,

If you’re still facing this issue you can now go to Webapp < Settings < Build and check the PM2 Ecosystem. If your server has a single CPU and the config contains exec_mode: cluster_mode you can change it to fork_mode and change instances to 1 or remove the line completely.

For new webapps it should work without having to make any changes (Unless the server isn’t a custom server). For any old webapps, you can make the required changes and click on update button. The app may stop responding for 2-3 seconds after updating.

Thank you for getting back at me.

The Build settings already have fork_mode and instances: 1 and still the app is not available after deployment.

See here, i didn’t change a thing since i first asked here:
image

Any advice or help would be very much appreciated. Thank you!

Sebastian