GNS3 / gns3-server

GNS3 server
GNU General Public License v3.0
798 stars 262 forks source link

Dynamips router without private config: Save doesn't work #165

Closed ghost closed 9 years ago

ghost commented 9 years ago

GNS3 V1.3.2, OS: OS X 10.9.5 Topology: 2 x 3725 screenshot

When using startup and private config, all is fine, saving the configuration with save-project or right-click-save-config works fine.

Then I removed the private config from the router template. dynamips-router-config I recreated the project with this new router template and started it, no problems. Routers are running fine.

The save-project seems to work (no errors in console window), but only the startup-config of the first router is saved.

When I use the right-click-save-config the startup-config is saved, but not the private config and an error is shown in the console window "Server error from 127.0.0.1:8000: R1: Could not save the private configuration /Users/behlers/GNS3/projects/test/project-files/dynamips/: [Errno 21] Is a directory: '/Users/behlers/GNS3/projects/test/project-files/dynamips/'"

Here the output of the log: a) save-project

Apr 29 21:07:44 imac.lan GNS3[697] <Notice>: 2015-04-29 21:07:44 INFO topology.pyo:449 Starting to save the topology (version 1.3.2)
Apr 29 21:07:44 imac.lan GNS3[697] <Notice>: 2015-04-29 21:07:44 INFO topology.pyo:472 saving node: R1
Apr 29 21:07:44 imac.lan GNS3[697] <Notice>: 2015-04-29 21:07:44 INFO topology.pyo:472 saving node: R2
Apr 29 21:07:44 imac.lan GNS3[697] <Notice>: 2015-04-29 21:07:44 INFO topology.pyo:479 saving Link from R1 port FastEthernet0/0 to R2 port FastEthernet0/0
Apr 29 21:07:44 imac.lan GNS3[697] <Notice>: 2015-04-29 21:07:44 INFO topology.pyo:486 saving server 127.0.0.1:8000
Apr 29 21:07:44 imac.lan GNS3[697] <Notice>: 2015-04-29 21:07:44 INFO main_window.pyo:1337 Saving project: /Users/behlers/GNS3/projects/test/test.gns3
Apr 29 21:07:44 imac.lan GNS3[697] <Notice>: 2015-04-29 21:07:44 INFO router.pyc:1491 saving startup-config to configs/i1_startup-config.cfg
Apr 29 21:07:44 imac.lan GNS3[697] <Notice>: 2015-04-29 21:07:44 ERROR route.pyc:150 VM error detected: <class 'gns3server.modules.dynamips.dynamips_error.DynamipsError'>
Apr 29 21:07:44 imac.lan GNS3[697] <Notice>: Traceback (most recent call last):
Apr 29 21:07:44 imac.lan GNS3[697] <Notice>:   File "gns3server/modules/dynamips/nodes/router.pyc", line 1501, in save_configs
Apr 29 21:07:44 imac.lan GNS3[697] <Notice>: IsADirectoryError: [Errno 21] Is a directory: '/Users/behlers/GNS3/projects/test/project-files/dynamips/'
Apr 29 21:07:44 imac.lan GNS3[697] <Notice>: 
Apr 29 21:07:44 imac.lan GNS3[697] <Notice>: During handling of the above exception, another exception occurred:
Apr 29 21:07:44 imac.lan GNS3[697] <Notice>: 
Apr 29 21:07:44 imac.lan GNS3[697] <Notice>: Traceback (most recent call last):
Apr 29 21:07:44 imac.lan GNS3[697] <Notice>:   File "gns3server/web/route.pyc", line 140, in control_schema
Apr 29 21:07:44 imac.lan GNS3[697] <Notice>:   File "gns3server/handlers/api/project_handler.pyc", line 108, in commit
Apr 29 21:07:44 imac.lan GNS3[697] <Notice>:   File "gns3server/modules/project.pyc", line 382, in commit
Apr 29 21:07:44 imac.lan GNS3[697] <Notice>:   File "gns3server/modules/dynamips/__init__.pyc", line 213, in project_committed
Apr 29 21:07:44 imac.lan GNS3[697] <Notice>:   File "gns3server/modules/dynamips/nodes/router.pyc", line 1505, in save_configs
Apr 29 21:07:44 imac.lan GNS3[697] <Notice>: gns3server.modules.dynamips.dynamips_error.DynamipsError: Could not save the private configuration /Users/behlers/GNS3/projects/test/project-files/dynamips/: [Errno 21] Is a directory: '/Users/behlers/GNS3/projects/test/project-files/dynamips/'
Apr 29 21:07:44 imac.lan GNS3[697] <Notice>: 2015-04-29 21:07:44 INFO server.pyc:169 127.0.0.1 - - Wed, 29 Apr 2015 19:07:44 GMT "POST /v1/projects/78bca983-d667-4eb0-8154-4a8074078613/commit HTTP/1.1" 409 439 "-" "GNS3 QT Client v1.3.2"
Apr 29 21:07:44 imac.lan GNS3[697] <Notice>: 2015-04-29 21:07:44 INFO http_client.pyo:356 Response error: Error downloading http://127.0.0.1:8000/v1/projects/78bca983-d667-4eb0-8154-4a8074078613/commit - server replied: Conflict

