At my client’s location, we deploy new sites using a PowerShell script because all of our sites are deployed with the same template (except for security groups and accounts). After patching our SharePoint 2013 environment to October 2015 CU we were unable to create a new site using this PowerShell script. We received the error: “Object [SPContentDatabase name = <name of ContentDB>] is in an unsupported state and could not be used by the farm” (my aplogies, I forgot to grab a screenshot of the error).
While troubleshooting we were able to use other commands to access SPWeb objects and SPSite objects with no issue. The farm itself seemed to be working fine. No users were reporting any issues. We could even create new sites using the GUI. For come reason though, PowerShell would not work. Now, while other methods worked fine, having a once working process no longer working spells out some kind of problem with the farm.
The culprit appeared to be a poorly deployed patch on one of the servers:
Looking at the logs, there is but two errors listed:
“Database [CONTENTDB] contains a site (Id = [GUID], Url = [SITEURL]) that is not found in the site map. Consider detach and reattach the database.”
“Database [CONTENTDB] contains a site (Id = [GUID], Url = [SITEURL]) whose url is already used by a different site, in database (Id = [GUID], name = [CONTENTDB2]), in the same web application. Consider deleting one of the sites which have conflicting urls.”
So it appears to be some orphaned sites in place. So initially I thought to clean up the orphaned sites, but decided against it as this was production and I didn’t want to make any serious changes there without testing. Instead, I re-ran the configuration wizard to see if any further errors occurred. The patch config completed successfully (though apparently it did the first time as well). Went back and checked the upgrade status. No change (no update either). I have a feeling this only occurs during the patch process not the config process.
Decided to re-attempt a site creation using the same script and it worked fine.
Re-run the configuration wizard. Perhaps something didn’t work as expected the first time, but the second attempt should fix the problem for you.
Hope this helps.