From another source: "Attic installations are especially problematic. If during the summer months the air that surrounds the water heater is higher than tank's set temperature, the thermostat won't open the gas valve to light the main burner. Heat produced by the pilot flame is not enough to make a condition for natural draft, so all the oxygen will burn up and pilot light will extinguish."
Seems you need to increase the air-flow through the attic and/or reduce the temp up there. If recently installed (last few years), get the original installer back out. They should have been aware of this. Maybe a powered attic exhaust fan or two to reduce that air temp. is in order...