From ce97d0fa43d52cc6aca2a88a04330b31bcaf7db9 Mon Sep 17 00:00:00 2001 From: weedy Date: Sun, 8 Mar 2026 20:37:45 -0400 Subject: [PATCH 1/2] Add timeout to URL request Executes Get_Update_String on startup to check for newer versions by querying the GitHub API. Because the DNS was unreachable, urllib.request.urlopen(URL) hung indefinitely waiting for a response, ultimately throwing a socket.gaierror: [Errno -3] Temporary failure in name resolution. FIX: Add a timeout so restarting the container when the internet is down allows you to continue. Signed-off-by: weedy --- nutcase/app/app/utils/webhook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nutcase/app/app/utils/webhook.py b/nutcase/app/app/utils/webhook.py index 25a82ca..3007ce5 100644 --- a/nutcase/app/app/utils/webhook.py +++ b/nutcase/app/app/utils/webhook.py @@ -9,7 +9,7 @@ # ================================================================================================== def Call_URL(app, URL): try: - Response = urllib.request.urlopen(URL) + Response = urllib.request.urlopen(URL, timeout=3) HTTP_Code = Response.getcode() if HTTP_Code != HTTPStatus.OK: app.logger.warning("WebHook returned {}: {}".format( From 9b683f095f1ab113354d745cdc371d6d8aa33b03 Mon Sep 17 00:00:00 2001 From: weedy Date: Sun, 8 Mar 2026 20:38:58 -0400 Subject: [PATCH 2/2] Set timeout for GitHub API request Executes Get_Update_String on startup to check for newer versions by querying the GitHub API. Because the DNS was unreachable, urllib.request.urlopen(URL) hung indefinitely waiting for a response, ultimately throwing a socket.gaierror: [Errno -3] Temporary failure in name resolution. FIX: Add a timeout so restarting the container when the internet is down allows you to continue. Signed-off-by: weedy --- nutcase/app/app/api/api_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nutcase/app/app/api/api_utils.py b/nutcase/app/app/api/api_utils.py index 941e950..c350ad7 100644 --- a/nutcase/app/app/api/api_utils.py +++ b/nutcase/app/app/api/api_utils.py @@ -16,7 +16,7 @@ def Get_Update_String(): Result = "" try: URL = current_app.config['GITHUB_API_URL'] + "releases" - Response = urllib.request.urlopen(URL) + Response = urllib.request.urlopen(URL, timeout=3) HTTP_Code = Response.getcode() if HTTP_Code != HTTPStatus.OK: current_app.logger.warning("Github returned {}: {}".format(