b) right-click-save-config

Apr 29 21:08:49 imac.lan GNS3[697] <Notice>: 2015-04-29 21:08:49 INFO router.pyc:1491 saving startup-config to configs/i1_startup-config.cfg
Apr 29 21:08:49 imac.lan GNS3[697] <Notice>: 2015-04-29 21:08:49 ERROR route.pyc:150 VM error detected: <class 'gns3server.modules.dynamips.dynamips_error.DynamipsError'>
Apr 29 21:08:49 imac.lan GNS3[697] <Notice>: Traceback (most recent call last):
Apr 29 21:08:49 imac.lan GNS3[697] <Notice>:   File "gns3server/modules/dynamips/nodes/router.pyc", line 1501, in save_configs
Apr 29 21:08:49 imac.lan GNS3[697] <Notice>: IsADirectoryError: [Errno 21] Is a directory: '/Users/behlers/GNS3/projects/test/project-files/dynamips/'
Apr 29 21:08:49 imac.lan GNS3[697] <Notice>: 
Apr 29 21:08:49 imac.lan GNS3[697] <Notice>: During handling of the above exception, another exception occurred:
Apr 29 21:08:49 imac.lan GNS3[697] <Notice>: 
Apr 29 21:08:49 imac.lan GNS3[697] <Notice>: Traceback (most recent call last):
Apr 29 21:08:49 imac.lan GNS3[697] <Notice>:   File "gns3server/web/route.pyc", line 140, in control_schema
Apr 29 21:08:49 imac.lan GNS3[697] <Notice>:   File "gns3server/handlers/api/dynamips_vm_handler.pyc", line 386, in save_configs
Apr 29 21:08:49 imac.lan GNS3[697] <Notice>:   File "gns3server/modules/dynamips/nodes/router.pyc", line 1505, in save_configs
Apr 29 21:08:49 imac.lan GNS3[697] <Notice>: gns3server.modules.dynamips.dynamips_error.DynamipsError: Could not save the private configuration /Users/behlers/GNS3/projects/test/project-files/dynamips/: [Errno 21] Is a directory: '/Users/behlers/GNS3/projects/test/project-files/dynamips/'
Apr 29 21:08:49 imac.lan GNS3[697] <Notice>: 2015-04-29 21:08:49 INFO server.pyc:169 127.0.0.1 - - Wed, 29 Apr 2015 19:08:49 GMT "POST /v1/projects/78bca983-d667-4eb0-8154-4a8074078613/dynamips/vms/666a4ddd-873e-4b07-aede-79bcb189bcaf/configs/save HTTP/1.1" 409 466 "-" "GNS3 QT Client v1.3.2"
Apr 29 21:08:49 imac.lan GNS3[697] <Notice>: 2015-04-29 21:08:49 INFO http_client.pyo:356 Response error: Error downloading http://127.0.0.1:8000/v1/projects/78bca983-d667-4eb0-8154-4a8074078613/dynamips/vms/666a4ddd-873e-4b07-aede-79bcb189bcaf/configs/save - server replied: Conflict
Apr 29 21:08:49 imac.lan GNS3[697] <Notice>: 2015-04-29 21:08:49 ERROR router.pyo:781 error while saving R1 configs: Could not save the private configuration /Users/behlers/GNS3/projects/test/project-files/dynamips/: [Errno 21] Is a directory: '/Users/behlers/GNS3/projects/test/project-files/dynamips/'
grossmj commented 9 years ago

This should fix things: https://github.com/GNS3/gns3-server/commit/71e2586e176232f574b14be8d03c0d9ccd32daa6

Everything works on my side but this will need to be thoughtfully tested.

ghost commented 9 years ago

I just tested with the current dev version on linux (on OS X I try to stick with the official version).

While I haven't found a problem, when the private config is empty, using an empty startup config shows some unpleasant side effects.

First of all it takes about 100 secs until the initial system dialog starts (on c3725-adventerprisek9-mz.124-25d). I haven't found anything in the logs, that explains this long delay.

Furthermore the IOS I used doesn't see the private config, when the startup config is empty.

As GNS3 and the router works fine, it's probably an issue of the used IOS.

grossmj commented 9 years ago

First of all it takes about 100 secs until the initial system dialog starts (on c3725-adventerprisek9-mz.124-25d). I haven't found anything in the logs, that explains this long delay.

Well I think this is an IOS problem, it is the same with IOU, it takes longer for a device to boot without a startup-config.

Furthermore the IOS I used doesn't see the private config, when the startup config is empty

Unfortunately it looks like this is a Dynamips limitation. I'll investigate someday ;)