From cb18b60c5deefcff207ca5e7ec09ef7cb39432d5 Mon Sep 17 00:00:00 2001 From: grossmj Date: Tue, 17 Mar 2026 13:23:19 +0800 Subject: [PATCH] Ignore HTTPException received when closing a project --- gns3server/controller/project.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gns3server/controller/project.py b/gns3server/controller/project.py index 98597649d..7cdec6022 100644 --- a/gns3server/controller/project.py +++ b/gns3server/controller/project.py @@ -15,7 +15,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import sys import re import os import json @@ -30,6 +29,7 @@ import zipfile import pathlib from uuid import UUID, uuid4 +from fastapi import HTTPException, status from .node import Node from .compute import ComputeError @@ -837,7 +837,11 @@ class Project: log.warning(f"Closing project '{self.name}' ignored because it is being loaded") return self._closing = True - await self.stop_all() + try: + await self.stop_all() + except HTTPException as e: + if not e.status_code == status.HTTP_405_METHOD_NOT_ALLOWED: + raise for compute in list(self._project_created_on_compute): try: await compute.post(f"/projects/{self._id}/close", dont_connect=True)