How to work with 502 returning from Google Cloud Load Balancer with copy of Google App Engine?

Summary:
I’ve been working on the Google Cloud Platform project for a long time and recently started getting quite frequent, but apparently random 502 years ago from the Google Cloud Load Balancer. I get these messages when I try to access an instance of a flexible instance of App Engine running nodejs. Split health checks (live and ready) are configured for the application kernel instance and are successful. 502 never appears in application logs only in load balancing logs. The application is configured to automatically scale with at least two instances, and in this small test environment, there has never been enough workload to actually add another instance. It seems that both instances are not under any real load, so they should respond without problems, but,just by clicking on the test page (which is very simple and almost not working), I can create 502. The load balancer says that it cannot connect to the backend, but with the backend healthy and not busy, I don’t see how it can be. Running code on the local system (which I understand from apples for comparing oranges) I do not see these errors or errors that can cause them.


Question:
How do I troubleshoot a problem using Google Load Balancer and App Engine? Are there any suggested fixes or settings that I could try?


Support for screenshots: Screenshots
1. Fragment of the load balancing log
2. Detailed description of the error of the load balancing
3. Fragment of the log of the health check

4. Using the CPU processor
5. Using the memory of the instance
6. Waiting time for the instance
7. Error in the browser
8. Success in the browser

+4
source share

Source: https://habr.com/ru/post/1685765/


All Articles