Matt Bradley Posted May 19, 2022 Share Posted May 19, 2022 (edited) We've just gone live with a SBC API integration, and almost immediately we've hit a problem. The system tried to post in a purchase invoice with 808 line items, and the API responded with a 504 gateway timeout: "The backend has not responded within 28s while proxying this..." Any suggestions, please? Edited May 19, 2022 by Matt Bradley Link to comment Share on other sites More sharing options...
Steel, Mark Posted May 19, 2022 Share Posted May 19, 2022 Hi Matt Do you have the request ID that failed please? Thanks Mark Link to comment Share on other sites More sharing options...
Matt Bradley Posted May 19, 2022 Author Share Posted May 19, 2022 Hi Mark, Is this what you're after? [x-amzn-RequestId] => cb7abf2b-a372-42e1-8e96-6a877f029ea6 FWIW: in the meantime, I've decided to collapse lineitems on massive invoices to avoid this issue, as we're running into issues with packet size when logging requests in our database anyway, but it would be nice to know if this was fixable ultimately. Link to comment Share on other sites More sharing options...
Steel, Mark Posted May 19, 2022 Share Posted May 19, 2022 The x-request-id if you could please Matt. We'll need to find out what is causing the delay, there are a few internal calls we make to other services to validate tax codes and the like on each of the line items. Do you expect all of your customers to be posting such large numbers of line items? Thanks Mark Link to comment Share on other sites More sharing options...
Matt Bradley Posted May 25, 2022 Author Share Posted May 25, 2022 Hi Mark, Sorry. It doesn't look like we've logged an x-request-id property in our error logs. This was a fairly rare scenario: a big settlement to an auction vendor for 808 lot entries in a single auction sale. For the time being, we've decided to aggregate large invoices like this into a single line item before posting to Sage API, so we do have a workaround. However, another issue has since come to light: despite the invoice creation failing with a 504, Sage API appears to have logged an entry for it in the Nominal Ledger. Each time our scheduled sync task retried creating this invoice, it failed, but a nominal ledger entry was created, we now have LOTS of nominal ledger entries in our reporting which refer to an invoice which does not exist in the system! Link to comment Share on other sites More sharing options...
Matt Bradley Posted May 25, 2022 Author Share Posted May 25, 2022 Apologies. Slight correction! The invoices are in fact there. So the API did create everything we expected it to, but it simply didn't respond back to us in a timely fashion, leading to the 504 response being logged in our system. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now