please see the GIF attached where i run though the code twice, once with and once without the Relay update test code. This may give you a better understanding of the issue.
That picture is like taking a picture of the trunk of your car to illustrate how beautiful the Grand Canyon is.
It didn't tell me a thing.
The relay board, with relays doing nothing, could be interfering with pins that have dual purpose, though I can't see where/how. On the other hand, I can't see what Arduino, or not-exactly-an-Arduino, you are running that code on...
The relays, controlling things, could be causing electrical interference, but I can't see how that would affect the server's ability to find a resource.
So, you need to start at the beginning. Disconnect the relay board. Run the code, manipulating the relay pins. If that works, the problem is NOT the code. If not, the problem is NOT the hardware.
Having determined if the problem is hardware or software, we can begin fixing it.