Facebook PHP SDK throwing Unauthorized source IP address error-Collection of common programming errors

I recently discovered that one of our production servers is giving a fatal error when we try to issue an FQL query via the Graph API. The exact same code on other servers works perfectly. The servers are behind a load balancer with a single IP address.

The error is:

  PHP Fatal error:  Uncaught OAuthException: (#5) Unauthorized source IP address
  thrown in /usr/local/home/faniq/php-lib/facebook/base_facebook.php on line 1039

I have tried adding the IP address to my FB app’s server whitelist (which was blank). When I try to save the whitelist, it gives me this error: Your IP should be included in the Server Whitelist.

I even tried a range of IP addresses, still refuses to save. The other production servers and our development environments all work fine, so I am at a loss. Any ideas why Facebook would not accept requests from this one particular server?

Originally posted 2013-11-19 13:17:25.