subutai-io / snap

Required files to build SS snap package using snapcraft tool
1 stars 8 forks source link

Nginx fails abruptly #272

Open dilshat opened 6 years ago

dilshat commented 6 years ago

Error log 2018/02/24 18:04:07 [emerg] 2044#2044: host not found in upstream "archive.ubuntu.com" in /snap/subutai-master/current/etc/nginx/nginx.conf:54

Mentioned config excerpt:

53 location /apt/main/dists {
54   proxy_pass              http://archive.ubuntu.com/ubuntu/dists/;
55   proxy_cache             DEBIDX;
56   proxy_cache_valid       5m;
57 }
happyaron commented 6 years ago

This happens like a race condition: when nginx starts, it tries to validate the configuration, but at the same time network might be not ready on certain situations - which makes nginx dies thinking the configured upstream is wrong. We have several ways to make this work:

  1. start nginx after domain name can be resolved, e.g. we started dnsmasq successfully
  2. increase nginx's retries
  3. specify a special resolver to nginx, and let it resolve to something static if failed to get it in upstream
dilshat commented 6 years ago

@happyaron we need to try to use newer version of nginx to allow the changes described above. Please conduct tests with newer nginx version and snap,

happyaron commented 6 years ago

Ack

etursunbaev commented 6 years ago

Team Infra also think Nginx should be updated to latest version.