From 629835fc0eb6b53ee36109ffa9d9dbf897ed6538 Mon Sep 17 00:00:00 2001 From: Ted Kolberg Date: Fri, 29 May 2026 15:51:35 -0400 Subject: [PATCH 1/3] CheckInGUI: make get_previous_test_results fail safe Add a request timeout and return empty results on a non-marker / error response (correct for a new board) instead of crashing with an UnboundLocalError on begin1, or freezing the GUI on a no-timeout POST. --- CheckInGUI/PythonFiles/Data/DBSender.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CheckInGUI/PythonFiles/Data/DBSender.py b/CheckInGUI/PythonFiles/Data/DBSender.py index 29d6adaa..96f757d7 100644 --- a/CheckInGUI/PythonFiles/Data/DBSender.py +++ b/CheckInGUI/PythonFiles/Data/DBSender.py @@ -94,7 +94,11 @@ def get_usernames(self): # Whether or not DB has passing results def get_previous_test_results(self, full_id): - r = requests.post('{}/get_previous_test_results.py'.format(self.db_url), data={'full_id': str(full_id)}) + try: + r = requests.post('{}/get_previous_test_results.py'.format(self.db_url), data={'full_id': str(full_id)}, timeout=10) + except requests.exceptions.RequestException as e: + logger.error("get_previous_test_results.py request failed (%s); treating board as having no prior results.", e) + return [], [] lines = r.text.split('\n') try: @@ -104,9 +108,10 @@ def get_previous_test_results(self, full_id): end2 = lines.index("End2") begin3 = lines.index("Begin3") + 1 end3 = lines.index("End3") - except: - logger.error("There was an issue with the web API script `get_previous_test_results.py`. There is likely a syntax error in an associated web API script.") + except ValueError: + logger.error("There was an issue with the web API script `get_previous_test_results.py` (no Begin/End markers in response); treating board as having no prior results.") logger.debug(r.text) + return [], [] tests_run = [] outcomes = [] From f153b31ec27b2c9e09e3761e329130efd52084f9 Mon Sep 17 00:00:00 2001 From: Ted Kolberg Date: Fri, 29 May 2026 15:51:35 -0400 Subject: [PATCH 2/3] CheckInGUI: ensure JSONFiles dir exists before send_to_DB writes open(...,'w') does not create missing parent dirs, so a fresh checkout hit FileNotFoundError writing JSONFiles/storage.json. Create it with os.makedirs(exist_ok=True). --- CheckInGUI/PythonFiles/Data/DataHolder.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CheckInGUI/PythonFiles/Data/DataHolder.py b/CheckInGUI/PythonFiles/Data/DataHolder.py index 3f693dd9..70626a04 100644 --- a/CheckInGUI/PythonFiles/Data/DataHolder.py +++ b/CheckInGUI/PythonFiles/Data/DataHolder.py @@ -170,6 +170,8 @@ def send_to_DB(self): info_dict = {"full_id":self.get_full_ID(),"tester": self.data_dict['user_ID'], "test_type": test_name, "successful": self.data_dict["inspection_pass"], "comments": self.data_dict['comments']} logger.debug(info_dict) + os.makedirs("{}/JSONFiles".format(PythonFiles.__path__[0]), exist_ok=True) + with open("{}/JSONFiles/storage.json".format(PythonFiles.__path__[0]), "w") as outfile: json.dump(info_dict, outfile) From 8ef480fcc465f4c5a2496802328c2fda63857ea6 Mon Sep 17 00:00:00 2001 From: Ted Kolberg Date: Fri, 29 May 2026 15:51:35 -0400 Subject: [PATCH 3/3] Configs: point motherboard DB baseURL at phy-k619lf-a hostname The committed IP (128.186.110.114) is stale; the DB host has changed IP multiple times. Use the FQDN so the URL survives future IP changes. --- Configs/WM_cfg.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Configs/WM_cfg.yaml b/Configs/WM_cfg.yaml index e6b47afa..0036e6c8 100644 --- a/Configs/WM_cfg.yaml +++ b/Configs/WM_cfg.yaml @@ -1,7 +1,7 @@ --- DBInfo: admin: FactoryInserter - baseURL: http://128.186.110.114/Factory/mbDB + baseURL: http://phy-k619lf-a.hep.fsu.edu/Factory/mbDB inserter: FactoryInserter name: mbdb reader: FactoryReadUser