GNS3 / gns3-gui

GNS3 Graphical Network Simulator
http://www.gns3.com
GNU General Public License v3.0
2.17k stars 436 forks source link

[Bug][GNS3 2.2.48] - Path Is Not Allowed #3604

Closed WhatsTheIP closed 3 months ago

WhatsTheIP commented 3 months ago

GNS3 Version: GNS3 v2.2.48 Operating System: OS: Ubuntu 24.04 LTS x86_64


Overview:

Are there similar issues?

- Yes
- Were they resolved, no

[1] - https://gns3.com/community/support/the-path-is-not-allowed-permissions-error-linux [2] - https://www.reddit.com/r/gns3/comments/jf94t6/gns3_says_the_path_is_not_allowed/?rdt=41768 [3] - https://discourse.nixos.org/t/the-path-is-not-allowed-gns3/44796


How to replicate:

- Upgrade to GNS3 v2.2.48
- Launch GNS3
- Try to create a new project > I get the error.
- Try to open an old project > I get the error.

What was done to troubleshoot the issue [1]:

- Purge GNS3 files from problem device
- Reinstall GNS3 2.2.48 using: https://docs.gns3.com/docs/getting-started/installation/linux/
- Issue still persists

What was done to troubleshoot the issue [2]:

- Upgrade to Version 3.0.0 beta 3:
> https://github.com/GNS3/gns3-gui/releases/tag/v3.0.0b3
- Issue resolved

What was done to troubleshoot the issue [3]:

- Downgrade to Version 2.2.47:
> https://github.com/GNS3/gns3-gui/releases/tag/v2.2.47
- Issue resolved

What was done to troubleshoot the issue [4]:

- Running 2.2.48 as root appears to fix the issue as well:
> How to do: sudo gns3

Appears running gns3 --debug doesn't really provide much help but I found something odd.

I removed & recreated the GNS3 folder which contains the following:

GNS3 ls -la
total 31
drwxr-xr-x  7 <User> <Group>  7 Jul 19 10:59 .
drwxr-x--- 31 <User> <Group> 45 Jul 19 11:19 ..
drwxr-xr-x  2 <User> <Group>  2 Jul 19 10:55 appliances
drwxr-xr-x  2 <User> <Group>  7 Jul 19 10:59 configs
drwxr-xr-x  3 <User> <Group>  3 Jul 19 10:59 images
drwxr-xr-x  2 <User> <Group>  2 Jul 19 10:55 projects
drwxr-xr-x  2 <User> <Group>  2 Jul 19 10:55 symbols

I then recreated the folder structure with the same folders. However, whenever I try to create a project labeled "untitled" I get this error: - Project "untitled" already exists image


We can see that the file "untitled" doesn't exist in the folder via the following output:

projects ls -la
total 10
drwxr-xr-x 2 <User> <Group> 2 Jul 19 10:55 .
drwxr-xr-x 7 <User> <Group> 7 Jul 19 10:59 ..

The GNS3 client is apparently trying to save the file somewhere else other than it's default path which is outlined below, verified from the - "gns3_server.conf":

images_path = /home/gns3s3/GNS3/images
projects_path = /home/gns3s3/GNS3/projects
appliances_path = /home/gns3s3/GNS3/appliances
additional_images_paths = 
symbols_path = /home/gns3s3/GNS3/symbols
configs_path = /home/gns3s3/GNS3/configs

I was curious and thought to check the WebGUI to see if maybe it was stored there and apparently v2.2.48 for me is trying to save files whereever the webclient stores them because we can see the untitled project lives there, which explains why I am getting the error I am getting when trying to create a "new" project titled "untitled":


Confirmed I can create new projects from the WebGUI & I can open "old" projects from the WebGUI:

image

Lugib commented 3 months ago

Is there any workaround for this???

kakkotetsu commented 3 months ago

This case may be the same as the following issue. https://github.com/GNS3/gns3-server/issues/2403

The workaround is not to use systemd to start gns3-server.

WhatsTheIP commented 3 months ago

This case may be the same as the following issue. GNS3/gns3-server#2403

The workaround is not to use systemd to start gns3-server.

@kakkotetsu - Thanks this worked!

However, it's not really ideal since it seems to have a different configuration than when gns3 runs with the service running.

A bit hard to explain but all my uploaded network devices were "wiped" when starting the GNS3 client without the gns3-server services running.

Also, if you have remote servers as part of your topology the local gns3 GUI running on your device doesn't appear to make a connection to the remote gns3 server.

So a few things breaks with this workaround, this is definately a bug because I moved both my servers to Fedora 40 as a test & installed GNS3 .48 and I had no issues.

However, I rebuilt my servers & reinstalled Ubuntu 24.04 LTS x86_64 & gns3 from the ground up and I ran into this bug again.


@grossmj - Sorry to tag you, but are you able to look into this bug?

WhatsTheIP commented 3 months ago

Update.

Uninstalled all of GNS3 components from Ubuntu servers & reinstalled.

At the prompt that asks for "would you like GNS3 to run as a service" select no

Issue appears to be resolved, thanks @kakkotetsu

@grossmj - FYI, additional context if you need it to troubleshoot.

@Lugib - Try this work around.


Confirmed the [BUG] - "Path Is Not Allowed" appears whenever you start the gns3server.service. Confirmed the [BUG] - "Path Is Not Allowed" disappears whenever you stop the gns3server.service.

Affected system: GNS3 Version: GNS3 v2.2.48 Operating System: OS: Ubuntu 24.04 LTS x86_64

WhatsTheIP commented 3 months ago

