From b6e1f847401b2affd88b30d85f2f649f4e8b0f9e Mon Sep 17 00:00:00 2001 From: YueGuobin Date: Wed, 3 Jun 2026 12:18:28 +0800 Subject: [PATCH] Move running project check before fast duplication Move the is_running() check from _fast_duplication() to duplicate() to avoid the error message being wrapped by the except Exception handler. This ensures the error message is clean and prevents wasted fast duplication attempts on running projects. --- gns3server/controller/project.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gns3server/controller/project.py b/gns3server/controller/project.py index 0526df838..aa3b361e1 100644 --- a/gns3server/controller/project.py +++ b/gns3server/controller/project.py @@ -1334,6 +1334,9 @@ class Project: self.dump() assert self._status != "closed" + if self.is_running(): + raise ControllerError("Project must be stopped in order to duplicate it") + try: proj = await self._fast_duplication(name, reset_mac_addresses) if proj: