CiscoDevNet / DNAC-Webex-Teams-Bot-App

Other
6 stars 5 forks source link

'client <MAC>' throwing TypeError: argument of type 'NoneType' is not iterable #2

Open rosia opened 4 years ago

rosia commented 4 years ago

When calling the client . Even though the client MAC is active in DNAC Assurance and is available when making a API Call for client-detail.

here is the full error log on the server console

/home/ubuntu/Desktop/DNAC-Webex-Teams-Bot-App/venv/lib/python3.6/site-packages/urllib3/connectionpool.py:986: InsecureRequestWarning: Unverified HTTPS request is being made to host '10.66.50.143'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning, Response[200]: OK, Duration: 0.160653s. Request[GET]: https://10.66.50.143/dna/intent/api/v1/client-detail??timestamp=1590556561055&macAddress=3C:FD:FE:D6:2C:08 Method:GET URL:https://10.66.50.143/dna/intent/api/v1/client-detail??timestamp=1590556561055&macAddress=3C:FD:FE:D6:2C:08 /home/ubuntu/Desktop/DNAC-Webex-Teams-Bot-App/venv/lib/python3.6/site-packages/urllib3/connectionpool.py:986: InsecureRequestWarning: Unverified HTTPS request is being made to host '10.66.50.143'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning, Response[500]: Internal Server Error, Duration: 0.404040s. 127.0.0.1 - - [27/May/2020 15:16:01] "POST / HTTP/1.1" 500 - INFO:werkzeug:127.0.0.1 - - [27/May/2020 15:16:01] "POST / HTTP/1.1" 500 - Traceback (most recent call last): File "/home/ubuntu/Desktop/DNAC-Webex-Teams-Bot-App/venv/lib/python3.6/site-packages/flask/app.py", line 2464, in call return self.wsgi_app(environ, start_response) File "/home/ubuntu/Desktop/DNAC-Webex-Teams-Bot-App/venv/lib/python3.6/site-packages/flask/app.py", line 2450, in wsgi_app response = self.handle_exception(e) File "/home/ubuntu/Desktop/DNAC-Webex-Teams-Bot-App/venv/lib/python3.6/site-packages/flask/app.py", line 1867, in handle_exception reraise(exc_type, exc_value, tb) File "/home/ubuntu/Desktop/DNAC-Webex-Teams-Bot-App/venv/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise raise value File "/home/ubuntu/Desktop/DNAC-Webex-Teams-Bot-App/venv/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/home/ubuntu/Desktop/DNAC-Webex-Teams-Bot-App/venv/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/ubuntu/Desktop/DNAC-Webex-Teams-Bot-App/venv/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception reraise(exc_type, exc_value, tb) File "/home/ubuntu/Desktop/DNAC-Webex-Teams-Bot-App/venv/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise raise value File "/home/ubuntu/Desktop/DNAC-Webex-Teams-Bot-App/venv/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "/home/ubuntu/Desktop/DNAC-Webex-Teams-Bot-App/venv/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request return self.view_functionsrule.endpoint File "/home/ubuntu/Desktop/DNAC-Webex-Teams-Bot-App/server/botADna.py", line 125, in index processMessage(in_message, webhook) File "/home/ubuntu/Desktop/DNAC-Webex-Teams-Bot-App/server/botADna.py", line 153, in processMessage handleClient(in_message, webhook) File "/home/ubuntu/Desktop/DNAC-Webex-Teams-Bot-App/server/botADna.py", line 246, in handleClient clientData = dnacapi.getClientDetail(str(millis),clientmac,apiObj) File "/home/ubuntu/Desktop/DNAC-Webex-Teams-Bot-App/server/dnacapi.py", line 34, in getClientDetail if 'response' in clientJson: TypeError: argument of type 'NoneType' is not iterable


When opening the URL in DNA Center for the client

https://10.66.50.143/dna/intent/api/v1/client-detail??timestamp=1590556561055&macAddress=3C:FD:FE:D6:2C:08

{ "executionId" : "820dbde1-9f6d-4292-b13d-00d13b6768c1", "statusCode" : 500, "errorResponse" : { "bapiErrorResponse" : { "bapiKey" : "e2ad-ba79-43ba-b3e9", "bapiName" : "Get Client Detail", "bapiErrorCode" : "", "bapiErrorMessage" : "" }, "componentErrorResponse" : [ { "compId" : "uuid5b434a98", "compName" : "Combine Output-Detail(Prod)", "compErrorCode" : "500", "compErrorMessage" : "820dbde1-9f6d-4292-b13d-00d13b6768c1 | 76aef654-7e3a-4d40-8c6f-975588d71f6f | e2ad-ba79-43ba-b3e9 : ScriptProcessor Execution Failed with error: SyntaxError: Invalid JSON: :1:0 Expected json literal but found H\nHttp Error Code:404\n^ in at line number : 9 ", "componentType" : "JAVASCRIPT_TRANSFORM" } ] } }

rosia commented 4 years ago

DNAC 1.3.1.4