MID Server start.bat will create a Windows Service with default name "snc_mid", without checking that the installer has been run and the config.xml/wrapper-override.conf files have sensible values, leading to duplicate services for the same install folder. The installer does then start the 2nd service, in addition to the first, and both will be running at the same time.
We need to prevent creating a new service for name "snc_mid", as that is a sign that the correct procedure of running the installer has not been followed.
Steps to Reproduce
1/ Download and extract a MID Server ZIP file for Windows
2/ Extract it to a new folder
3/ As an adminitrator, from the command line, run start.bat (this is a common mistake of customers)
At this point a Windows service with name "ServiceNow MID Server" and service name "snc_mid" is created, and started.
wrapperm | ServiceNow MID Server service installed.
wrapperm | Starting the ServiceNow MID Server service...
wrapperm | ServiceNow MID Server service started.
This will clearly fail to start up properly, but will remain running, with errors like:
01/09/20 11:07:58 (021) MIDServer Setting basic authentication with user YOUR_INSTANCE_USER_NAME_HERE
01/09/20 11:07:58 (199) MIDServer MIDCredentialsConfigProvider initialized with com.service_now.mid.creds.provider.standard.StandardCredentialsProvider
01/09/20 11:07:58 (432) MIDServer WARNING *** WARNING *** java.lang.IllegalArgumentException: Contains non-LDH ASCII characters
01/09/20 11:07:58 (432) MIDServer SEVERE *** ERROR *** getRecords failed (java.lang.IllegalArgumentException: Contains non-LDH ASCII characters)
01/09/20 11:07:58 (536) MIDServer MID Server starting
01/09/20 11:07:58 (563) MIDServer Agent home path: C:\MID_SERVER\agent
01/09/20 11:07:58 (652) StartupSequencer WARNING *** WARNING *** java.lang.IllegalArgumentException: Contains non-LDH ASCII characters
01/09/20 11:07:58 (652) StartupSequencer SEVERE *** ERROR *** SOAP Request: <SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://www.service-now.com/GetMIDInfo" xmlns:m="http://www.service-now.com" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><m:execute></m:execute></SOAP-ENV:Body></SOAP-ENV:Envelope>
01/09/20 11:07:58 (652) StartupSequencer SEVERE *** ERROR *** SOAP Response: Status code=0, Response body=null
01/09/20 11:07:58 (652) StartupSequencer SEVERE *** ERROR *** Problem invoking InstanceInfo on https://YOUR_INSTANCE.service-now.com/: Please check that the InstanceInfo page exists in the sys_public table and active="true".
01/09/20 11:07:58 (653) StartupSequencer SEVERE *** ERROR *** java.lang.IllegalArgumentException: Contains non-LDH ASCII characters
4/ Now run Installer.bat, and follow the usual procedure, finishing with clicking to start the MID Server
The installer will say "Started"
The config.xml and wrapper-overide.conf files will now be filled in
The new properly configured MID Server service will now be created and started.
In Madrid and earlier, you will now have 2 windows service running, both for the same MID Server folder. Both services will be set as Automatic, so both will run again on server restart.
In New York (post PRB1330396), the 2nd service will not start. The wrapper log will show this error:
2020/01/09 11:31:41 | Abort starting the service snc_mid_MID2 since there is another service for this MID Server.
2020/01/09 11:31:41 | List of existing Services for this MID Server: snc_mid
2020/01/09 11:31:41 | To fix you can
2020/01/09 11:31:41 | - Manually delete the existing services using Windows server manager and restart the MID Server.
2020/01/09 11:31:41 | OR
2020/01/09 11:31:41 | - If there is more than one MID Server service, decide which one you want to keep and delete others, using Windows server manager. Open the wrapper-override.conf file and change wrapper.name and wrapper.displayname to the service name that you want to keep. Restart the MID Server.
2020/01/09 11:32:55 | ServiceNow MID Server_MID 2 service installed.
As the log files are in effect shared between the 2 processes, they can become quite confusing.
This problem is a duplicate of PRB1352566: In the case of duplicate services pointing to the same path, we don't remove the un-wanted service, which includes a solution to this particular issue as part of a wider fix in Orlando.
To repair you MID Server installation after experiencing this problem, please refer to KB0743043.
Related Problem: PRB1380840