commit e88c14287c07a55a43efa3b2063d927baaa6aae2 Author: Xiaotong Luo Date: Mon Sep 14 12:26:29 2020 -0700 Add error message and NSX time for failed authentication In addition to status code, also log error message and local NSX time for failed NSX authentication for easier troubleshooting for failed JWT authentication and potential clock drift between NSX, VC and Master node. Change-Id: Icf31477bffda85ba73a1123232b6aa5503066922 (cherry picked from commit 8e7075b69d4870e6ff1d123507164cc325735efb) diff --git a/vmware_nsxlib/v3/cluster.py b/vmware_nsxlib/v3/cluster.py index 8facbe6..d162855 100644 --- a/vmware_nsxlib/v3/cluster.py +++ b/vmware_nsxlib/v3/cluster.py @@ -281,8 +281,11 @@ class NSXRequestsHTTPProvider(AbstractHTTPProvider): else: if resp.status_code != 200 and resp.status_code != 201: LOG.warning("Session create failed for endpoint %s with " - "response %s", - provider.url, resp.status_code) + "response %s, error message: %s, " + "local NSX time: %s", + provider.url, resp.status_code, + resp.json().get('error_message'), + resp.headers['Date']) # this may will later cause the endpoint to be Down else: for header_name in resp.headers: