Loose ground behind the light or a failing bulb. Could also have something to do with a sticking switch on the door jam but even with that bad the light should come on with a push. If the cover is not installed correctly, the light will not come on by tapping it I know.