I am currently super, super busy finishing up chapters in the SPF book, but I needed to write this down somewhere...
So I finished writing the first draft of chapter 16. It involved, among other things, installing a second server on the farm and enabling load balancing so the readers could see it in action.
That meant that, at this point, my virtual machine of my SharePoint Foundation installation has two SPF servers load balancing content.
I was reading over some edits of one of my chapters and needed to see the home page without it being a wiki page for a moment. Now, there are a couple of ways to do that, the easiest being deactivating the wiki page home page feature (yeah, funny name) , the next easiest being deleting the Home.aspx page from the Site Pages library real quick (restoring it from the recycle bin takes seconds).
I am really, really behind on my edits, so in my rush, I just deactivated the feature.
I checked the stuff I needed to check, then went back in to re-activate the feature-- and it failed. I went to the other server in the set, and it failed there. I did an IISRESET on both, still failed.
I dropped to the powershell console and tried a get-spfeature command (it brings up a long list of features available for the farm at the moment). Wiki page home page was listed.
So I marked the ID of the feature (okay, so I am an old skool admin, not a developer, and it's just easier for me to grab the ID than write a bunch of pipe stuff. I keep it easy)
I then tried to enable the feature for the site manually, using the enable-spfeature command:
enable-spfeature -identity (paste marked ID here) -url http://theurlofmyrootsite
And it failed, saying " Enable-SPFeature : The Web application at http://spf2 could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application."
What?! I know that site exists, and that I typed it's URL correctly, I was just on it.
I tried an IISRESET, no luck, on both servers, still no luck...
So I tried the same command on the other server, thinking maybe it had something to do with it. Nope.
Then I realized something. I had changed the default zone of the site to be the load balanced address.
::head smack:: Doh!!
I then reran the command but with the load balanced address. (in my case that would be http://sharepoint)
enable-spfeature -identity (paste ID here)
And it worked perfectly!
So what does that say?
It says that in the GUI, ie in the Manage Features for the Site page, when you hit the Activate feature button, it points to the site's original URL when the site was created-- so if you change the default zone for the web application of the site you are activating features on, and you don't include the old URL in AAM to point to the web application, the Activate button might not work.
Bottom line: Either plan to activate or deactivate features via PowerShell if you remove the original URL from AAM for the site, or always include the original URL in AAM for a site (even if you don't want users to use it).