cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1289
Views
0
Helpful
4
Replies

NSO on MacOS not a valid identifier errors

Alex Willoughby
Level 1
Level 1

Hello,

I'm attempting to follow the first NSO tutorials from the Dev download, however each time I try to run the network for example 1 I get an error as per the below and the devices do not start

 

I have installed java and ant and via homebrew and Xcode too. not having much luck searching online. does anyone know what th issues may be?

 

Thanks

 

 

AW-MacBook-Pro:ncs-test alex$ ncs-netsim list
ncs-netsim list for /Users/alex/ncs-test/netsim
name=c0 netconf=12022 snmp=11022 ipc=5010 cli=10022 dir=/Users/alex/ncs-test/netsim/c/c0
name=c1 netconf=12023 snmp=11023 ipc=5011 cli=10023 dir=/Users/alex/ncs-test/netsim/c/c1
name=c2 netconf=12024 snmp=11024 ipc=5012 cli=10024 dir=/Users/alex/ncs-test/netsim/c/c2
AW-MacBook-Pro:ncs-test alex$ ncs-netsim start
./env.sh: line 12: export: `Fusion.app/Contents/Public:/Applications/Wireshark.app/Contents/MacOS': not a valid identifier
DEVICE c0 OK STARTED
./env.sh: line 12: export: `Fusion.app/Contents/Public:/Applications/Wireshark.app/Contents/MacOS': not a valid identifier
DEVICE c1 OK STARTED
./env.sh: line 12: export: `Fusion.app/Contents/Public:/Applications/Wireshark.app/Contents/MacOS': not a valid identifier
DEVICE c2 OK STARTED
AW-MacBook-Pro:ncs-test alex$ ncs_cli -C -u admin
admin connected from 127.0.0.1 using console on AW-MacBook-Pro
admin@ncs# show devices list
NAME ADDRESS DESCRIPTION NED ID ADMIN STATE
-----------------------------------------------
admin@ncs#

1 Accepted Solution

Accepted Solutions

lmanor
Cisco Employee
Cisco Employee

Alex,

 

Although you are seeing env.sh errors while starting your netsims, from the existence of 'DEVICE <devname> OK STARTED' it seems you netsims may have started.

 

You can check the status of the netsism:

$ ncs-netsim status 

 

Have you gone thru the required steps to add you netsim devices to the NSO CDB Device tree?

The devices will not automatically get added to the device tree.

 

You can add them manually by setting devices/device/<devnam>/* parameters (address, port, authgroup, device-type, state)

 

OR

 

You can use the ncs-setup tool to create the device on-boarding configuration automatically to a file which can be loaded by NSO on its initial startup or 'load merged' into the CDB at a later time.

 

Example:

$ ncs-netsim create-network ./packages/cisco-iosxr 2 asr
DEVICE asr0 CREATED
DEVICE asr1 CREATED
 
$ ncs-netsim add-to-network ./packages/juniper-junos 2 mx
DEVICE mx0 CREATED
DEVICE mx1 CREATED
 
$ ncs-netsim start
DEVICE asr0 OK STARTED
DEVICE asr1 OK STARTED
DEVICE mx0 OK STARTED
DEVICE mx1 OK STARTED
 
## Add netsim devices to NCS startup config in ncs-cdb/netsim_devices_init.xml
$ ncs-setup --netsim-dir ./netsim --dest .
 
$ ls ncs-cdb
netsim_devices_init.xml
 
This xml file will be read at NSO initialization when it is started for the first time to provide the initial on-boarding config for the netsim devices.
 
Or, if NSO had previously been run prior to netsim network creation, simply 'load merge' the netsim_devices_init.xml file from NSO cli config mode to pull in the initial netsim device initial configurations:
 
% load merge ncs-cdb/netsim_devices_init.xml
 
-Larry

 

View solution in original post

4 Replies 4

vleijon
Cisco Employee
Cisco Employee

It doesn't look like it is causing any real problems in this case.

 

However, it seems to be something that misbehaves in the interaction between your environment and env.sh in the netsim directory. You can try doing env | grep Wireshark to figure out which environment variable it is and what is wrong with it.

joepak
Cisco Employee
Cisco Employee

Hi,

 

For more context, you can google "export + not a valid identifier" for more context. There are similar errors, but not exact to the one you have.

 

It seems you may modify the export variable to an acceptable format.

 

https://unix.stackexchange.com/questions/79658/not-a-valid-identifier-when-i-do-export-path

https://unix.stackexchange.com/questions/447552/after-starting-terminal-always-getting-bash-export-path-not-a-valid-identifi

lmanor
Cisco Employee
Cisco Employee

Alex,

 

Although you are seeing env.sh errors while starting your netsims, from the existence of 'DEVICE <devname> OK STARTED' it seems you netsims may have started.

 

You can check the status of the netsism:

$ ncs-netsim status 

 

Have you gone thru the required steps to add you netsim devices to the NSO CDB Device tree?

The devices will not automatically get added to the device tree.

 

You can add them manually by setting devices/device/<devnam>/* parameters (address, port, authgroup, device-type, state)

 

OR

 

You can use the ncs-setup tool to create the device on-boarding configuration automatically to a file which can be loaded by NSO on its initial startup or 'load merged' into the CDB at a later time.

 

Example:

$ ncs-netsim create-network ./packages/cisco-iosxr 2 asr
DEVICE asr0 CREATED
DEVICE asr1 CREATED
 
$ ncs-netsim add-to-network ./packages/juniper-junos 2 mx
DEVICE mx0 CREATED
DEVICE mx1 CREATED
 
$ ncs-netsim start
DEVICE asr0 OK STARTED
DEVICE asr1 OK STARTED
DEVICE mx0 OK STARTED
DEVICE mx1 OK STARTED
 
## Add netsim devices to NCS startup config in ncs-cdb/netsim_devices_init.xml
$ ncs-setup --netsim-dir ./netsim --dest .
 
$ ls ncs-cdb
netsim_devices_init.xml
 
This xml file will be read at NSO initialization when it is started for the first time to provide the initial on-boarding config for the netsim devices.
 
Or, if NSO had previously been run prior to netsim network creation, simply 'load merge' the netsim_devices_init.xml file from NSO cli config mode to pull in the initial netsim device initial configurations:
 
% load merge ncs-cdb/netsim_devices_init.xml
 
-Larry

 

kecorbin
Cisco Employee
Cisco Employee

I've seen this error off an on in my NSO travels as well, and have generally ignored it - although it finally reached "annoying enough" stage that I took a deeper look.  The issue here is that VMWare Fusion (with space) is trying to be added to a path statement.  

 

The following link helped me rid myself of this error. 

 

https://apple.stackexchange.com/questions/313520/how-can-one-use-etc-paths-d-to-add-a-path-with-spaces-in-it-to-path

 

TL;DR 

Create a link without spaces to the path VMWare Fusion App

 

ln -sf /Applications/VmwareFusion.app "/Applications/Vmware Fusion.app"

 

Then modify /etc/paths.d/com.vmware.fusion.public pointing to the linked version of the app. (remove the space)