I'm pulling the little hair I have left out!

On my server (CentOS 6) I have the default installation of Magento CE 1.8.1 and everything functions fine except for the USPS real-time shipping quotes in checkout. Half the time they appear and the other half the time there's nothing. I have debugging enabled and the times it doesn't return anything it's making the exact same request, but the response is NULL. I've even traced it all the way down into the code of Usps.php where the Zend_Http_Client is making the call. I simply cannot figure out why it's only USPS. Others, like UPS, grab the real-time quotes every time--but not USPS.

At first I thought it was my USPS account and I've tried three others since. It makes no difference. Now I'm starting to think it's something with my server but I have no idea what it could be. There aren't any scripting errors or timeouts but maybe my nginx and php-fpm don't like the Zend_Http_Client?

I'm completely stumped. Any ideas or suggestions I could try to narrow it down further?

  • 1
    After more digging I found that it is something to do with the server itself. I created a test script and on other servers USPS returns estimates 100 percent of the time. On the production server though it returns successful estimates only half of the time. The only big difference between servers is the problem one runs Nginx and the other one runs Apache. Would that make any difference for the Zend_Http_Client?
    – LeoXela
    Feb 1, 2014 at 22:17

1 Answer 1


Our ecommerce clients using another ecommerce application have been seeing random USPS failures for the past few weeks. Curl is returning:

Empty reply from server; uplink return code: 52

This seems to indicate that USPS is occasionally dropping connections or not returning any results. This would likely be an issue on the USPS end, and not a problem with Magento's implementation of USPS, or your use of Nginx.

The problem seemed to start after USPS made their change for 2014 at the end of January.

We've reached out to USPS support, but so far, they haven't been too helpful in tracking down the issue.

There is also a website that tracks the uptime of shipping APIs from the big 3 shippers: http://www.ShippingAPIMonitor.com/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.