dsccommunity / dsccommunity/SharePointDsc
SPSearchManagedProperty: crawled property does not exist (even though it does)
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 246
- Forks
- 106
- PR merge metrics
- No merged PRs in 30d
Description
Details of the scenario you tried and the problem that is occurring
I'm trying to add managed properties, but SPSearchManagedProperty doesn't seem to accept anything into CrawledProperties. I've checked from Central Administration that the crawled property exists, but DSC says it's missing. I've tried different ways to write the property name, but nothing seems to work.
Here is the configuration I'm using:
SPSearchManagedProperty BusinessKeywords
{
ServiceAppName = "Search Service Application"
Name = "BusinessKeywords"
PropertyType = "Text"
#Searchable = $true # see issue 1288
Queryable = $true
Retrievable = $true
HasMultipleValues = $true
Refinable = $false
Sortable = $false
NoWordBreaker = $false
IncludeAllCrawledProperties = $false
CrawledProperties = @("ows_taxId_Business_Keywords")
Ensure = "Present"
PsDscRunAsCredential = $SetupAccount
DependsOn = "[SPSearchServiceApp]SearchServiceApp"
}
I tried replacing ows_taxId_Business_Keywords with SharePoint:ows_taxId_Business_Keywords but it didn't work either.
On the node this will report the following:
$status = Get-DscConfigurationStatus
$status.ResourcesNotInDesiredState
ConfigurationName : SharePoint
DependsOn : {[SPSearchServiceApp]SearchServiceApp}
ModuleName : SharePointDSC
ModuleVersion : 4.3.0
PsDscRunAsCredential :
ResourceId : [SPSearchManagedProperty]BusinessKeywords
SourceInfo : C:\xxxxxx
DurationInSeconds : 0,531
Error : {
"Exception": {
"Message": "PowerShell DSC resource MSFT_SPSearchManagedProperty failed to execute Set-TargetResource functionality with error message: The specified crawled property ows_taxId_Business_Keywords does not exist. Please make sure you specify valid existing crawl properties. ",
"Data": {
},
"InnerException": {
"SerializedRemoteException": "System.Management.Automation.RuntimeException: The specified crawled property ows_taxId_Business_Keywords does not exist. Please make sure you specify valid existing crawl properties.",
"SerializedRemoteInvocationInfo": "System.Management.Automation.InvocationInfo",
"ErrorRecord": "The specified crawled property ows_taxId_Business_Keywords does not exist. Please make sure you specify valid existing crawl properties.",
"WasThrownFromThrowStatement": false,
"Message": "The specified crawled property ows_taxId_Business_Keywords does not exist. Please make sure you specify valid existing crawl properties.",
"Data": "System.Collections.ListDictionaryInternal",
"InnerException": null,
"TargetSite": "Void EndInvoke()",
"StackTrace": " at System.Management.Automation.Runspaces.AsyncResult.EndInvoke()\r\n at System.Management.Automation.PowerShell.CoreInvokeRemoteHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)\r\n at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)\r\n at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)\r\n at Microsoft.PowerShell.DesiredStateConfiguration.Internal.ResourceProviderAdapter.ExecuteCommand(PowerShell powerShell, ResourceModuleInfo resInfo, String operationCmd, List`1 acceptedProperties, CimInstance nonResourcePropeties, CimInstance resourceConfiguration, LCMDebugMode debugMode, PSInvocationSettings pSInvocationSettings, UInt32\u0026 resultStatusHandle, Collection`1\u0026 result, ErrorRecord\u0026 errorRecord, PSModuleInfo localRunSpaceModuleInfo)",
"HelpLink": null,
"Source": "System.Management.Automation",
"HResult": -2146233087
},
"TargetSite": null,
"StackTrace": null,
"HelpLink": null,
"Source": null,
"HResult": -2146233079
},
"TargetObject": null,
"CategoryInfo": {
"Category": 7,
"Activity": "",
"Reason": "InvalidOperationException",
"TargetName": "",
"TargetType": ""
},
"FullyQualifiedErrorId": "ProviderOperationExecutionFailure",
"ErrorDetails": null,
"InvocationInfo": null,
"ScriptStackTrace": null,
"PipelineIterationInfo": [
]
}
FinalState :
InDesiredState : False
InitialState :
InstanceName : BusinessKeywords
RebootRequested : False
ResourceName : SPSearchManagedProperty
StartDate : 10.2.2021 12.31.46
StateChanged : False
PSComputerName :
In Central Administration I see the following info when checking the crawled property:
Property Name: ows_taxId_Business_Keywords
Category: SharePoint
Property Set ID: 158d7563-aeff-4dbf-bf16-4a1445f0366c
There's a possibility this might be a bug in SharePoint 2019 itself, because there have been other issues with search as well, but I'm reporting it anyway in case it's not. The other issues I'm talking about: This is a fresh installation (test environment) and originally I also installed the August CU. I configured most things with DSC, but crawled properties never appeared at all, even when I deleted and recreated the search service manually. I noticed there were reports of similar issues with online Team Sites. I tried all kinds of fixes for months, but nothing worked. I couldn't find anything wrong with the farm, so I reinstalled everything but without the CU, and then crawled properties appeared as they should. However, this didn't help with DSC and it still gives this error, as if the crawled properties don't exist. Another issue with search is what is described here but adding rights did not help in our case. This is an inconvenience, but manageable as long as you don't try to change the rights.
Verbose logs showing the problem
See above.
Suggested solution to the issue
N/A
The DSC configuration that is used to reproduce the issue (as detailed as possible)
See above.
The operating system the target node is running
Windows Server 2019 Standard
SharePoint 2019 "out of the box" with no cumulative updates
Version and build of PowerShell the target node is running
PSVersion 5.1.17763.1490
BuildVersion 10.0.17763.1490
Version of the DSC module that was used
SharePointDSC 4.3.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the SPSearchManagedProperty resource and its Set-TargetResource path, focusing on how CrawledProperties are validated against SharePoint 2019. Reproduce the configuration with the stated SharePointDSC 4.3.0, PowerShell 5.1, and no cumulative updates, then compare the DSC lookup with Central Administration. Done means the cause is identified and the resource either accepts the existing property or clearly documents an external SharePoint limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- search
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100