"Invalid value for argument" when running traceflow cli on NSX 4.2
search cancel

"Invalid value for argument" when running traceflow cli on NSX 4.2

book

Article ID: 411742

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

  • Traceflow fails with "Invalid value for argument" error.

edge> traceflow <port-uuid> <base64 string of pkt> 

% Invalid value for argument <base64-string>: <base string of pkt>
<base64-string>: Base64 encoded string representation.

Environment

VMware NSX 4.2 

Cause

Decodestring() is deprecated and has been removed in python 3.9 since this is used in arguments.py to validate the provided base64 string. 

Resolution

This procedure involves modifying system files. If you are unsure how to proceed, please open Support case.  

EDGE CLI Root mode: 

Create backup of file "arguments.py.bak"

1) cp /opt/vmware/nsx-cli/bin/python/cli/commands/edge/arguments.py /opt/vmware/nsx-cli/bin/python/cli/commands/edge/arguments.py.bak 

Make the changes required in the file:

2) sed -i 's/base64\.decodestring(value\.encode())/base64.b64decode(value)/g' /opt/vmware/nsx-cli/bin/python/cli/commands/edge/arguments.py

Verify the changes: 

3) diff /opt/vmware/nsx-cli/bin/python/cli/commands/edge/arguments.py /opt/vmware/nsx-cli/bin/python/cli/commands/edge/arguments.py.bak

<             base64.b64decode(value)
---
>             base64.decodestring(value.encode())