Friday, February 16, 2018

SharePoint 2013 - SharePoint Farm Solution WSP not getting deployed in all servers.

SharePoint Farm solution installation enables developers to package custom farm solutions and administrators to deploy those farm solutions in a straightforward, safe, and consistent manner. 

we sometimes see failures when trying to copy assemblies to the Global Assembly Cache (GAC) or remove assemblies or other files from the bin or 14 or 15 hive during solution retraction and/or deployment. Sometimes we get the issue where the WSP is getting installed only on one of the WFE or App Servers.

Certainly, There is a possibility to deploy the solution on only one server using "-Deploy LOCAL" property. But this is for troubleshooting step and not recommended for Production. If i don't use LOCAL property, then solution should get deployed to all WFEs and App servers (if any).



To avoid this error, Please check on following things:

  • Restart the SharePoint 2010/2013 Administration service on all of the Web Front End servers (all servers on the farm where the Foundation Web Application service is running).
  • Make sure Timer Service is running fine
  • Farm-level SharePoint Foundation Timer job was only visible from PowerShell.
    • Run the following script to get the status of Internal SharePoint Foundation Timer Job

if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) 
{
    Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}
$farm = get-spfarm  
$ss = $farm.Servers | ? {  
    $_.Role -notlike "Invalid"  
}  
foreach($s in $ss) {  
    $s.name  
    Write-host "........................."  
    $is = $s.ServiceInstances  
    foreach($i in $is) {  
        if ($i.TypeName -eq "Microsoft SharePoint Foundation Administration") {  
            $i.Typename  
            $i.status  
        }  
        if ($i.TypeName -eq "Microsoft SharePoint Foundation Timer") {  
            $i.Typename  
            $i.status  
        }  
    }  
    • From above result find out which server has disabled timer job.
    • Check SPTimerServiceInstance is in disabled state and it is affecting all administrative operations that depend on timer jobs to be completed (like depoying..the solution or starting the User Profile Sync Service).

if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) 
{
    Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}

$farm = Get - SPFarm  
$disabledTimers = $farm.TimerService.Instances | where {  
    $_.Status -ne "Online"  
}  
if ($disabledTimers -ne $null) {  
    foreach($timer in $disabledTimers) {  
        Write -Host "Timer service instance on server " $timer.Server.Name "is not Online. Current status:"  
        $timer.Status  
        Write -Host "Attempting to set the status of the service instance to online"  
        $timer.Status = [Microsoft.SharePoint.Administration.SPObjectStatus]::Online  
        $timer.Update()  
    }  
} else {  
    Write -Host "All Timer Service Instances in the farm are online! No problems found"  
}
                                                                                      • Clear the Config Cache on the all servers in the farm. Please follow this wiki for clearing config cache.
                                                                                    • Finally, redeploy the Solution either using PowerShell or Via Central admin.