We have a custom Docker image that runs a Tomcat and exposes port 7000 to handle traffic. We store this image in a container registry accessible from our Azure subscription.
We deploy the image using Azure App Service and use the WEBSITES_PORT
configuration to bind the port 7000. However, the App Service fails to start with the following error in the App Service logs
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib64/az/lib/python3.6/site-packages/urllib3/connection.py", line 175, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "/usr/lib64/az/lib/python3.6/site-packages/urllib3/util/connection.py", line 96, in create_connection
raise err
File "/usr/lib64/az/lib/python3.6/site-packages/urllib3/util/connection.py", line 86, in create_connection
sock.connect(sa)
OSError: [Errno 113] No route to host
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib64/az/lib/python3.6/site-packages/urllib3/connectionpool.py", line 706, in urlopen
chunked=chunked,
File "/usr/lib64/az/lib/python3.6/site-packages/urllib3/connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "/usr/lib64/az/lib/python3.6/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn
conn.connect()
File "/usr/lib64/az/lib/python3.6/site-packages/urllib3/connection.py", line 358, in connect
conn = self._new_conn()
File "/usr/lib64/az/lib/python3.6/site-packages/urllib3/connection.py", line 187, in _new_conn
self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7ff2e335b358>: Failed to establish a new connection: [Errno 113] No route to host
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib64/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib64/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/custom.py", line 2598, in _get_log
preload_content=False
File "/usr/lib64/az/lib/python3.6/site-packages/urllib3/request.py", line 75, in request
method, url, fields=fields, headers=headers, **urlopen_kw
File "/usr/lib64/az/lib/python3.6/site-packages/urllib3/request.py", line 96, in request_encode_url
return self.urlopen(method, url, **extra_kw)
File "/usr/lib64/az/lib/python3.6/site-packages/urllib3/poolmanager.py", line 375, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File "/usr/lib64/az/lib/python3.6/site-packages/urllib3/connectionpool.py", line 796, in urlopen
**response_kw
File "/usr/lib64/az/lib/python3.6/site-packages/urllib3/connectionpool.py", line 796, in urlopen
**response_kw
File "/usr/lib64/az/lib/python3.6/site-packages/urllib3/connectionpool.py", line 796, in urlopen
**response_kw
File "/usr/lib64/az/lib/python3.6/site-packages/urllib3/connectionpool.py", line 756, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/usr/lib64/az/lib/python3.6/site-packages/urllib3/util/retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='[app-service-name].scm.[ase-name].appserviceenvironment.net', port=443): Max retries exceeded with url: /logstream (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7ff2e335b358>: Failed to establish a new connection: [Errno 113] No route to host',))
My guess is when the App Service starts it pulls some code from the SCM url.
The App Service is deployed in a NSG with ports 80/443 open to both inbound and outbound traffic.
2
Answers
The problem could be that you are binding to port 7000, but only ports 80/443 are open.
Therefore, there is no route to host.
Can you post the settings of your nginx?