MIDUserConnectivity - User midserver with mid_server role not associated with a MID Server.

ceiverso
Tera Contributor

Greetings,

 

I am working in a test environment (PDI) with the ServiceNow and I am getting the following issue here:

 

ceiverso_0-1668707583018.png

 

My "wrapper" log is shown here:

 

2022/11/17 10:25:57 | --> Wrapper Started as Service
2022/11/17 10:25:58 | Java Service Wrapper Standard Edition 64-bit 3.5.40
2022/11/17 10:25:58 | Copyright (C) 1999-2019 Tanuki Software, Ltd. All Rights Reserved.
2022/11/17 10:25:58 | http://wrapper.tanukisoftware.com
2022/11/17 10:25:58 | Licensed to ServiceNow, Inc. for MID
2022/11/17 10:25:58 |
2022/11/17 10:26:01 | Launching a JVM...
2022/11/17 10:26:16 | WrapperManager: Initializing...
2022/11/17 10:26:27 | Logger for 'glide' has not been configured by the container, configuring now:
2022/11/17 10:26:27 | Configuring log handler: java.util.logging.FileHandler
2022/11/17 10:26:27 | Setting useParentHandlers=false for Logger 'glide'
2022/11/17 10:26:27 | Overriding formatter to: com.glide.util.DefaultLogFormatter (for handler: java.util.logging.FileHandler)
2022/11/17 10:26:28 | FIPS Enforced Mode: false
2022/11/17 10:26:28 | JVM property java.security.egd: file:/dev/urandom
2022/11/17 10:26:45 | WARNING: An illegal reflective access operation has occurred
2022/11/17 10:26:45 | WARNING: Illegal reflective access by org.apache.ignite.internal.util.GridUnsafe$2 (file:/C:/ServiceNow/MidServer/ServiceNow%20MID%20Server%20ENSnowMidServ/agent/lib/ignite-core.jar) to field java.nio.Buffer.address
2022/11/17 10:26:45 | WARNING: Please consider reporting this to the maintainers of org.apache.ignite.internal.util.GridUnsafe$2
2022/11/17 10:26:45 | WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
2022/11/17 10:26:45 | WARNING: All illegal access operations will be denied in a future release

 

My "agent" log is shown here: 

 

 

