代码改变世界

Feature is referenced in database but isn't installed on the current farm

2022-09-04 09:20  四毛的家  阅读(115)  评论(0编辑  收藏  举报

场景:最近使用https://github.com/Nauplius/SharePoint-Patch-Script/wiki 批量打Sharepoint 2019的补丁。然后运行配置向导,报错了

Failed to upgrade SharePoint Products.
This is a critical task. You have to fix the failures before you can continue. Follow this link for more information about how to troubleshoot upgrade failures: https://go.microsoft.com/fwlink/?LinkId=866803
--------------------------------------------------------------------------------
An exception of type Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown. Additional exception information:
Feature (Name = [Power View Integration Feature], Id = [bf8b58f5-ebae-4a70-9848-622beaaf2043], Description = [Enables interactive data exploration and visual presentation against PowerPivot workbooks and Analysis Services tabular databases.], Install Location = [PowerView]) is referenced in database [WSS_Content_xxxx], but isn't installed on the current farm. The missing feature might cause upgrade to fail. If necessary, please install any solution that contains the feature and restart upgrade. (EventID:ajxkh)

Feature (Name = [AgilePoint Dashboard], Id = [24fd7159-8ff2-4aad-81b1-8e510358f400], Description = [Include AgilePoint Dashboard webpart to view and manage tasks in AgilePoint BPMS processes. (AgilePoint NX v7.0)], Install Location = [AgilePointDashboard]) is referenced in database [WSS_Content_xxxx], but isn't installed on the current farm. The missing feature might cause upgrade to fail. If necessary, please install any solution that contains the feature and restart upgrade. (EventID:ajxkh)

Feature (Name = [AgilePoint ListForm], Id = [4d377c46-f04a-4bea-8e2f-cfbda11f390f], Description = [Includes the AgilePoint ListForm Web Part which is used to customize the List Entry Forms. (AgilePoint NX v7.0)], Install Location = [AgilePointListForm]) is referenced in database [WSS_Content_xxxx], but isn't installed on the current farm. The missing feature might cause upgrade to fail. If necessary, please install any solution that contains the feature and restart upgrade. (EventID:ajxkh)

Feature (Name = [AgilePoint Process Launcher], Id = [885221be-56d2-4167-837c-de2fe00384c8], Description = [Associates a SharePoint entity with an AgilePoint process. (AgilePoint NX v7.0)], Install Location = [AgilePointWFIntegration]) is referenced in database [WSS_Content_xxxx], but isn't installed on the current farm. The missing feature might cause upgrade to fail. If necessary, please install any solution that contains the feature and restart upgrade. (EventID:ajxkh)

Upgrade completed with errors. Review the upgrade log file located in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\LOGS\Upgrade-20220904-080908-468-63581d979fc94a088d7940db34fb2daa.log. The number of errors and warnings is listed

原因分析:原来公司使用AgilePoint作为流程引擎,后替换为国产的了。可见当初没有彻底移除掉。导致报错了。

解决办法:在对应内容数据库里执行下面语句

SELECT SiteID, WebID, FeatureID
FROM [WSS_Content_xxxx].[dbo].[Features] With (NoLOCK)
WHERE FeatureID IN ('bf8b58f5-ebae-4a70-9848-622beaaf2043','24fd7159-8ff2-4aad-81b1-8e510358f400','4d377c46-f04a-4bea-8e2f-cfbda11f390f','885221be-56d2-4167-837c-de2fe00384c8')

如果SiteID有值,则执行下面方法删除

$site = Get-SPSite -Limit All | ?{$_.ID -eq “SITE ID”}
$siteFeature = $site.Features[“FEATURE ID”]
$site.Features.Remove($siteFeature.DefinitionId, $true)

如果WebID有值,则执行下面方法删除

$site = Get-SPSite -Limit all | where { $_.Id -eq “SITE ID” }
$web = $site | Get-SPWeb -Limit all | where { $_.Id -eq “WEB ID” }
$webFeature = $web.Features[“FEATURE ID”]
$web.Features.Remove($webFeature.DefinitionId, $true)

 

 

参考:

https://www.risual.com/2019/03/removing-non-used-sharepoint-features-from-content-databases/

https://docs.microsoft.com/zh-cn/archive/blogs/dawiese/post-upgrade-cleanup-missing-server-side-dependencies