While combing the server logs for clues as to what might have caused the latest incident in staging, Steve was startled to find that the box he was looking at hadn't logged anything for months.

Was logging disabled? No, it all looked fine. He accessed the box directly and the site came right up, complete with an entry in the access logs. So where were the logs for the past three months?

On a hunch, he checked the proxy.pac:


function FindProxyForURL(url, host) {
	var myip=myIpAddress(); 
	var ipbits=myip.split("."); 
	var myseg=parseInt(ipbits[3]); 
	if(myseg==Math.floor(myseg/2)*2){ 
		return "PROXY 172.28.97.17:8080; PROXY 172.28.97.18:8080; DIRECT"; 
	} 
	else { 
		return "PROXY 172.28.97.17:8080; PROXY 172.28.97.18:8080; DIRECT"; 
	} 
}

Not only was the file missing the third staging server, but every calculation was redundant since it always returned the same string. He replaced it with a one-liner, added the third server, and tossed another item onto the ever-growing backlog of technical debt to look into someday. Someday...

 

Photo credit: creativegaz / Foter / CC BY

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!