11/17/22 10:26:27 (693) main Logger config: root=INFO
11/17/22 10:26:29 (537) WrapperStartStopAppMain Using configuration: C:\ServiceNow\MidServer\ServiceNow MID Server ENSnowMidServ\agent\config.xml
11/17/22 10:26:32 (108) WrapperStartStopAppMain Logger config: root=INFO
11/17/22 10:26:32 (134) WrapperStartStopAppMain Refreshing LoggerFactory cache
11/17/22 10:26:32 (842) WrapperStartStopAppMain Running in Commercial (non-FIPS Enforced) mode
11/17/22 10:26:36 (104) WrapperStartStopAppMain Running MID server with the following security providers:
11/17/22 10:26:36 (105) WrapperStartStopAppMain SUN
11/17/22 10:26:36 (106) WrapperStartStopAppMain SunRsaSign
11/17/22 10:26:36 (106) WrapperStartStopAppMain SunEC
11/17/22 10:26:36 (107) WrapperStartStopAppMain SunJSSE
11/17/22 10:26:36 (107) WrapperStartStopAppMain SunJCE
11/17/22 10:26:36 (108) WrapperStartStopAppMain SunJGSS
11/17/22 10:26:36 (108) WrapperStartStopAppMain SunSASL
11/17/22 10:26:36 (108) WrapperStartStopAppMain XMLDSig
11/17/22 10:26:36 (109) WrapperStartStopAppMain SunPCSC
11/17/22 10:26:36 (109) WrapperStartStopAppMain JdkLDAP
11/17/22 10:26:36 (109) WrapperStartStopAppMain JdkSASL
11/17/22 10:26:36 (109) WrapperStartStopAppMain SunMSCAPI
11/17/22 10:26:36 (110) WrapperStartStopAppMain SunPKCS11
11/17/22 10:26:36 (110) WrapperStartStopAppMain BCFIPS
11/17/22 10:26:36 (110) WrapperStartStopAppMain BCJSSE
11/17/22 10:26:36 (191) WrapperStartStopAppMain Loaded credentials provider: com.service_now.mid.keypairs.provider.standard.StandardKeyPairsProvider
11/17/22 10:26:40 (854) WrapperStartStopAppMain Setting basic authentication with user midserver
11/17/22 10:26:40 (862) WrapperStartStopAppMain Keystore file security\agent_keystore not found. Creating new keystore file.
11/17/22 10:26:42 (462) WrapperStartStopAppMain Welcome to the ServiceNow MID Server
11/17/22 10:26:43 (122) WrapperStartStopAppMain ExtensionContainer ThreadPool started with corePoolSize: 25, maximumPoolSize: 25, maximumQueueSize: 500
11/17/22 10:26:44 (884) MIDServer MIDCredentialsConfigProvider initialized with com.service_now.mid.creds.provider.standard.StandardCredentialsProvider
11/17/22 10:26:47 (371) MIDServer Attempting to load boot config file at location: C:\ServiceNow\MidServer\ServiceNow MID Server ENSnowMidServ\agent\boot-config.yaml
11/17/22 10:26:47 (372) MIDServer Boot configuration file not found at default location: C:\ServiceNow\MidServer\ServiceNow MID Server ENSnowMidServ\agent\boot-config.yaml, providing empty configuration
11/17/22 10:26:47 (375) MIDServer Initializing MID Server
11/17/22 10:26:47 (375) MIDServer Running under Java version: 11.0.12-sncmid1, java PID: 7372, args: start
11/17/22 10:26:48 (954) MIDServer JVM default socket factory: class com.service_now.mid.security.policy.PolicyBasedSSLSocketFactory
11/17/22 10:26:52 (856) MIDServer OCSPCheck adding BouncyCastle provider at -1
11/17/22 10:26:52 (857) MIDServer OCSPCheckedCertificateCache build with max capacity 32
11/17/22 10:26:52 (857) MIDServer OCSPRevokedCertificateCache build with max capacity 16
11/17/22 10:26:52 (857) MIDServer OCSPTimeoutErrorCache build with max capacity 16
11/17/22 10:26:52 (973) MIDServer WARNING *** WARNING *** Method failed: (https://dev127397.service-now.com/file_discovery_agent_sync.do?SOAP&displayvalue=all&redirectSupport... 401 Unauthorized with code: 401
11/17/22 10:26:52 (976) MIDServer SEVERE *** ERROR *** getRecords failed (Method failed: (https://dev127397.service-now.com/file_discovery_agent_sync.do?SOAP&displayvalue=all&redirectSupport... 401 Unauthorized with code: 401)
11/17/22 10:26:53 (083) MIDServer MID Server starting
11/17/22 10:26:53 (090) MIDServer Agent home path: C:\ServiceNow\MidServer\ServiceNow MID Server ENSnowMidServ\agent
11/17/22 10:26:53 (183) StartupSequencer PowerShell path not configured, resolving...
11/17/22 10:26:53 (183) StartupSequencer searching for PowerShell executable "powershell.exe"...
11/17/22 10:26:53 (276) MIDServer MID Server started
11/17/22 10:26:53 (816) StartupSequencer found PowerShell executable at "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
11/17/22 10:26:53 (816) StartupSequencer Running command to determine Powershell version: "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -noninteractive -nologo -noprofile -command "$ver = if (Test-Path Variable:\PSVersionTable) { $PSVersionTable.PSVersion } else { (get-host).Version }; 'full_version:' + $ver.ToString() + ', major_version:' + $ver.Major"
11/17/22 10:26:57 (899) StartupSequencer PowerShell version result: full_version:5.1.17763.2931, major_version:5
11/17/22 10:26:57 (900) StartupSequencer verify Powershell major version 5 against compatible version requirement (v3 - v5)
11/17/22 10:26:57 (900) StartupSequencer PowerShell path is set to "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe", version 5.1.17763.2931
11/17/22 10:26:58 (540) 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><source xsi:type="xsd:string">PowerShellInitialization</source><message xsi:type="xsd:string"></message><operation xsi:type="xsd:string">resolve</operation><midSysId xsi:type="xsd:string"></midSysId></m:execute></SOAP-ENV:Body></SOAP-ENV:Envelope>
11/17/22 10:26:58 (540) StartupSequencer SEVERE *** ERROR *** SOAP Response: Status code=401, Response body=<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>User Not Authenticated</faultcode><faultstring>User Not Authenticated</faultstring><detail>Error completing SOAP request</detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
11/17/22 10:27:05 (447) StartupSequencer The service name is detected as snc_mid_ENSnowMidServ
11/17/22 10:27:17 (535) StartupSequencer Result of PowerShell script to enforce stricter Windows file permissions:
4
5


11/17/22 10:27:17 (937) 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><source xsi:type="xsd:string">MIDFilePermEnforcer</source><message xsi:type="xsd:string"></message><operation xsi:type="xsd:string">resolve</operation><midSysId xsi:type="xsd:string"></midSysId></m:execute></SOAP-ENV:Body></SOAP-ENV:Envelope>
11/17/22 10:27:17 (938) StartupSequencer SEVERE *** ERROR *** SOAP Response: Status code=401, Response body=<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>User Not Authenticated</faultcode><faultstring>User Not Authenticated</faultstring><detail>Error completing SOAP request</detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
11/17/22 10:27:18 (866) StartupSequencer Successfully connected to instance:
11/17/22 10:27:18 (866) StartupSequencer Install name: access restricted
11/17/22 10:27:18 (866) StartupSequencer Instance name: access restricted
11/17/22 10:27:18 (867) StartupSequencer Node: access restricted
11/17/22 10:27:18 (867) StartupSequencer Build date: access restricted
11/17/22 10:27:18 (867) StartupSequencer Build tag: access restricted
11/17/22 10:27:18 (867) StartupSequencer Instance ID: access restricted
11/17/22 10:27:18 (867) StartupSequencer System ID: access restricted
11/17/22 10:27:18 (867) StartupSequencer Instance IP: access restricted
11/17/22 10:27:18 (867) StartupSequencer MID buildstamp: access restricted
11/17/22 10:27:19 (537) 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><roles xsi:type="xsd:string">mid_server,soap,soap_script,soap_query,soap_create,soap_delete,soap_ecc,soap_script,soap_update</roles></m:execute></SOAP-ENV:Body></SOAP-ENV:Envelope>
11/17/22 10:27:19 (538) StartupSequencer SEVERE *** ERROR *** SOAP Response: Status code=401, Response body=<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>User Not Authenticated</faultcode><faultstring>User Not Authenticated</faultstring><detail>Error completing SOAP request</detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
11/17/22 10:27:19 (540) StartupSequencer WARNING *** WARNING *** Could not authenticate user 'midserver' on the ServiceNow instance
11/17/22 10:27:19 (543) StartupSequencer SEVERE *** ERROR *** test failure
java.lang.IllegalStateException: User cannot be authenticated or is missing the proper roles. If you have deleted or changed the MID server keystore, and config.xml mid.instance.password value is encrypted, you may need to change this value to plain text (during MID startup, password is re-encrypted using current keystore and written back to mid.instance.password).
at com.service_now.mid.services.StartupSequencer.runTests(StartupSequencer.java:664)
at com.service_now.mid.services.StartupSequencer.startupSequencerRunnable(StartupSequencer.java:713)
at java.base/java.lang.Thread.run(Thread.java:829)

 

What I am trying to do is get a ServiceNow MID Server successfully configured so I test executing powershell scripts on a customer/client workstation.

1 ACCEPTED SOLUTION

Anshu_Anand_
Kilo Sage
Kilo Sage

Have you given mid_server role to the midserver user in servicenow.

Also please check if the mid server requirements are met

 

https://docs.servicenow.com/en-US/bundle/tokyo-servicenow-platform/page/product/mid-server/reference...

Regards,
Anshu

View solution in original post

7 REPLIES 7

ceiverso
Tera Contributor

I'm continuing to troubleshoot, however, I've been testing these lines below in the config.xml file below with no success:

 

secure_encrypt_midserver.png

I still get this same result in the log files (below), pay particular attention to the HIGHLIGHTED RED TEXT. Any help would be greatly appreciated?

 

11/18/22 08:56:13 (208) 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><source xsi:type="xsd:string">MIDFilePermEnforcer</source><message xsi:type="xsd:string"></message><operation xsi:type="xsd:string">resolve</operation><midSysId xsi:type="xsd:string"></midSysId></m:execute></SOAP-ENV:Body></SOAP-ENV:Envelope>
11/18/22 08:56:13 (210) StartupSequencer SEVERE *** ERROR *** SOAP Response: Status code=401, Response body=<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>User Not Authenticated</faultcode><faultstring>User Not Authenticated</faultstring><detail>Error completing SOAP request</detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
11/18/22 08:56:13 (607) StartupSequencer Successfully connected to instance:
11/18/22 08:56:13 (607) StartupSequencer Install name: access restricted
11/18/22 08:56:13 (607) StartupSequencer Instance name: access restricted
11/18/22 08:56:13 (607) StartupSequencer Node: access restricted
11/18/22 08:56:13 (608) StartupSequencer Build date: access restricted
11/18/22 08:56:13 (608) StartupSequencer Build tag: access restricted
11/18/22 08:56:13 (608) StartupSequencer Instance ID: access restricted
11/18/22 08:56:13 (608) StartupSequencer System ID: access restricted
11/18/22 08:56:13 (608) StartupSequencer Instance IP: access restricted
11/18/22 08:56:13 (608) StartupSequencer MID buildstamp: access restricted
11/18/22 08:56:14 (212) 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><roles xsi:type="xsd:string">mid_server,soap,soap_script,soap_query,soap_create,soap_delete,soap_ecc,soap_script,soap_update</roles></m:execute></SOAP-ENV:Body></SOAP-ENV:Envelope>
11/18/22 08:56:14 (213) StartupSequencer SEVERE *** ERROR *** SOAP Response: Status code=401, Response body=<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>User Not Authenticated</faultcode><faultstring>User Not Authenticated</faultstring><detail>Error completing SOAP request</detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
11/18/22 08:56:14 (215) StartupSequencer WARNING *** WARNING *** Could not authenticate user 'midserver' on the ServiceNow instance
11/18/22 08:56:14 (218) StartupSequencer SEVERE *** ERROR *** test failure
java.lang.IllegalStateException: User cannot be authenticated or is missing the proper roles. If you have deleted or changed the MID server keystore, and config.xml mid.instance.password value is encrypted, you may need to change this value to plain text (during MID startup, password is re-encrypted using current keystore and written back to mid.instance.password).
at com.service_now.mid.services.StartupSequencer.runTests(StartupSequencer.java:664)
at com.service_now.mid.services.StartupSequencer.startupSequencerRunnable(StartupSequencer.java:713)
at java.base/java.lang.Thread.run(Thread.java:829)

 

 

Anshu_Anand_
Kilo Sage
Kilo Sage

Have you given mid_server role to the midserver user in servicenow.

Also please check if the mid server requirements are met

 

https://docs.servicenow.com/en-US/bundle/tokyo-servicenow-platform/page/product/mid-server/reference...

Regards,
Anshu

Greetings Anshu_Anand_

 

That is correct, I have (screenshot below):

 

ceiverso_0-1668787876386.png

 

Also, when I try to set the midserver password, I can't manually set it. I always have to "generate" the password and use that?

 

ceiverso_1-1668788156818.png