Xero Server Response is Empty

Modified on Tue, 28 Feb 2023 at 03:29 PM

Xero Server Response is Empty
This message comes from Xero itself and Xeroom feeds it back to the user and logs it on the Xeroom debug log page.  Usually means a timeout has happened in Xero for data to be returned from the endpoint.  This might happen with large invoices (of greater than 12 line items) or a Bulk Send of too many invoices.  It can occur if your server execution time limit is set too low.  

Xero will only process data at a relatively slow rate and at busy times implements a strict API call rate limit.  Xeroom has a setting to throttle back the rate of sending to avoid this from happening - see below, which also explains why the Bulk Send is so slow.

Large ordersWe have had customers who have sent orders with as many as 110 items successfully with no issues.  However, it takes time to post to Xero eg 2-3 mins per order as the rate of "digestion" is restricted with the no of API calls and rate.  If this issue is only happening with large orders then it is certainly one of the issue covered below.

Too many orders in the Batch Send - Ensure that the no of orders on the batch size setting in Xeroom is set to a max of 4.  Xeroom then breaks the batch up into chunks of 4 orders to send to Xero so that Xero doesn't hit the API rate limits. 

Max execution server time limits - You can try changing the execution time to 300 seconds as it is often set by hosts to default to 60 seconds which is way too low. ie php max_execution_time = 300 since 60 seconds is not long enough for Xero to process large orders either singularly or in batches of smaller orders.  This setting will restrict any processes or cron jobs from running longer than 60 seconds which will cause the order send to fail leading to this error message.  

Host shared server limitation -  Some hosts like WP Engine will restrict this setting if you are on a shared server.   This is more serious as we cannot do anything about it and the solution is to move from a cheaper shared host to a dedicated host server where you don't suffer from such limitations.

Missing critical data - Another cause is if some critical data is missing from the order eg an SKU is blank, that is causing the order to retry and timeout and fail.  The Xeroom debug screen should provide details of this. 

Server Memory - Also check that you have a decent amount of memory on the server ie at least 768 M as large orders will require more to prevent them freezing.  Again shared servers will restrict the amount of memory by default which is an obvious cause - you can check it with a php info plugin or on your server or host settings.

Decouple the Sending from the Checkout - If you find that this error is only occurring during the checkout process but not when you send it from the WooCommerce order back-end then Xeroom Version 2.6.4 contains an option to decouple the order sending process from the checkout time.  

You just need to tick this box and Xeroom will not send the invoice during checkout preventing delays for the user who is checking out but will send it within the next 5 minutes as a cron job (so make sure that WP Cron is not disabled for any reason).  If it fails then it will try again after 5 minutes and repeatedly until 5 attempts are made after which it will stop trying.  Run a few large test orders to ensure this is working correctly.

WC Debug log - You can also look in the WC debug log for other clues about what might be the cause - details of how to find this are given here https://www.xeroom.com/support/.

Contact Xero support - If no errors are showing for Xeroom in the WC debug log then ask Xero if they can check their logs giving them the failed order no(s) as they have more visibility to the causes of this error. 

Still no joy? - Please open a ticket and send us the following info in order to help you:

1. An estimate of how many orders are failing as a % of the total being sent.  

2. Order nos for 2 or 3 of the failed orders.

3. A copy of the Xeroom debug screen.

3. Logins to your system - We need an admin login to your website and a standard business user invite to your Xero account using our support@xeroom.com email.

4. Details of the results of trying the above suggestions.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article