Tuesday, May 23, 2017

An error occurred while running detection.

I was applying a cumulative update to my server farm and ran into this error as soon as I started the installation

“An error occurred while running detection.”
Hmm…that seems weird. I tried install prerequisite files and I still got the same error.
I checked Central Admin to see which version SharePoint was running on since I figured I might be trying to install the wrong version. Under “Check Product and patch installation status”, to my horror, I saw this:

I decided to turn to Google for help. After a few searches on “An error occurred during detection”, I happened upon a great blog post that told me my c:\windows\installer folder might be corrupted or missing files. I checked my Central Admin server and sure enough, it was missing most of its .msi and .msp files!
I found a .vbs script on this site: https://kurteichler.wordpress.com/2013/09/11/restore-sharepoint-2010-installer-directory-cache-files/
and used it to restore my missing files.
In order to do so, you must
  1. Copy the c:\windows\installer folder from another working SharePoint server into a local c:\temp\ folder onto your bad server.
  2. Copy the script above into a file. I suggest using a text editor like Notepad++ instead of regular notepad. I tried copying the code into Notepad and I got errors because Notepad reads certain characters as ASCII characters so when you try to run it as a .vbs script, it returns error: unknown characters. Or you can download it from me: OpUtil.txt. Open it, look at it if you want, but be sure to rename it as a .vbs file instead of a .txt. Also put this script into your c:\temp\ folder for organization.
  3. Open up command prompt on your bad server. Navigate to c:\windows\installer and run the following command:
    • runas /user:DOMAIN\Admin_Account “cscript.exe c:\temp\OpUtil.vbs /RepairCache /srestorelocation=c:\temp\”
  4. Open up a PowerShell window and run Get-SPProduct -local to update the farm’s configuration database.
  5. Run psconfig.exe to update everything and now you should be ready to install your updates.

No comments:

Post a Comment