Found a work around on how to resolve the issue while preserving remote server connectivity & keeping my topology & nodes intact.

I'm adding this as a note for now for historical purposes, updating the bug link below with my work around if others face this issue:


IMPORTANT:

1) - Make sure you kill the gns3server 1st before you attempt to run gns3server --local from the CLI.

2) - If you don't know how to do that, go down below you'll see where I identify if the gns3server service is running and how I killed it.

3) - You don't need to run --debug but I did it to troubleshoot the issue to see if the server or client returned any logs.


Troubleshooting section.

_________________________________
= [Verify GNS3 Server Services] =
_________________________________

sudo systemctl status gns3server.service 
○ gns3server.service - GNS3 server
     Loaded: loaded (/usr/lib/systemd/system/gns3server.service; enabled; preset: enabled)
     Active: inactive (dead) since Wed 2024-07-24 15:11:09 PDT; 10min ago
   Duration: 3min 30.040s
    Process: 2759 ExecStart=/usr/bin/gns3server (code=exited, status=0/SUCCESS)
   Main PID: 2759 (code=exited, status=0/SUCCESS)
        CPU: 1.602s

Jul 24 15:11:09 MyUser systemd[1]: Stopping gns3server.service - GNS3 server...
Jul 24 15:11:09 MyUser gns3server[2759]: 2024-07-24 15:11:09 INFO web_server.py:115 Closing 2 websocket connections...
Jul 24 15:11:09 MyUser gns3server[2759]: 2024-07-24 15:11:09 INFO compute.py:457 Connection closed to compute 'local' WebSocket 'http://127.0.0.1:3080/v2/com>
Jul 24 15:11:09 MyUser gns3server[2759]: 2024-07-24 15:11:09 INFO __init__.py:146 Controller is stopping
Jul 24 15:11:09 MyUser gns3server[2759]: 2024-07-24 15:11:09 INFO compute.py:457 Connection closed to compute '98f0ddbf-990c-43a1-96c0-353af1962b54' WebSocke>
Jul 24 15:11:09 MyUser gns3server[2759]: 2024-07-24 15:11:09 INFO notification_handler.py:59 Client has disconnected from compute WebSocket
Jul 24 15:11:09 MyUser gns3server[2759]: 2024-07-24 15:11:09 INFO notification_handler.py:59 Client has disconnected from compute WebSocket
Jul 24 15:11:09 MyUser systemd[1]: gns3server.service: Deactivated successfully.
Jul 24 15:11:09 MyUser systemd[1]: Stopped gns3server.service - GNS3 server.
Jul 24 15:11:09 MyUser systemd[1]: gns3server.service: Consumed 1.602s CPU time, 51.8M memory peak, 0B memory swap peak.

__________________________________________________________
= [Start GNS3Server Services - NORMALLY /w Debug Option] =
__________________________________________________________

gns3server --debug

==========
= [LOGS] =
==========

Ignore, unlikely logs here until you start a project.

___________________________________________
= [Start GNS3 Client - With Debug Option] =
___________________________________________

#1) - Run from the CLI (remove the -):
- gns3 --debug

#2) - Then open/start a project, you should get an error below

==========
= [LOGS] =
==========
2024-07-24 15:22:33 DEBUG http_client:662 Response error: Error transferring http://admin@localhost:3080/v2/projects/load - server replied: Forbidden (localhost:3080) for http://admin@localhost:3080/v2/projects/load (error: 201)
2024-07-24 15:22:33 CRITICAL topology.py:258 Error transferring http://admin@localhost:3080/v2/projects/load - server replied: Forbidden (localhost:3080)

___________________________________________
= [View Error Logs From Server CLI Debug] =
___________________________________________

2024-07-24 15:22:33 ERROR project_handler.py:210 Cannot load 'MyProjectPath' because the server has not been started with the '--local' parameter

___________________________________
= [Kill Any Running GNS3 Process] =
___________________________________

===================================
= [Verify If Service Is Running] =
===================================

sudo lsof -i :3080

COMMAND    PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
gns3serve 9286 MyUser    6u  IPv4  57418      0t0  TCP localhost:3080 (LISTEN)
gns3serve 9286 MyUser    7u  IPv4  57428      0t0  TCP localhost:46360->localhost:3080 (ESTABLISHED)
gns3serve 9286 MyUser    8u  IPv4  57443      0t0  TCP localhost:3080->localhost:36306 (CLOSE_WAIT)
gns3serve 9286 MyUser   16u  IPv4  57429      0t0  TCP localhost:3080->localhost:46360 (ESTABLISHED)

=========================================
= [Run Below Command To Kill The Process]
=========================================

sudo kill -9 9286

===================================
= [Verify If Service Is Running] =
===================================

sudo lsof -i :3080

________________________________________
= [Start GNS3Server Services --Local] =
________________________________________

gns3server --local --debug

##########
# [LOGS] #
##########

2024-07-24 15:32:57 INFO response.py:62 Response: 200 OK
2024-07-24 15:32:57 DEBUG response.py:63 {'Connection': 'close', 'X-Route': '/v2/projects/{project_id}/drawings', 'Server': 'Python/3.12 GNS3/2.2.48.1', 'Content-Type': 'application/json'}

____________________________
= [Start GNS3 GUI Client] =
____________________________

#1) - Open a project/create a new project. This should work now.
grossmj commented 3 months ago

The current workaround is to not select "Enable the service" option when installing the package or edit the systemctl service file to add the --local parameter:

sudo systemctl edit --full gns3server.service

and change the line ExecStart=/usr/bin/gns3server to ExecStart=/usr/bin/gns3server --local