Internal error on NSX-T edge CLI for object having TAB character in display name
search cancel

Internal error on NSX-T edge CLI for object having TAB character in display name

book

Article ID: 336806

calendar_today

Updated On:

Products

VMware NSX VMware NSX-T Data Center

Issue/Introduction

Users may run into an issue where \t (TAB) character in the display name causes an issue when accessing an object from CLI.

This can be observed in any NSX-T version and the only way to prevent this is to have validation in the UI to stop tab characters from being entered.

  • Cannot run edge CLI commands such as 'get interfaces' for T0/T1
  • Internal error occurred while running commands below

EDGE1> vrf 5

EDGE1(vrf)> get interfaces

% An internal error occurred

The following error will be seen in the edge syslog

YYYY-MM-DDTHH:MM:SS.SSSZ EDGE02.example.com NSX 30679 - [nsx@6876 comp="nsx-edge" subcomp="node-mgmt" username="root" level="ERROR" errorCode="NOD101"] Exception caught while trying to call provider: Traceback (most recent call last):#012  File "/opt/vmware/nsx-node-api/bin/python/management_api/descriptors/rest_routine_descriptor.py", line 459, in call_provider#012    response = get_task_manager().start_task(handler, request, self)#012  File "/opt/vmware/nsx-node-api/bin/python/management_api/napi/task_manager.py", line 298, in start_task#012    response = task_worker.run()#012  File "/opt/vmware/nsx-node-api/bin/python/management_api/napi/task_manager.py", line 202, in run#012    response = self._call_handler()#012  File "/opt/vmware/nsx-node-api/bin/python/management_api/napi/task_manager.py", line 225, in _call_handler#012    raise e#012  File "/opt/vmware/nsx-node-api/bin/python/management_api/napi/task_manager.py", line 210, in _call_handler#012    response = self._handler(self._request)#012  File "/opt/vmware/nsx-node-api/bin/python/management_api/napi/root/node/configuration.py", line 44, in __call__#012    mgmt_interface = get_mgmt_interface()#012  File "/opt/vmware/nsx-node-api/bin/python/management_api/napi/root/node/edge_utils.py", line 476, in get_mgmt_interface#012    intf_list = get_interfaces(route["interface_id"])#012  File "/opt/vmware/nsx-node-api/bin/python/management_api/napi/root/node/network/interfaces.py", line 1067, in get_interfaces#012    interface_configs)]#012  File "/opt/vmware/nsx-node-api/bin/python/management_api/napi/root/node/network/interfaces.py", line 990, in _get_interface_properties#012    prop["is_kni"] = is_kni(interface_id)#012  File "/opt/vmware/nsx-node-api/bin/python/management_api/napi/root/node/network/interfaces.py", line 843, in is_kni#012    interfaces = simplejson.loads(out)#012  File "/usr/lib/python3/dist-packages/simplejson/__init__.py", line 518, in loads#012    return _default_decoder.decode(s)#012  File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 370, in decode#012    obj, end = self.raw_decode(s)#012  File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 400, in raw_decode#012    return self.scan_once(s, idx=_w(s, idx).end())#012simplejson.errors.JSONDecodeError: Invalid control character '\t' at: line 1 column 1087 (char 1086)

YYYY-MM-DDTHH:MM:SS.SSSZ EDGE02.example.com NSX 30093 - [nsx@6876 comp="nsx-edge" subcomp="opsagent" s2comp="edge-service" tid="30093" level="ERROR" errorCode="MPA"EDG0300005""] Invalid message: line 0, column 0, byte 0: invalid character '<', edge cfg not in json format
YYYY-MM-DDTHH:MM:SS.SSSZ EDGE02.example.com NSX 30093 - [nsx@6876 comp="nsx-edge" subcomp="opsagent" s2comp="edge-service" tid="30093" level="INFO"] Could not get config update. Retry in 5 seconds.

The below information shows TAB character on the interface name.

 {
                "ifuuid": "########-####-####-####-########89cf",
                "ifuid": 297,
                "type": "lif",
                "ptype": "downlink",
                "name": "LinkedPort_BNG DMZ Tier1\t", <--------
                "internal_name": "downlink-297",
                "lrouter": "########-####-####-####-########b269",
                "mac": "##:##:##:##:44:52",
                "admin": "up",
                "internal_operation": "up",
                "urpf-mode": "PORT_CHECK",
                "ra-mode": "SLAAC_DNS_TRHOUGH_RA(M=0, O=0)",
                "dad-mode": "LOOSE",
                "dad-profile": "(1 sec, 3 rtr)",
                "force-reassemble": false,
                "enable-firewall": false,
                "enable-firewall-rule": false,
                "enable-firewall-pbr": false,
                "enable-firewall-ike": false

Note: The preceding log excerpts are only examples. Date, time, and environmental variables may vary depending on your environment

 

Environment

VMware NSX-T Data Center
VMware NSX-T Data Center 3.x

Cause

User has \t (TAB) character in display name which causes an issue when accessing an object from CLI.

This issue is not specific to Interface type and can occur for any type of object.

In the UI, using the "tab key" moves focus to the next field, preventing the creation of an object with \t in the display name. This can only be achieved if the user copies the name from the clipboard and pastes it.

Resolution

Remove the TAB characters from the interface name or t0/t1

There should not be any impact from removing the TAB character.


Additional Information

Impact/Risks:
No service impact. User won't be able to run edge CLI commands which are required during troubleshooting.