Symptoms


When connecting to SimpleAPI endpoint, reseller received 500 code error.

For example, below is the output of Postman when trying to create token with BASE_URL/token:

{
"timestamp": "2023-06-01T10:34:49.805+00:00",
"status": 500,
"error": "Internal Server Error",
"path": "/token",
"correlationId": "a8n-e81277c4-c3c2-d4c7-cefb-4464fce14154"
}


Checking cmpapi pod log with kubectl logs cmpapi-xxxxx-yyyy, the following error were seen:

01-06-2023;10:36:02,753 ERROR [a8n-ed3785c4-da86-b1b9-86e4-56ba6bdd7756 http-nio-8080-exec-4:27 cmpapi] [] o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception java.lang.NullPointerException: Cannot invoke "java.util.List.isEmpty()" because "headers" is null


Cause


Incomplete endpoint URL was used.


Resolution


Correct endpoint should be BASE_URL plus /api/v1/.

This is explained in the Step 3 in the following article: https://docs.cloudblue.com/cbc/21.0/Simple-API/

For example: if BASE_URL was defined with www.example.org, the proper endpoint URL should be www.example.org/api/v1.