Using the SD card AND the Ethernet on sheild causes issues

Your chip selects are not clear. Your comment says Ethernet chip select is 4 but your SD.begin uses 4 and you have this output config:

 pinMode(10, HIGH);

Please identify the SD and Ethernet chip selects.
Is it :
Ethernet=4
SD =10

?
PLEASE define ALL of you I/O using #define along with your other defnitions. We shouldn't have to search through your code to find your I/O definitions.