Wednesday, December 29, 2010

Soltion for error: "The solution cannot be removed when a job is scheduled or running"

if you are getting the following error while deleting solution: The solution cannot be removed when a job is scheduled or running, that means your solution got corrupted while deployment and it is not retractable.
Even if you will see under operation in Central Administration( under "Solution Management"), it will not give you option to retract and it will show error without detail.

Here is the solution to remove corrupted soltuion from sharepoint 2007:

step-1:
get the job id using enumdeployments
stsadm -o enumdeployments
i.e. job id(2529c788-971c-46a3-b69f-a2a0a1fcc851)

step-2:
cancel deployment using job id
stsadm -o canceldeployment -id 2529c788-971c-46a3-b69f-a2a0a1fcc851

step-3:
once job id in step 2 is canceled than retract solution
stsadm -o retractsolution "Yoursolution.wsp" -immediate

step-4:
once retract is completed than delete solution
stsadm -o deletesolution "Yoursolution.wsp" -override

enjoy green coding using free www.code4green.com site