One Server's Search Worked. The Other Didn't.
Two production servers, same code, same configuration. Search worked on one and failed on the other. The difference wasn't in the application at all. It was an IP address on someone else's allowlist.
Twins that weren't
Our brand sites run on a pair of production servers behind a load balancer. They're meant to be identical, so either one can take traffic while the other gets maintenance.
But whenever the second server was serving traffic, search and product filtering broke, and we'd see 502 errors. Switch back to the first server and everything was fine. Same code. Same configuration. Different results.
Compare everything, not just the code
Search on our sites runs through a hosted search service outside our network. So I checked the whole path from each server to that service, one layer at a time, on both machines.
Could each server reach the service at all? Yes, on both. Could each one make an authenticated search request? The first server could. The second couldn't.
Can the server reach the search service? ✓ both
↓
Can it make an authenticated request? ✓ server 1 ✗ server 2
↓
What IP does the service see it coming from?
↓
Is that IP on the service's allowlist? ✓ server 1 ✗ server 2The missing name on the guest list
The search service only accepts requests from approved IP addresses. When I checked which public IP each server actually sends traffic from, the second server's address didn't match anything on the allowlist. The first server had been approved. The second never had been.
So every search from the second server was quietly being turned away. Nothing in our code was wrong. The request just never got through the door.
The fix, and keeping it fixed
The fix was adding the second server's outbound IP to the allowlist. The more useful part was making sure it wouldn't sneak up on us again.
I wrote a post-change checklist that tests connectivity, authenticated search, and each server's outbound IP after any network or load balancer change. We also set up alerts on the load balancer for unhealthy servers, failed requests, slow responses, and server errors, so a problem like this shows up before visitors notice it.
What I took away
- "Identical" servers can still differ in ways that live outside the server.
- When one twin fails, compare them layer by layer: reach, authentication, then identity.
- Allowlists are invisible until they bite you. Write them down.
- A fix should come with a check that proves it stays fixed.