I'm having trouble with a site collection in a MOSS2007 farm. I'm trying to enable the Publishing feature at the site collection level. When I try to activate the Feature from Site Settings -> site Collection features, I get one of those incredibly helpful SharePoint error messages.
Error. Cannot complete this action. Please try again.
So I thought I'd try with stsadm, and I ran this
stsadm -o activatefeature -name Publishing -url http://server/site
I got the more helpful error message
Provisioning did not succeed. Details: Failed to create the 'Pages' library. OriginalException: The feature failed to activate because a list at 'Pages' already exists in this site. Delete or rename the list and try activating the feature again.
Now that's more like it! I checked, and sure enough there was a Pages library. I deleted it. I ran stsadm again fully expecting it to work this time. No dice. I'm getting the same error, but now there's no 'Pages' document library. I emptied the recycle bin. Same error. I'm stumped.
Per the two suggestions below, I made sure that the site collection recylcle bin was also emptied and that there were no 'Images' or 'Documents' libraries hanging around. I still can't activate the feature.
Try running a utility like Sharepoint Manager on your site. Maybe it will see a list called Pages that for some reason you aren't seeing through the web interface.
The publishing features creates three libraries (among other things)
You might need to delete more than just the Pages library.
sometimes list, web, or page already exist while you are running provisioning code you can use sharepoint designer to pin point that object and delete it from there
Cheers