You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# error codes that represent a dns issueDNS_ISSUES= [...]
classDnsProblemError(Exception):
pass@retry(retry=retry_if_exception_type(DnsProblemError))defdownload_image(image_url, target_file):
...
try:
urllib.request.urlretrieve(image_url, target_file)
excepturllib.error.URLErrorasex:
iftype(ex.reason) ==socket.gaierrorandex.reason.errnoinDNS_ISSUES:
raiseDnsProblemError(ex)
Stacktrace seen in the CI
2022-05-21 12:10:00 [INFO] Downloading image bionic
2022-05-21 12:10:00 [INFO] Downloading http://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img ...
2022-05-21 12:10:10 [ERROR] {'ceph': 'zaza-5c6d9259a4b4'}
2022-05-21 12:10:10 [ERROR] Model ceph (zaza-5c6d9259a4b4)
Traceback (most recent call last):
File "/usr/lib/python3.8/urllib/request.py", line 1354, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/usr/lib/python3.8/http/client.py", line 1256, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1302, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1251, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1011, in _send_output
self.send(msg)
File "/usr/lib/python3.8/http/client.py", line 951, in send
self.connect()
File "/usr/lib/python3.8/http/client.py", line 922, in connect
self.sock = self._create_connection(
File "/usr/lib/python3.8/socket.py", line 787, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/usr/lib/python3.8/socket.py", line 918, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ubuntu/src/review.opendev.org/openstack/charm-glance/.tox/func-target/bin/functest-run-suite", line 8, in <module>
sys.exit(main())
File "/home/ubuntu/src/review.opendev.org/openstack/charm-glance/.tox/func-target/lib/python3.8/site-packages/zaza/charm_lifecycle/func_test_runner.py", line 364, in main
func_test_runner(
File "/home/ubuntu/src/review.opendev.org/openstack/charm-glance/.tox/func-target/lib/python3.8/site-packages/zaza/charm_lifecycle/func_test_runner.py", line 277, in func_test_runner
run_env_deployment(env_deployment, keep_model=preserve_model,
File "/home/ubuntu/src/review.opendev.org/openstack/charm-glance/.tox/func-target/lib/python3.8/site-packages/zaza/charm_lifecycle/func_test_runner.py", line 151, in run_env_deployment
configure.configure(
File "/home/ubuntu/src/review.opendev.org/openstack/charm-glance/.tox/func-target/lib/python3.8/site-packages/zaza/charm_lifecycle/configure.py", line 51, in configure
run_configure_list(functions)
File "/home/ubuntu/src/review.opendev.org/openstack/charm-glance/.tox/func-target/lib/python3.8/site-packages/zaza/charm_lifecycle/configure.py", line 37, in run_configure_list
utils.get_class(func)()
File "/home/ubuntu/src/review.opendev.org/openstack/charm-glance/.tox/func-target/lib/python3.8/site-packages/zaza/openstack/charm_tests/glance/setup.py", line 164, in add_lts_image
add_image(image_url,
File "/home/ubuntu/src/review.opendev.org/openstack/charm-glance/.tox/func-target/lib/python3.8/site-packages/zaza/openstack/charm_tests/glance/setup.py", line 100, in add_image
openstack_utils.create_image(
File "/home/ubuntu/src/review.opendev.org/openstack/charm-glance/.tox/func-target/lib/python3.8/site-packages/zaza/openstack/utilities/openstack.py", line 2531, in create_image
download_image(image_url, local_path)
File "/home/ubuntu/src/review.opendev.org/openstack/charm-glance/.tox/func-target/lib/python3.8/site-packages/zaza/openstack/utilities/openstack.py", line 2253, in download_image
urllib.request.urlretrieve(image_url, target_file)
File "/usr/lib/python3.8/urllib/request.py", line 247, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.8/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/usr/lib/python3.8/urllib/request.py", line 542, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/usr/lib/python3.8/urllib/request.py", line 1383, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/usr/lib/python3.8/urllib/request.py", line 1357, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno -3] Temporary failure in name resolution>
The text was updated successfully, but these errors were encountered:
Due to dns instability the download_image() could fail, it would be nice if it was wrapped with a retry decorator
https://github.com/openstack-charmers/zaza-openstack-tests/blob/master/zaza/openstack/utilities/openstack.py#L2290
Stacktrace seen in the CI
The text was updated successfully, but these errors were encountered: