Notifications

22 views

Description

Mid Server DOWN due to false "expected service name" error, if the checking script has a PSReadLine/PSConsoleReadLine error.

The error starts with:
StartupSequencer SEVERE *** ERROR *** The current service named snc_mid_...
Oops, something went wrong. Please report this bug with the details below.
And results in the MID Server going down:
does not match the expected service name snc_mid_.... The current service is being stopped.

This check does correctly get both the service name and wrapper-override.conf name, but the Microsoft error message text is also included in the service name string, and included in the comparison, and shuts the MID Server down unnecessarily.

Unfortunately the known Microsoft bug in PSReadLine module doesn't throw any exception. It just adds the error message to the output.
https://github.com/PowerShell/PSReadLine/issues/1390
PSReadline 2.0.0 does not work on PS 5.1 Windows 2012R2 servers

Steps to Reproduce

  1. Install a MID Server on a windows server host that is subject to the PSReadLine bug. e.g. PowerShell 5.1 on Windows 2012R2 servers, and NET Framework 4.5.2 (the microsoft bug is due to .NET 4.6.1 being expected).
  2. Disable the pre-check (to avoid PRB1437409, which is also normal for on-premise customers).
  3. Upgrade the MID Server

On startup of the new MID Server, or first startup after upgrading of an existing MID Server, the following is seen in the agent log. Note: this is a false error because you can see the service name does exactly match:

StartupSequencer SEVERE *** ERROR *** The current service named snc_mid_iaasn00076692

Oops, something went wrong. Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
Last 0 Keys:

Exception:
System.IO.IOException: The handle is invalid.

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.Console.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded)
at System.Console.get_CursorLeft()
at Microsoft.PowerShell.PSConsoleReadLine.Initialize(Runspace runspace, EngineIntrinsics engineIntrinsics)
at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
-----------------------------------------------------------------------

does not match the expected service name snc_mid_iaasn00076692. The current service is being stopped.

Workaround

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.

Although this is not a problem with Servicenow code, checks may be added to avoid this breaking critical functions.

Workarounds to avoid the Microsoft bug are in:
KB0827229 MID Server Startup/Upgrade and Discovery/Orchestration Probes fail due to Microsoft Powershell PSReadLine bug - "Oops, something went wrong" "System.IO.IOException"


Related Problem: PRB1437392

Seen In

SR - IRM - Audit Management - New York 2019 Q3
SR - IRM - GRC Profiles - Madrid 2019 Q2
SR - IRM - Policy and Compliance - Madrid 2019 Q2
SR - IRM - Risk Management - New York 2019 Q3

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2020-10-15 01:59:45
Published:2020-10-15