Reporting services role installation fails with msi error

By | January 29, 2024

I observed a strange behavior of the reporting services setup process. Below a scripted workaround for it.

Symptoms:
The setup of the reporting point role fails. Under Monitoring->System Status, you see that the installation reruns every hour with the same result.

Components error message:

Site Component Manager failed to install this component, because the Microsoft Installer File for this component (srsrp.msi) could not install.

Refer to the srsrpSetup.log, the srsrpmsi.log, as well as the ConfigMgr Documentation and the Microsoft Knowledge Base for further information.

The problem:

srsrpsetup.exe calls the srsrp.msi with an install path but the srsrp.msi switches to another path during the setup. When the srsrpsetup.exe checks the installation location to register a dll, it doesn’t find it and returns an error.

The issue can obviously only occur on systems with multiple drives. 

On the reporting server, you will find the following log entries (the drives may of course be different than D: and F:):

srsrpmsi.log

MSI (s) (60:C0) [16:19:35:659]: Command Line: SRSRPINSTALLDIR=D:\SMS_SRSRP SRSRPLANGPACKFLAGS=0 CURRENTDIRECTORY=D:\SMS\bin\x64 CLIENTUILEVEL=3 MSICLIENTUSESEXTERNALUI=1 CLIENTPROCESSID=10984

MSI (s) (60:C0) [16:19:35:690]: PROPERTY CHANGE: Modifying TARGETDIR property. Its current value is ‘D:\SMS_SRSRP’. Its new value: ‘F:\SMS_SRSRP’.


The workaround:
At the beginning of the installation process, srsrpsetup.exe will delete the installation folder on the target drive. If you want to outsmart the process by just copying it back, you only have around 5 seconds until the failure occurs. Since you can’t say exactly when the installation will start after a failure, it makes sense to automate the process. The steps:

  1. Copy the installation folder that the msi setup created and paste it to the drive where srsrpsetup.exe expects it. Rename it to SMS_SRSRPtemp. Delete or rename the folder that the msi created.
  2. Set the variables in the script below and let it run. Latest after one hour, you should see that the process succeed. 
    As a sign of live, the script will write a dot (‘.’) every 120 seconds.

The code:

Link to Github

#Copy the content of the installation folder of the msi to the target folder of srsrpsetupexe and rename ist to SMS_SRSRPtemp 
$temp = "f:\SMS_SRSRPtemp"
#Enter the name of the folder that the msi installs to
#In srsrpmsi.log search for "Modifying TARGETDIR property."
#Delete or rename the target folder of the msi
$msiInstFolder = "g:\SMS_SRSRP"

$logFile = "d:\Logs\rename_log.log"

#------------------ Begin Functions ------------------------------------
function Log([string]$ContentLog)
{
Write-Host "$(Get-Date -Format "dd.MM.yyyy HH:mm:ss,ff") $($ContentLog)"
Add-Content -Path $logFile -Value "$(Get-Date -Format "dd.MM.yyyy HH:mm:ss,ff") $($ContentLog)"
}

Log ("Script starting: " + $currentTime)
$i=0
while ($true) {
$currentTime = Get-Date
$formattedTime = $currentTime.ToString("HH:mm:ss")

if (Test-Path($msiInstFolder)) {
try {
Rename-Item -Path $temp -NewName "SMS_SRSRP" -ErrorAction Stop

$logMessage = "Folder renamed at $($currentTime.ToString('yyyy-MM-dd HH:mm:ss'))"
Log $logMessage

break # Break out of the loop once the folder is renamed
}
catch {
$errorMessage = "Error renaming folder: $_"
Log $errorMessage
}
}

$i++
if(($i%120) -eq 0){write-host "."}

Start-Sleep -Seconds 1
}

Log "Script ending"

 

Leave a Reply

Your email address will not be published. Required fields are marked *