ansible-collection-netscaleradc icon indicating copy to clipboard operation
ansible-collection-netscaleradc copied to clipboard

python 3.8 and 3.9 with Ansible 2.13.x NITRO ERROR -1

Open MarlonRodriguez opened this issue 3 years ago • 0 comments

The Nitro API call seems to work and HTTP response is the expected one, however it seems not to be parsed correctly and nitro error code is set to -1 instead of 258. The difference with a working environment of Python 3.6.8 and Ansible 2.11.12 seems to be that the http_response_body tuple is not populated with the 'body' from the request. If fetch_url changed how it works for newer versions of Ansible then the module doesn't know how to deal with it. You can see the message in the 'body' of the response (resource names changed to protect the innocents):

{ "changed": false, "http_response_body": "", "http_response_data": { "url": https://citrix_netscaler_device/nitro/v1/config/loadbalancer1/RESOURCE_TEST1, "status": 404, "date": "Fri, 26 Aug 2022 13:05:46 GMT", "server": "Apache", "x-frame-options": "SAMEORIGIN", "expires": "Thu, 19 Nov 1981 08:52:00 GMT", "cache-control": "no-store, no-cache, must-revalidate, post-check=0, pre-check=0", "pragma": "no-cache", "vary": "Accept-Encoding", "feature-policy": "camera 'none'; microphone 'none'; geolocation 'none'", "referrer-policy": "no-referrer", "x-xss-protection": "1; mode=block", "x-content-type-options": "nosniff", "content-length": "114", "connection": "close", "content-type": "application/json; charset=utf-8", "msg": "HTTP Error 404: Not Found", "body": "{ "errorcode": 258, "message": "No such resource [name, RESOURCE_TEST1]", "severity": "ERROR" }" }, "nitro_errorcode": -1, "nitro_message": "HTTP Error 404: Not Found", "nitro_severity": "ERROR", "headers": { "Content-Type": "application/json", "Cookie": "NITRO_AUTH_TOKEN=********" }, }, "msg": "NITRO Failure", "invocation": { "module_args": { "expected_nitro_errorcode": [ 0, 258, 273, 344 ], "nsip": "citrix_netscaler_device", "nitro_protocol": "https", "nitro_auth_token": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "operation": "get", "resource": "loadbalancer1", …

MarlonRodriguez avatar Sep 01 '22 00:09 MarlonRodriguez