plesk / centos2alma

CentOS 7 to AlmaLinux 8 conversion tool
Apache License 2.0
39 stars 10 forks source link

[Resolved] All websites that use Apache (Nginx forwards requests to Apache) show 502 Bad Gateway after upgrade #372

Open fbroen opened 1 month ago

fbroen commented 1 month ago

The upgrade from CentOS 7.9 to AlmaLinux 8 went smoothly. The upgrade tool also did not indicate any problems. After the upgrade was complete, all websites that only used NGINX in proxy mode were no longer accessible. Only the websites that only used NGINX worked.

We have already tried to check for errors and repair them using the Plesk "Diagnostics & Repair" function. No improvement or change could be found here.

We also tried to follow these instructions, which also did not work: https://support.plesk.com/hc/en-us/articles/12377559249559-Site-does-not-work-on-PHP-FPM-handler-on-Plesk-server-503-service-unavailable

We also checked fail2ban. All server IP addresses are on the whitelist. We also deleted/activated all blocked IP addresses again for testing purposes.

Attached are screenshots of the problem and the errors.

I hope there is a quick fix for this. I had to reset the server to a snapshot before the upgrade.

Best regards Falk

502_bad_gateway_from_all_websites_using_apache_fpm

plesk_domain_logs_connection_refused_nginx

plesk_php_settings_repair

fbroen commented 1 month ago

@SandakovMM Do you have any ideas about that problem/bug?

fbroen commented 4 weeks ago

@SandakovMM

After another attempt with the migration script 1.4.3, the same error occurred again. Short Solution: Apache Module watchdog was not enabled after Upgrade to AlmaLinux 8.

After careful analysis, I found that the Apache service had not started and was in an error state.

I checked the status of the Apache service on AlmaLinux 8 with the following command:

systemctl status httpd

After this service could not be set to the status "Active: active (running)" even after a restart, I checked the log file:

cat /etc/httpd/logs/error_log

The output provided a clue as to what the problem was:

[Sun Oct 27 20:53:29.495534 2024] [lbmethod_heartbeat:notice] [pid 93807:tid 140021804460352] AH02282: No slotmem from mod_heartmonitor

[Sun Oct 27 20:53:29.617938 2024] [proxy_hcheck:crit] [pid 93807:tid 140021804460352] AH03262: mod_watchdog is required [Sun Oct 27 20:53:29.618025 2024] [:emerg] [pid 93807:tid 140021804460352] AH00020: Configuration Failed, exiting

After the command to monitor the ports on which Apache must listen also produced no output:

netstat -tunap | grep httpd

I found it on the Internet: https://support.plesk.com/hc/en-us/articles/12377651410839-Unable-to-start-Apache-on-a-Plesk-server-AH02093-mod-watchdog-is-required

After I applied this KB article (Tools & Settings --> Apache Webserver --> check the watchdog box), the problem was solved.

By the way, temporarily disabling and re-enabling nginx reverse proxy didn't help before finding a solution. The problem remained. Nevertheless, this test may be helpful for one or the other, so I am also linking this KB article:

https://support.plesk.com/hc/en-us/articles/12377745816599-How-to-install-and-enable-nginx-reverse-proxy-on-a-Plesk-for-Linux-server

nginx status: /usr/local/psa/admin/sbin/nginxmng --status temporarily disable nginx: /usr/local/psa/admin/sbin/nginxmng --disable re-enable nginx: /usr/local/psa/admin/sbin/nginxmng --enable

SandakovMM commented 3 weeks ago

Hello @fbroen I apologize for the delayed response, was occupied with publishing tasks. Thank you for your thorough investigation! Let's keep this issue open until we add an action to re-enable the watchdog module during conversion, in case someone else face the same problem.