Unable to deploy wsp pacakage - Timer job and cache issue
Sometime back in my project , I couldn't deploy wsp packages anymore. After some analysis found there are lot of one time job were running and it was blocking wsp deplopyment. Here I have provided the steps to resolve it,
- In Central Admin checked in Farm Solution Management the status was stuck on Deploying
- Stopped the SharePoint Admin and SharePoint Timer
services
- Checked and found multiple One-time jobs, deleted those using the scripts below:
-
Get-SPTimerJob
| where{$_.DisplayName -eq $null} | foreach-object {$_.Delete()}Get-SPTimerJob
| where{$_.schedule.description -eq "One-time"} |
ForEach-Object{$_.Delete()}
-
Checked if the timer service is ON using the script
-
$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()
-
}
-
}
Cleared the timer Cache on
all the servers:
-
Stop the SharePoinnt timer service
-
%SystemDrive%\ProgramData\Microsoft\SharePoint\Config
-
Inside
this folder you will find lots of files. Your goal is to delete all the files,
except the cache.ini. First make a backup of the cache.ini file. You can either
copy and paste it in the same folder. The cache – Copy.ini will become your
backup file.
-
Delete
all the files. This will leave you with only the cache.ini file in this folder.
DO NOT delete the folder. Your goal is to rebuild the cache in the same folder
that was created by the system.
-
Open
the cache.ini file. You are probably expecting tons of information in the file
but all it has is a 5 or 6-digit number, e.g. 356867. Replace this number with
1 so the only data in the file is the number 1. Now save the file. Changing
this number to 1 resets the cache and it will be rebuild after the SharePoint
Timer Service is restarted.
-
Rebooted
the SharePoint servers and ran IISreset
-
So ran the below commands and solution was deployed
-
Add-SPSolution
-LiteralPath E:\
-
Install-SPSolution
-Identity SharePointProject1.wsp -GACDeployment -ForceAdd-SPSolution
-LiteralPath "E:\ExampleProject\bin\Debug\SharePointProject.wsp"
Comments
Post a Comment