Scan aborts if RD53 database not reachable
At the moment, the scan aborts in case the database is not reachable:
(base) silab@silab48:~/git/bdaq53/bdaq53/scans$ python scan_digital_robust.py
2020-11-11 16:58:58,450 [DigitalScanRobust] - INFO Loading chip configuration for chip 0x0001 from /home/silab/git/bdaq53/bdaq53/scans/output_data/module_0/chip_0/20201111_164852_robust_digital_scan_interpreted.h5
2020-11-11 16:58:58,460 [DigitalScanRobust] - INFO Found 1 chip(s) of 1 module(s) defined in the testbench
2020-11-11 16:58:58,461 [DigitalScanRobust] - INFO Initializing DigitalScanRobust...
2020-11-11 16:58:58,461 [Periphery ] - NOTICE Periphery is disabled.
2020-11-11 16:58:58,479 [Database Manager ] - INFO Checking database for chip 0x0001...
Traceback (most recent call last):
File "/home/silab/anaconda3/lib/python3.7/urllib/request.py", line 1319, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/home/silab/anaconda3/lib/python3.7/http/client.py", line 1252, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/home/silab/anaconda3/lib/python3.7/http/client.py", line 1298, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/home/silab/anaconda3/lib/python3.7/http/client.py", line 1247, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/home/silab/anaconda3/lib/python3.7/http/client.py", line 1026, in _send_output
self.send(msg)
File "/home/silab/anaconda3/lib/python3.7/http/client.py", line 966, in send
self.connect()
File "/home/silab/anaconda3/lib/python3.7/http/client.py", line 938, in connect
(self.host,self.port), self.timeout, self.source_address)
File "/home/silab/anaconda3/lib/python3.7/socket.py", line 728, in create_connection
raise err
File "/home/silab/anaconda3/lib/python3.7/socket.py", line 716, in create_connection
sock.connect(sa)
OSError: [Errno 101] Network is unreachable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "scan_digital_robust.py", line 109, in <module>
with DigitalScanRobust(scan_config=scan_configuration) as scan:
File "/home/silab/git/bdaq53/bdaq53/system/scan_base.py", line 510, in __enter__
self.init()
File "/home/silab/git/bdaq53/bdaq53/system/scan_base.py", line 250, in init
self._init_environment()
File "/home/silab/git/bdaq53/bdaq53/system/scan_base.py", line 570, in _init_environment
self.chip = RD53A(self.bdaq, chip_sn=self.chip_settings['chip_sn'], chip_id=self.chip_settings['chip_id'], receiver=self.chip_settings['receiver'], config=self.chip_conf)
File "/home/silab/git/bdaq53/bdaq53/chips/rd53a.py", line 508, in __init__
manage_databases.check_chip_in_database(self.chip_type, self.chip_sn)
File "/home/silab/git/bdaq53/bdaq53/manage_databases.py", line 234, in check_chip_in_database
data = query_rd53a_db(chip_sn)
File "/home/silab/git/bdaq53/bdaq53/manage_databases.py", line 200, in query_rd53a_db
_cache_rd53a_db(outfile=cache_file)
File "/home/silab/git/bdaq53/bdaq53/manage_databases.py", line 85, in _cache_rd53a_db
urllib.request.urlretrieve(uri, outfile)
File "/home/silab/anaconda3/lib/python3.7/urllib/request.py", line 247, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "/home/silab/anaconda3/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/home/silab/anaconda3/lib/python3.7/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/home/silab/anaconda3/lib/python3.7/urllib/request.py", line 543, in _open
'_open', req)
File "/home/silab/anaconda3/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/home/silab/anaconda3/lib/python3.7/urllib/request.py", line 1347, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/home/silab/anaconda3/lib/python3.7/urllib/request.py", line 1321, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 101] Network is unreachable>
I guess we should skip the database check if its not reachable.