diff --git a/CHANGELOG b/CHANGELOG index debd74ce..4169cafd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,10 @@ # Change Log +## 2.2.44.1 07/11/2023 + +* Catch exceptions when computing image checksums. Ref https://github.com/GNS3/gns3-server/issues/2228 +* Add freeze_support() for multiprocessing + ## 2.2.44 06/11/2023 * Bundle web-ui v2.2.44 diff --git a/gns3server/crash_report.py b/gns3server/crash_report.py index 866ad06a..f3ab0858 100644 --- a/gns3server/crash_report.py +++ b/gns3server/crash_report.py @@ -57,7 +57,7 @@ class CrashReport: Report crash to a third party service """ - DSN = "https://dcbac52ef824b8386b67cc8f07c4de70@o19455.ingest.sentry.io/38482" + DSN = "https://eb1150edfa1530053154ff1fcb67afd1@o19455.ingest.sentry.io/38482" _instance = None def __init__(self): diff --git a/gns3server/main.py b/gns3server/main.py index 10ed2bf9..255bfc5a 100644 --- a/gns3server/main.py +++ b/gns3server/main.py @@ -31,6 +31,7 @@ import gns3server.utils.get_resource import os import sys import types +import multiprocessing # To avoid strange bug later we switch the event loop before any other operation if sys.platform.startswith("win"): @@ -79,6 +80,9 @@ def main(): if not sys.platform.startswith("win"): if "--daemon" in sys.argv: daemonize() + else: + multiprocessing.freeze_support() + from gns3server.run import run run() diff --git a/gns3server/version.py b/gns3server/version.py index f2712a6e..e390ee36 100644 --- a/gns3server/version.py +++ b/gns3server/version.py @@ -23,8 +23,8 @@ # or negative for a release candidate or beta (after the base version # number has been incremented) -__version__ = "2.2.44" -__version_info__ = (2, 2, 44, 0) +__version__ = "2.2.44.1" +__version_info__ = (2, 2, 44, -99) if "dev" in __version__: try: diff --git a/gns3server/web/web_server.py b/gns3server/web/web_server.py index fd116b39..c10c576b 100644 --- a/gns3server/web/web_server.py +++ b/gns3server/web/web_server.py @@ -29,7 +29,6 @@ import functools import time import atexit import weakref -import concurrent.futures # Import encoding now, to avoid implicit import later. # Implicit import within threads may cause LookupError when standard library is in a ZIP @@ -238,11 +237,18 @@ class WebServer: Compute image checksums. """ + if sys.platform.startswith("darwin") and hasattr(sys, "frozen"): + # do not compute on macOS because errors + return loop = asyncio.get_event_loop() + import concurrent.futures with concurrent.futures.ProcessPoolExecutor(max_workers=1) as pool: - log.info("Computing image checksums...") - await loop.run_in_executor(pool, list_images, "qemu") - log.info("Finished computing image checksums") + try: + log.info("Computing image checksums...") + await loop.run_in_executor(pool, list_images, "qemu") + log.info("Finished computing image checksums") + except OSError as e: + log.warning("Could not compute image checksums: {}".format(e)) async def _on_startup(self, *args): """