Earthing fault. Usually removing the wire block on the back of the light unit and cleaning up, bit of ub40 on all the contacts and bob's your monkhouse.
If you're unlucky, you may need a small screwdriver to move the pins about a bit.
It's perfectly fixable but can take a lot of faffing about.