"502 Server Error" during Cloud-Build Deployment with customized nginx-config

60 views
Skip to first unread message

Titus Keuler

unread,
May 22, 2019, 1:29:03 PM5/22/19
to Google App Engine

Hey,

we see a "502 Server Error" status during CloudBuild processes changes for our production website during the service is being updated.
It seems like the traffic is already routed to the new machine, while the provisioning is still in progress.

We do use "nginx_conf_override" in our app.yaml to customize the default nginx.conf like so:


# enforce https
if ($http_x_forwarded_proto = "http") {
return 301 https://$host$request_uri;
}


location ~ \.php$ {
try_files $uri /index.php$is_args$args;
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass php-fpm;
fastcgi_buffer_size 16k;
fastcgi_buffers 256 16k;
fastcgi_busy_buffers_size 4064k;
fastcgi_max_temp_file_size 0;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_read_timeout 600s;
}



While running perfectly fine when service has finished the build, we would like to avoid that "downtime" (up to 5 min) during the build. Any advice from your side?
Thank you very much.

Best,
Titus

Harmit Rishi (Cloud Platform Support)

unread,
May 24, 2019, 5:04:56 PM5/24/19
to google-a...@googlegroups.com
Hi, 

Based on what you have described, it seems you are encountering issues during the deploy step of your build. The downtime may be related the App engine environment that you have set up. If you are on flexible, there is a known issue of prolonged serving time to be within the minutes range. You may find further details about this here

Additionally, you may find the best practices document here useful as there are a few tips and tricks included for speeding up builds. Please feel free to determine if "Building leaner containers" would be useful in your use case as this helps separate the building of the application within your container image thus reducing extra time.     
Reply all
Reply to author
Forward
0 new messages