proxy component can log a lot of exceptions
The proxy component can log a lot of exception when a service is missing.
This hides the other important exception, so it would be good to take a look.
If it's normal error, we could just remove the backtrace.
2023-04-18 16:36:41,507 daiquiri.cli.server ERROR Exception on /api/proxy/tomovis/image_tiling/ [GET]
Traceback (most recent call last):
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/urllib3/connection.py", line 175, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/urllib3/util/connection.py", line 95, in create_connection
raise err
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/urllib3/util/connection.py", line 85, in create_connection
sock.connect(sa)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/gevent/_socketcommon.py", line 607, in connect
raise _SocketError(err, strerror(err))
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/urllib3/connectionpool.py", line 710, in urlopen
chunked=chunked,
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/urllib3/connectionpool.py", line 398, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/urllib3/connection.py", line 244, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/http/client.py", line 1281, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/http/client.py", line 1327, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/http/client.py", line 1276, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/http/client.py", line 1036, in _send_output
self.send(msg)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/http/client.py", line 976, in send
self.connect()
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/urllib3/connection.py", line 205, in connect
conn = self._new_conn()
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/urllib3/connection.py", line 187, in _new_conn
self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f8533890450>: Failed to establish a new connection: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/requests/adapters.py", line 499, in send
timeout=timeout,
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/urllib3/connectionpool.py", line 788, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='iccbm181.esrf.fr', port=8888): Max retries exceeded with url: /image_tiling/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f8533890450>: Failed to establish a new connection: [Errno 111] Connection refused'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/flask_restful/__init__.py", line 467, in wrapper
resp = resource(*args, **kwargs)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/flask/views.py", line 107, in view
return current_app.ensure_sync(self.dispatch_request)(**kwargs)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/flask/views.py", line 188, in dispatch_request
return current_app.ensure_sync(meth)(**kwargs)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/flask_apispec/annotations.py", line 122, in wrapped
return wrapper(*args, **kwargs)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/flask_apispec/wrapper.py", line 29, in __call__
response = self.call_view(*args, **kwargs)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/flask_apispec/wrapper.py", line 52, in call_view
return self.func(*args, **kwargs)
File "/home/blissadm/local/daiquiri.git/daiquiri/core/components/proxy.py", line 192, in proxy
response = method(full_url, headers=headers)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/requests/sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/requests/adapters.py", line 565, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='iccbm181.esrf.fr', port=8888): Max retries exceeded with url: /image_tiling/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f8533890450>: Failed to establish a new connection: [Errno 111] Connection refused'))
2023-04-18 16:36:43,508 daiquiri.cli.server ERROR Exception on /api/proxy/tomovis/image_tiling/ [GET]
Traceback (most recent call last):
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/urllib3/connection.py", line 175, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/urllib3/util/connection.py", line 95, in create_connection
raise err
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/urllib3/util/connection.py", line 85, in create_connection
sock.connect(sa)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/gevent/_socketcommon.py", line 607, in connect
raise _SocketError(err, strerror(err))
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/urllib3/connectionpool.py", line 710, in urlopen
chunked=chunked,
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/urllib3/connectionpool.py", line 398, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/urllib3/connection.py", line 244, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/http/client.py", line 1281, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/http/client.py", line 1327, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/http/client.py", line 1276, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/http/client.py", line 1036, in _send_output
self.send(msg)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/http/client.py", line 976, in send
self.connect()
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/urllib3/connection.py", line 205, in connect
conn = self._new_conn()
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/urllib3/connection.py", line 187, in _new_conn
self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f85331d7850>: Failed to establish a new connection: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/requests/adapters.py", line 499, in send
timeout=timeout,
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/urllib3/connectionpool.py", line 788, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='iccbm181.esrf.fr', port=8888): Max retries exceeded with url: /image_tiling/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f85331d7850>: Failed to establish a new connection: [Errno 111] Connection refused'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/flask_restful/__init__.py", line 467, in wrapper
resp = resource(*args, **kwargs)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/flask/views.py", line 107, in view
return current_app.ensure_sync(self.dispatch_request)(**kwargs)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/flask/views.py", line 188, in dispatch_request
return current_app.ensure_sync(meth)(**kwargs)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/flask_apispec/annotations.py", line 122, in wrapped
return wrapper(*args, **kwargs)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/flask_apispec/wrapper.py", line 29, in __call__
response = self.call_view(*args, **kwargs)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/flask_apispec/wrapper.py", line 52, in call_view
return self.func(*args, **kwargs)
File "/home/blissadm/local/daiquiri.git/daiquiri/core/components/proxy.py", line 192, in proxy
response = method(full_url, headers=headers)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/requests/sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "/users/blissadm/conda/miniconda/envs/daiquiri/lib/python3.7/site-packages/requests/adapters.py", line 565, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='iccbm181.esrf.fr', port=8888): Max retries exceeded with url: /image_tiling/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f85331d7850>: Failed to establish a new connection: [Errno 111] Connection refused'))
Edited by Valentin Valls