Removing malfunctioning Windows SharePoint Services solutions

It could happen that you (or whatever) accidentally break a deployed solution on a Windows SharePoint Services 3.0 (or MOSS 2007 for that matter) farm or site. If that happens, you can no longer retract and/or remove a solution by using the Operations part of the Central Administration website. It will show up as an error in the list of solutions under “Solution Management”.

So how do you go about removing the solution entirely? You can use the command-line tool STSADM.exe which can be found under “C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12BIN” for a normal installation of WSS 3.0. Let’s assume that the malfunctioning solution is called HelloWorldWebPart.wsp.

To see a list of all solutions that are on the server run the enumsolutions operation. Operations are the commands that STSADM.exe will take after the -o command-line argument. This is the way you run all operations. If you need help on a particular one, call STSADM.exe -help operationname.


Like in the output above, the solution (even if malfunctioning) could be deployed. You will need to retract the solution first. This is where you probably run into trouble. When you run the operation retractsolution like this:

The timer job for this operation has been created, but it will fail because the administrative service for this server is not enabled. If the timer job is scheduled to run at a later time, you can run the jobs all at once using stsadm.exe -o execadmsvcjobs. To avoid this problem in the future, enable the Windows SharePoint Services administrative service, or run your operation through the STSADM.exe command line utility.

Two things can happen at this point: you either panic or stay cool (or panic in a cool way). Should panic kick in, you probably will try to still forcibly delete the solution by running the deletesolution operation anyway.

The solution cannot be removed when a job is scheduled or running. helloworldwebpart.wsp: The removal of the solution failed.

Oh no, what to do now? Calm down. Run an enumeration over the scheduled deployments (retractions are considered deployments as well)

stsadm -o enumdeployments 

The JobId attribute of the deployment gives the GUID for the job that was scheduled but could not run. You can stop the scheduled retraction by running the operation canceldeployment (again, it’s not cancelretraction).

stsadm -o canceldeployment -id 2529c788-971c-46a3-b69f-a2a0a1fcc851

At this point the scheduled retraction should be gone, which you can verify by using enumdeployments again.

Now you can read the message of the retractsolution operation again. You would have done so anyway if you just remained calm. The message says that the WSS Administration service hasn’t been started yet. Not that strange, since by default it is configured to start manually.

Windows services for WSS 3.0

Start the service and run the execadmsvcjobs operation to run all scheduled jobs.


 There you go, no more deployed solution. Now it is just a matter of removing the solution. You can try using the Central Administation website again, because usually the error on the solution has disappeared.


Otherwise, run the deletesolution operation in STSADM.


Drop me a comment if you need help on this.

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s