This problem can be due to overheating of the CPU. When a CPU overheat is detected, this system might automatically shutdown.

Check that the CPU fan is installed correctly. Try unplugging the CPU fan and then plugging it in again.

Hope this solves the problem