Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am using Search Server Express 2010. I am creating Search application using PowerShell scripts.

After creating crawl and query components, i am activating them.

First activating crawl component

$crawlTopology = Get-SPEnterpriseSearchCrawlTopology -SearchApplication $searchApp | where {$_.CrawlComponents.Count -gt 0 -or $_.State -eq "Inactive"}
if($crawlTopology -eq $null)
{
    throw "Unable to find the crawl topology for Search application $SearchAppName."
}
$crawlTopology | Set-SPEnterpriseSearchCrawlTopology -Active -Confirm:$false -ErrorAction SilentlyContinue -ErrorVariable err
if ($err -ne $null)
{
    throw $err
}
while ($true) 
{
    $ct = Get-SPEnterpriseSearchCrawlTopology -Identity $crawlTopology -SearchApplication $searchApp
    $state = $ct.CrawlComponents | where {$_.State -ne "Ready"}
    if ($ct.State -eq "Active" -and $state -eq $null) 
    {
        break
    }
    #Write-host -ForegroundColor Yellow "Waiting on Crawl Components to provision..."
    Start-Sleep 2
}
# Need to delete the original crawl topology that was created by default
$searchApp | Get-SPEnterpriseSearchCrawlTopology | where {$_.State -eq "Inactive"} | Remove-SPEnterpriseSearchCrawlTopology -Confirm:$false

Then I am activating query component.

$queryTopology = Get-SPEnterpriseSearchQueryTopology -SearchApplication $searchApp | where {$_.QueryComponents.Count -gt 0 -or $_.State -eq "Inactive"}   
if($queryTopology -eq $null)
{
    throw "Unable to find the query topology for Search application $SearchAppName."
}
$queryTopology | Set-SPEnterpriseSearchQueryTopology -Active -Confirm:$false -ErrorAction SilentlyContinue -ErrorVariable err
if ($err -ne $null)
{
    throw $err
}
while ($true) 
{
    $qt = Get-SPEnterpriseSearchQueryTopology -Identity $queryTopology -SearchApplication $searchApp
    $state = $qt.QueryComponents | where {$_.State -ne "Ready"}
    if ($qt.State -eq "Active" -and $state -eq $null) 
    {
        break
    }
    #Write-Host -ForegroundColor Yellow "Waiting on Query Components to provision..."
    Start-Sleep 2
}
# Need to delete the original query topology that was created by default
$searchApp | Get-SPEnterpriseSearchQueryTopology | where {$_.State -eq "Inactive"} | Remove-SPEnterpriseSearchQueryTopology -Confirm:$false

When i call query component activation, I am getting the following error:

Another topology activation is in progress. Please wait until it is finished and try again

This is not happening everytime. Only happens few times. I am already checking for Topology status before proceeding. What other steps can i add to make sure that I don't get this error. Is there any job that i can check?

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.