Create order failed

sometimes, request to the the square api create order failed, and ApiException.getErrors() is null. if you can tell me the reason, it’s better. below is the log, maybe it could help your enginner to improve.

00:05.774637438 ERROR c.f.i.log.LogManager - [java.lang.NullPointerException] Cannot invoke “java.util.List.get(int)” because the return value of “com.squareup.square.exceptions.ApiException.getErrors()” is null
java.lang.NullPointerException: Cannot invoke “java.util.List.get(int)” because the return value of “com.squareup.square.exceptions.ApiException.getErrors()” is null
at app.square.integration.client.SquareException.(
at app.square.integration.client.sdk.OrderClient.create(
at app.square.integration.service.OrderCreationService.create(
at app.square.integration.web.OrderSquareWebServiceImpl.create(
at core.framework.web.Controller$OrderSquareWebServiceImpl$create$94.execute(Controller$OrderSquareWebServiceImpl$create$
at core.framework.internal.web.controller.InvocationImpl.proceed(
at app.square.integration.webhook.interceptor.WebhookInterceptor.intercept(
at core.framework.internal.web.controller.InvocationImpl.proceed(
at core.framework.internal.web.HTTPHandler.handle(
at core.framework.internal.web.HTTPHandler.handleRequest(
at io.undertow.server.Connectors.executeRootHandler(
at io.undertow.server.HttpServerExchange$
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$ Source)
at org.xnio.XnioWorker$WorkerThreadFactory$1$
at java.base/ Source)
00:05.774756781 c.f.i.w.response.ResponseHandler - [response] statusCode=500
00:05.774757792 c.f.i.w.response.ResponseHandler - [response:header] Content-Type=application/json

Have you checked the API Logs to see if the request made it to our servers? :slightly_smiling_face:

yes, below are screenshots:



it seems gateway timeout.

create time in our system log matches api log in the new screenshots.

please ignore the first screenshot in our system log, it will be the same problem, i just cann’t find the whole log to match.

Are you closing the the port before we return a response? I can’t think of any other reason it would be null. :slightly_smiling_face:

i do not know also. it elapsed only 5.134 s from begin to request, if it takes too long, our system may be closing the port.

Do you have the idempotency_key of a failed attempt? :slightly_smiling_face: