Ahh, an intermittant connection.
Have you tried a different power cord? The problem could be there.
It could be that the socket is loose. The plug may have been pushed in too far or to one side and loosened up the socket.
That would require opening up the unit and either gently bending the socket back into shape or replacing it.
It could be faulty connections between the socket and the PCB. Resoldering the joints might fix it.
You see there is no easy way of telling just what is wrong with it from here. It could be many different things.