Don’t use flex seal on your roof. It will fuse to the membrane, unlike lap sealant, and won’t come off without destroying it.
Use the Camco vent cap kit link that someone posted earlier. Install and Dicor around the base.
Please don’t spray foam it lol it’s a vent pipe for your holding tanks it needs a cap on it. I’m pretty sure you can get one at Walmart down there camping aisle.
It almost looks like the vent behind my fridge. Mine has a cap.
Carefully remove the sealant and wood, and replace with a suitable rubber or plastic roof flange. You may need to heat the sealant with a hair dryer or heat gun to remove it. Then reapply Dicor self leveling sealant. Get a cap for the pipe too, a simple friction fit cap will work fine. If you don’t wanna remove the old stuff, the just Dicor the whole area.
Scrape off the old sealant with a heat gun and richard scraper/thick putty knife. Clean the area u scraped with some RV cleaning solution like magic boss. Then with Dx330 or white gas to get the residue off. Buy a pipe vent cover and some butyl. Put the butyl on the bottom of the pipe vent where the screw holes are. Screw it down. Use self leveling lap sealant around the base of the new vent cover and over the screws. Put the cap lid on, screwcthat to its screw hole. Seal the little hole the screw goes in. Done good as new.


