Unexpected end of print

I’ve had a curious issue : the printer ended printing before the expected end (at about 9/10).

And it didn’t freeze. There is no error message either. It’s acting like the print is completed but it’s not. The LCD shows the usual message displayed at the end of a normal print job. Only difference : the end sequence is not played and the print head stays warm and is located where the print ended.
Otherwise the printer and the LCD are fully functional.
I’ve inspected the G-code and everything seems normal.
I didn’t worry the first time but I already got that issue twice and I can’t figure out what can do that. A pause command could do that but i didn’t find any in the G-code.

Where you printing via SD CARD or PC?

Via SD card.

And it occurred a third time …

A long shot: Is the humidity in the room extremely low (<35)?
This could lead to static discharges.

When you check the gcode on the SD card is it identical to the gcode on the computer. It can happen that when you save to SD card from Repetier the write speed to the card is very slow and it takes some time to write the complete file. When you eject the file to soon it is possible the end of the gcode is not on the SD card.

Silly me, always in a hurry!
That must be it. I checked the G-code in Repieter not on the SD card. I’ll have a look at it when I’m back home.

Edit : I’ve checked and indeed the end of the file is missing on the SD. I’ll be more patient when I’m writing files on the SD card.