Mid Server DOWN due to false "expected service name" error, (1) if because of powershell issue the service name cannot be fetched or (2) if the 'case' of the Service Name not exactly matching between wrapper-override.conf and the running service/registryDescriptionMid Server DOWN due to false "expected service name" error in 2 situations: 1.if the startup check fails with Powershell error for Get-WmiObject, or any other error that results in the service name not being fetched. StartupSequencer SEVERE *** ERROR *** The current service named does not match the expected service name snc_mid_test_ha1. The current service is being stopped Any error like this when running the powershell script on startup is not properly handled, which results in the check for duplicate service names still running using invalid input for service names and shutting down the MID Server, even though there is not actually a duplicate service or service name mismatch. 2.If the 'case' of the Service Name not exactly matching between wrapper-override.conf and the running service/registry. This check should not be case sensitive, because the case does not matter, because Windows won't allow the creation of a duplicate with the same name but different case in the first place. StartupSequencer SEVERE *** ERROR *** The current service named snc_mid_test_HA1 does not match the expected service name snc_mid_test_ha1. The current service is being stoppedSteps to Reproduce 1.if the startup check fails with Powershell error for Get-WmiObject, or any other error that results in the service name not being fetched. On a Windows host that has a problem with WMI or powershellEither install a new Paris or later MID Server, or upgrade a pre-orlando MID Server to Paris. (it is not clear if this effects Orlando as well as Paris yet)On startup the following errors will be seen in the agent log, and the MID Server will go down and stay down. StartupSequencer Running command to determine Powershell version: "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -noninteractive -nologo -noprofile -command "$vStartupSequencer PowerShell version result: full_version:5.1.14409.1018, major_version:5StartupSequencer verify Powershell major version 5 against compatible version requirement (v3 - v5)StartupSequencer PowerShell path is set to "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe", version 5.1.14409.1018StartupSequencer DEBUG: HTTPClient.registerOtherProtocols() starting on Thread Thread[StartupSequencer,5,main].StartupSequencer The service name is detected as snc_mid_test_ha1StartupSequencer WARNING *** WARNING *** Continuing with start up, but Windows file system permissions enforcer encountered an issue: Get-WmiObject : Out of disk space WmiObject : Out of disk space At E:\MID Servers\TEST\agent\bin\scripts\EnforceFilePermissions.psm1:216 char:16+ ... $service = Get-WmiObject "win32_service" -filter "Name='$serviceName ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Get-WmiObject], ManagementException + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand Followed by this: - Note the empty "current service named" value, showing the code has not checked it actually has a value. StartupSequencer SEVERE *** ERROR *** The current service named does not match the expected service name snc_mid_test_ha1. The current service is being stoppedWrapper-Stopper Stopping MID serverMIDServer MID Server stopped A new install's logs may look like this. "Unable to log the following" is due to the MID Servre record not having been created yet at this point of the first startup.: StartupSequencer PowerShell version result: full_version:5.1.14393.3471, major_version:5StartupSequencer verify Powershell major version 5 against compatible version requirement (v3 - v5)StartupSequencer PowerShell path is set to "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe", version 5.1.14393.3471StartupSequencer DEBUG: HTTPClient.registerOtherProtocols() starting on Thread Thread[StartupSequencer,5,main].StartupSequencer The service name is detected as snc_mid_psnowmid02StartupSequencer WARNING *** WARNING *** Continuing with start up, but Windows file system permissions enforcer encountered an issue: Get-WmiObject : Invalid class "win32_service"At C:\servicenow\ServiceNow MID Server psnowmid02\agent\bin\scripts\EnforceFilePermissions.psm1:216 char:16+ ... $service = Get-WmiObject "win32_service" -filter "Name='$serviceName ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidType: (:) [Get-WmiObject], ManagementException + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand StartupSequencer WARNING *** WARNING *** Unable to log the following MID Issue due to unknown MID sys_id: An unexpected error occurred: Get-WmiObject : Invalid class "win32_service"At C:\servicenow\ServiceNow MID Server psnowmid02\agent\bin\scripts\EnforceFilePermissions.psm1:216 char:16+ ... $service = Get-WmiObject "win32_service" -filter "Name='$serviceName ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidType: (:) [Get-WmiObject], ManagementException + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand 2.If the 'case' of the Service Name not exactly matching between wrapper-override.conf and the running service/registry. This check should not be case sensitive, because the case does not matter, because Windows won't allow the creation of a duplicate with the same name but different case in the first place. Exactly how several customers have got into this situation is currently unclear. For the purposes of testing: Install a MID ServerEdit wrapper-override.conf to change the case of a character in the service namerestart the MID Server The Agent log will show an error like this, before then going down: 06/30/20 14:32:43 (772) StartupSequencer SEVERE *** ERROR *** The current service named snc_mid_sjnkkst_IT_mid1does not match the expected service name snc_mid_sjnkkst_it_mid1. The current service is being stoppedWorkaroundThis problem is currently under review. You can contact ServiceNow Technical Support or subscribe to this Known Error article by clicking the Subscribe button at the top right of this form to be notified when more information will become available. 1.if the startup check fails with Powershell error for Get-WmiObject, or any other error that results in the service name not being fetched. To resolve the Get-WmiObject error, to avoid this error (other causes may exist): The Get-WmiObject error may be due to a WMI configuration problem on the host. Please go to the MID Server, open the PowerShell console and issue the command below: Get-WmiObject "win32_service" -filter "Name='snc_mid_test_ha1'" If this still fails then you may need to re-register the base classes of WmiObject by running the command below: mofcomp %windir%\system32\wbem\cimwin32.mof" to re-register the base classes of WmiObject 2.If the 'case' of the Service Name not exactly matching between wrapper-override.conf and the running service/registry. This check should not be case sensitive, because the case does not matter, because Windows won't allow the creation of a duplicate with the same name but different case in the first place. To resolve this:- edit the agent\conf\wrapper-override.conf fileChange the case of the wrapper.name value to match the actual "current service named <this name>" name from the error messageSaveRestart MID ServerRelated Problem: PRB1435863