I checked it all out. Bulbs are not loose. The ballast is inaccesible, but while checking things out, it became clear that there is a short somewhere. Sometimes it lights, sometimes it doesn't, but I can't find the short.
It sounds more like a connection problem rather than a short, to me. When you say it lights and then doesn't, how does it light? Sometimes when you plug it in , yes, others times no? If you want to try to find it, I would go about it this way. Plug it in and then shake the whole thing and roll it around. Also try just rolling the bulb left/right just a bit. Sometimes there is a little corrosion at the little contacts on the ends. If it tries to light when you are shaking it, I would guess there might be a loose connection inside. There may be a way to take a cover off to see the wiring??? If so unplug it and take this cover off. These are sometimes put together with screw on connectors and they may not be good and tight. If you find something like that, try twisting them a bit more. It may make contact and be good to go. Just guessing from afar.