SharePoint solution(.wsp) stuck in deploying/retracting

SharePoint solution(.wsp) stuck in deploying/retracting

We were getting a strange issue while deploying the SharePoint solution on our onprem environment. The status of the solution was always in deploying or retracting but never changed.

Below are the possible solutions:

1. SharePoint Timer service(SPTimerV4) should be started on the all the WFE and APP servers on the FARM. Restart the timer service once if possible.
2. Restart the SharePoint Administration service on the all the servers
3. Make sure all the servers are in same time zone
4. Restart all the WFE/APP servers
5. Execute the powershell Start-SPAdmin(Equivalent stsadm command stsadm -o execadmsvsjobs) on all the servers on the farm
6. Clear the Config cache on the index server

Add-PSSnapin -Name Microsoft.SharePoint.PowerShell –erroraction SilentlyContinue
Stop-Service SPTimerV4 $folders = Get-ChildItem C:\ProgramData\Microsoft\SharePoint\Config  foreach ($folder in $folders)    {    $items = Get-ChildItem $folder.FullName -Recurse    foreach ($item in $items)        {            if ($item.Name.ToLower() -eq "cache.ini")                {                    $cachefolder = $folder.FullName                }                        }    }$cachefolderitems = Get-ChildItem $cachefolder -Recurse    foreach ($cachefolderitem in $cachefolderitems)        {            if ($cachefolderitem -like "*.xml")                {                   $cachefolderitem.Delete()                }                }        $a = Get-Content  $cachefolder\cache.ini$a  = 1Set-Content $a -Path $cachefolder\cache.ini
read-host "Do this on all your SharePoint Servers - and THEN press ENTER" start-Service SPTimerV4

7. Check all the in-progress deployents stsadm -o enumdepoyments and cancel all the 
deployments stsadm -o canceldeployment -id "job id here"
8. Check if any timer service instance is not online, If any instance on the FARM is not online execute below script and start the instance

$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"
}




Comments

Popular posts from this blog

Create and Deploy custom copilot to SharePoint Site (Part 2)

Create and Deploy custom copilot to MS Teams and SharePoint Site (Part 1)

Copilot Announcements from Microsoft Build 2024