Mid Server DOWN due to false "expected service name" error in 2 situations:
\r\nStartupSequencer SEVERE *** ERROR *** The current service named\r\n
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.
\r\nStartupSequencer 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 stopped
StartupSequencer Running command to determine Powershell version: "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" -noninteractive -nologo -noprofile -command "$v\r\n
StartupSequencer PowerShell version result: full_version:5.1.14409.1018, major_version:5
StartupSequencer 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.1018
StartupSequencer DEBUG: HTTPClient.registerOtherProtocols() starting on Thread Thread[StartupSequencer,5,main].
StartupSequencer The service name is detected as snc_mid_test_ha1
StartupSequencer 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.
\r\nStartupSequencer SEVERE *** ERROR *** The current service named\r\n
does not match the expected service name snc_mid_test_ha1. The current service is being stopped
Wrapper-Stopper Stopping MID server
MIDServer 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.:
\r\nStartupSequencer PowerShell version result: full_version:5.1.14393.3471, major_version:5\r\n
StartupSequencer 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.3471
StartupSequencer DEBUG: HTTPClient.registerOtherProtocols() starting on Thread Thread[StartupSequencer,5,main].
StartupSequencer The service name is detected as snc_mid_psnowmid02
StartupSequencer 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
\r\nStartupSequencer 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
Exactly how several customers have got into this situation is currently unclear.
\r\nFor the purposes of testing:
\r\nThe Agent log will show an error like this, before then going down:
\r\n06/30/20 14:32:43 (772) StartupSequencer SEVERE *** ERROR *** The current service named snc_mid_sjnkkst_IT_mid1
does not match the expected service name snc_mid_sjnkkst_it_mid1. The current service is being stopped
This 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.
\r\nTo resolve the Get-WmiObject error, to avoid this error (other causes may exist):
\r\nThe 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:
\r\nGet-WmiObject "win32_service" -filter "Name='snc_mid_test_ha1'"\r\n
If this still fails then you may need to re-register the base classes of WmiObject by running the command below:
\r\nmofcomp %windir%\\system32\\wbem\\cimwin32.mof" to re-register the base classes of WmiObject\r\n
To resolve this:-
\r\n