Two websites went 502 after migration
Last Saturday we received the following email:
"Hello esmetinc! The following activity has recently occurred:
- linode7848043 - (480726864) Live Migration - Sat, 11 Nov 2023 09:15:24 GMT…"
Monday morning we noticed two of the website were "502 Bad Gateway". I called Linode support and all they could do was verify the two websites and domains were nowhere (and no history of them ever being there) and sent links to do research on my own.
The two missing websites ip adresses are the same as our Linode.
I added one of the missing domain names to the domains list just to see if that would work and am still getting 502. Also the two 502 websites are on the same sftp and the one that is still working is on another that no one knows the credentials to (long story).
Is it possible they left the other two behind during the migration?
Is it possible to find out where the running website files are?
I'm not familiar with any of this so any help is appreciated.
Thanks in advance!
Since you're seeing a 502 Bad Gateway error, this looks related to the services your website needs to serve the website. That means it's something either the services running on your Linode or an upstream service that your website relies on to serve your website.
A live migration is where we copy a Linode from one host to another. Our Live Migrations at Linode | Akamai blog post covers the nuts and bolts of how it works more if you're interested. While live migrations have a great track record with us, we have seen issues from time to time. Since they are dealing with the Linode as a whole, the issue you would likely see would be a server-wide connectivity issue or networking problem.
502 Bad Gateway
A 502 Bad Gateway is a server-side response the web server service provides when it cannot connect to a service that it requires to serve the website. An example of this could be the well-known LAMP stack (Linux OS, Apache web server, MySQL database, PHP programming language). If a site that was built on the LAMP stack returns a 502, it could be that Apache is unable to connect to the MySQL or PHP services.
The Mozilla 502 Bad Gateway documentation frames this as an issue when the web server is acting as a gateway or proxy and receives an invalid response from the upstream server.
In both cases, the web server service cannot get something it needs to serve the website.
Troubleshooting \ Fixing the issue
With this context, if this were my website I would start with one of two approaches here. It would depend on priorities:
If I need to get the website running as soon as I can, I would start by restarting services and then begin to investigate the root cause. This is usually as simple as running
sudo systemctl restart nginxto restart NGINX if that's the web server.
Should I have some time to investigate the cause of the 502 response, I would start reviewing various service logs. The first I'd look into would be the web server logs. They're usually stored in
/var/log/, then in a directory for the service itself (
/var/log/nginx, etc). The logs might not provide the smoking gun, though they will at least provide something more than the 502 message.