Initially, there is a seal around the sliding section, and this may well be damaged or worn. There are also usually drain pipes on either side which could well be clogged. Open the roof fully and have a good look at the seal. As for the drain pipes, you need something long and flexible to 'poke' down them to clear them out. (When with AA, I had a length of Bowden cable with one end soldered and rounded off so as not to damage the pipe.)