vmware / python-client-for-vmware-cloud-on-aws

Python Client for VMware Cloud on AWS is an open-source Python-based tool. Written in Python, the tool enables VMware Cloud on AWS users to automate the consumption of their VMware Cloud on AWS SDDC.
Other
24 stars 20 forks source link

Show SDDC Connected VPC errors out #187

Closed kremerpatrick closed 1 year ago

kremerpatrick commented 1 year ago

Describe the bug

sddc show-sddc-connected-vpc results in an error

Reproduction steps

  1. python .\pyVMC.py sddc show-sddc-connected-vpc

After some time, the command fails with this dump:

Traceback (most recent call last): File "C:\Program Files\Python310\lib\site-packages\requests\models.py", line 971, in json return complexjson.loads(self.text, **kwargs) File "C:\Program Files\Python310\lib\json__init__.py", line 346, in loads return _default_decoder.decode(s) File "C:\Program Files\Python310\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Program Files\Python310\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\kremerpt\git\Flings\python-client-for-vmware-cloud-on-aws\pyVMC.py", line 1409, in main() File "C:\Users\kremerpt\git\Flings\python-client-for-vmware-cloud-on-aws\pyVMC.py", line 1404, in main args.func(**params) File "C:\Users\kremerpt\git\Flings\python-client-for-vmware-cloud-on-aws\pyvmc_fxns.py", line 909, in getSDDCConnectedVPC json_response = get_conencted_vpc_json(proxy_url, session_token) File "C:\Users\kremerpt\git\Flings\python-client-for-vmware-cloud-on-aws\pyvmc_nsx.py", line 389, in get_conencted_vpc_json json_response = response.json() File "C:\Program Files\Python310\lib\site-packages\requests\models.py", line 975, in json raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Expected behavior

Command should return connected VPC info.

Additional context

No response

maulepilot117 commented 1 year ago

What SDDC version are you testing against? API changes happened between M16 and M18.

fr0gger03 commented 1 year ago

Also, be sure your refresh token and SDDC ID are correct and up to date. Works for me:

2023-05-09_12-09-13
maulepilot117 commented 1 year ago

I just got the same failure Patrick did, so wonder what's different about yours vs mine? We should be connected to the same SDDC...

maulepilot117 commented 1 year ago

Disregard, I didn't have the correct SDDC ID in my config.ini file. Side note, need to add some checks to validate the SDDC ID exists in the Org...

kremerpatrick commented 1 year ago

Apparently some transient API issue, it was happening across multiple SDDCs both M18 and M22. Came back a few hours later and the same SDDCs work fine.