4152 Commits

Author SHA1 Message Date
Sanjay Santhanam
00ac2c19bd Do not start nodes when deleting a project
Project.delete() calls open() to rebuild the internal data structures
needed for cleanup. open() schedules start_all() when the project has
auto_start enabled, so deleting an auto-start project actually launched
every node process, allocating ports and consuming resources, only for
close() to kill them moments later.

open() now takes an auto_start argument (default True, so normal opens
are unchanged) and delete() passes auto_start=False.

Fixes #2784
2026-07-25 20:00:43 -07:00
Sanjay Santhanam
41e8777609 fix: correct always-true state check in DockerVM.stop()
The condition 'state != "stopped" or state != "exited"' is a tautology,
so the state check was a no-op and a stop request was sent even for a
container that had already exited.

_get_container_state() never returns "stopped" (only "running",
"paused" or "exited"), so the intended negation of the condition used in
_fix_permissions() requires 'and', not 'or' (De Morgan's law).

Added a regression test asserting no stop query is issued for an
already-exited container.
2026-07-25 10:30:16 -07:00
grossmj
803cc17410
Release v2.2.60 2026-07-15 18:36:26 +02:00
grossmj
f088c55cfe
Sync appliances 2026-07-15 18:32:12 +02:00
grossmj
1986bce538
Only set IOU images to be executable when importing images 2026-07-15 09:43:34 +02:00
grossmj
c528d2cd95
fix(import): project import does not move images symlinks into place 2026-07-13 18:19:52 +02:00
grossmj
61c7f4469d
Search for system UEFI that is compatible with Python < 3.12 2026-07-13 11:34:29 +02:00
grossmj
896b4fc56a
UEFI improvements for Qemu VMs
* Add OVMF firmware directory configuration
* Automatically add a Random Number Generator (RNG) device when using uefi option is enabled
2026-07-13 11:08:17 +02:00
grossmj
a58fa8602b
remove wrongly merged code 2026-07-13 10:05:01 +02:00
YueGuobin
d8f8b6ec70
fix(docker): handle container name conflict automatically
When a Docker container with the same name already exists (e.g., from a
   previous crashed GNS3 session), Docker returns a 409 Conflict error
   when trying to create a new container with that name. This causes the
   project open operation to fail.

   This fix adds automatic cleanup of stale containers when encountering
   a name conflict:
   - Added DockerHttp409Error exception class
   - Updated http_query to detect 409 status codes
   - Modified create() to remove conflicting containers and retry

   Fixes the issue where opening a project fails with:
   "Docker has returned an error: 409 Conflict. The container name
   '/GNS3.xxx' is already in use by container 'xxx'"
2026-07-13 09:57:55 +02:00
grossmj
ea09cc2724
fix: gns3-server crashes on startup if "Open this project in the background" is active but there is a problem with that project 2026-07-12 13:46:12 +02:00
grossmj
e3e0a511b6
Handle HTTPNotFound exception when retrieving compute status 2026-07-12 11:08:13 +02:00
grossmj
0ecaab4da0
Replace ControllerForbiddenError with aiohttp.web.HTTPForbidden for project deletion error handling 2026-07-12 11:05:15 +02:00
YueGuobin
40644f33e6
Fix: Check compute connectivity before open() during project deletion
Previously the disconnected compute check ran after open(), which would
block for 120s trying to connect to unreachable remote computes before
rejecting the deletion. Now reads the topology file directly to extract
compute IDs and checks connectivity before calling open(), enabling
immediate rejection of deletions involving offline computes.

Also removes the redundant post-open() check since the early check
covers both opened and closed project states.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-12 10:57:56 +02:00
Volobue
9106ac4522 api endpoint implemented 2026-05-18 21:49:01 +03:00
grossmj
c3d23d7cae
Development on 2.2.60.dev1 2026-05-08 20:03:31 +08:00
grossmj
59a95edd3d
Release v2.2.59 2026-05-08 19:06:04 +08:00
grossmj
e34a7afe79
Sync appliances 2026-05-08 19:03:14 +08:00
grossmj
b1c8ce8b58
Remove unneeded code 2026-05-08 18:56:56 +08:00
grossmj
b304511b5e
Fix snapshot restore does not work after export/import of project 2026-05-08 18:47:47 +08:00
grossmj
72f64ee60b
Warn to use 64-bit IOU images. Fixes #2716
32-bit IOU image support has been removed from the GNS3 VM.
2026-05-08 16:37:06 +08:00
grossmj
6551bf56f8
Tweak and merge changes from 3.0 branch 2026-05-08 15:36:40 +08:00
arl1984
de0d050689 Fix telnet console silent-proxy hang on non-ConnectionError exit (#2344)
The run() cleanup block was guarded by `except (ConnectionError, OSError):`,
so exits via asyncio.CancelledError or any other exception type skipped
cleanup. Result: `_reader_process` stays pinned to the dead reader and
`_get_reader()` returns None for every subsequent client — the silent-proxy
symptom described in #2344.

Convert the except block to try/finally so cleanup always runs, regardless
of how `_process()` exits. Also:
- catch asyncio.CancelledError + generic Exception (with log.exception) so
  unexpected failures don't swallow the cleanup
- reset `_current_read = None` after cancellation
- use `dict.pop(..., None)` instead of `del` to avoid KeyError races if
  the broadcast loop's timeout handler already removed the entry

Triggering pattern observed in practice: a diagnostic tool opens a console,
sends a few commands, and closes abruptly (e.g. from a test harness or
orchestration script that cancels its Task). If the `_process()` task was
awaiting on one of the `network_read` / `reader_read` futures at the time
of cancellation, the CancelledError propagates up through `run()` and
bypasses the ConnectionError-only except clause. The proxy accepts future
connections (the listen socket is still alive) but never forwards any data
because `_reader_process` never got reset.

Validated against gns3/gns3-server:latest (2.2.56.1) running a 10-scenario
sequential regression batch that previously hung reliably on the 4th
sp_v1 / L3VPN scenario and now completes cleanly across all 10.
2026-04-16 14:46:49 +00:00
grossmj
ae3ae46151
Development on 2.2.59.dev2 2026-04-12 21:17:17 +08:00
grossmj
58fc6a8478
Release v2.2.58.1 2026-04-12 20:59:20 +08:00
grossmj
d9b8d0d1ff
Sync appliances 2026-04-12 20:49:56 +08:00
grossmj
2b0b31b402
Merge branch 'master' into 2.2 2026-04-12 20:47:14 +08:00
grossmj
4a47151526
Development on 2.2.59.dev1 2026-04-11 18:05:54 +08:00
Jeremy Grossmann
264fffbc6c
Potential fix for pull request finding 'CodeQL / Information exposure through an exception'
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-04-11 17:34:53 +08:00
grossmj
a295d653b8
Release v2.2.58 2026-04-10 20:36:01 +08:00
grossmj
c6eec799fb
Remove old files 2026-04-10 20:27:46 +08:00
grossmj
8503840307
Bundle web-ui v2.2.58 2026-04-10 20:24:16 +08:00
grossmj
c4dbecc1ea
Sync appliances 2026-04-10 20:11:16 +08:00
grossmj
161e016594
Remove log message 2026-04-10 19:58:55 +08:00
grossmj
2670c68467
Last adjustments for import/export 2026-04-10 18:58:21 +08:00
grossmj
6f7730c455
Update snapshots when duplicating a project 2026-04-09 23:18:55 +08:00
grossmj
274cef6cf5
Add description for snapshots 2026-04-09 20:25:44 +08:00
grossmj
fbea9b655d
Fix issue when restoring a snapshot of a duplicated project 2026-04-08 22:16:47 +08:00
grossmj
6869f2d71d
Snapshot refactoring 2026-04-08 20:02:01 +08:00
Jeremy Grossmann
b222fba42c
Revert "Backport telnetlib3 changes" 2026-04-05 21:58:21 +08:00
grossmj
bc6374f7fc
Add keepalive mechanism using the NOP command 2026-04-05 13:30:38 +08:00
Cristi
c739a16d70
Improved exception handling and telnet client disconnect 2026-04-05 13:29:35 +08:00
Cristi
7684ce60ce
Backport: Re-write current Telnet server implementation using telnetlib3 library 2026-04-05 13:29:25 +08:00
grossmj
e5ff9e7f00
Development on 2.2.58.dev1 2026-03-24 08:35:49 +08:00
grossmj
7adb0c5226
Release v2.2.57 2026-03-23 09:45:46 +08:00
grossmj
667833dda5
Merge remote-tracking branch 'origin/master' into 2.2 2026-03-23 09:38:13 +08:00
grossmj
646ff00ade
Sync appliances 2026-03-23 09:37:15 +08:00
YueGuobin
ffcfa4ccb1
feat(telnet_server): improve error handling and connection management
- Catch OSError alongside ConnectionError in connection processing to handle more network errors
- Move client_info retrieval inside try block to prevent AttributeError on failed connections
- Replace bare except with specific exceptions (OSError, ConnectionError, asyncio.TimeoutError)
- Improve error logging to include specific exception details and client information
2026-03-15 23:07:06 +08:00
grossmj
0624c1b945
Deactivate 'use default IOU values' by default and update RAM/NVRAM values 2026-03-10 20:28:00 +08:00
grossmj
b658f7ff68
Make sure the node shows as stopped when the wrap console cannot be stopped. Ref https://github.com/GNS3/gns3-registry/pull/1010 2026-03-09 17:10:00 +08:00