You probably don't have to rewire anything, just make sure you have good grounds to all of the fixtures. Try running a wire from the frame to each socket where you are having a problem. If that light works then you have a bad connection between the frame, bed, fender, light fixture, etc. Paint will not conduct sufficient current.