[midPoint] Intermittent error executing powershell script: The WS-Management service cannot process the request because the request contained invalid selectors for the resource.

Alcides Carlos de Moraes Neto alcides.neto at gmail.com
Thu Feb 14 18:44:59 CET 2019


We have raised every Windows parameter related to number of powershell
sessions, timeouts, maximum memory, etc.

After a week, the error returned. Testing the connection made it go away
again.

Stack trace:

2019-02-14T14:33:04.556 ERROR
[com.evolveum.midpoint.provisioning.ucf.impl.connid.ConnIdUtil]
(midPointScheduler_Worker-4) ConnId Exception
javax.xml.ws.soap.SOAPFaultException in
connector:949134f0-413d-46b2-ac63-f4bf28c7f9ba(ConnId
com.evolveum.polygon.connector.ldap.ad.AdLdapConnector v1.6):
ConnectorSpec(resource:3341f1ce-f96f-43fe-8bc9-7a9ec051b71b(ADSFPRD),
name=null, oid=949134f0-413d-46b2-ac63-f4bf28c7f9ba): The
WS-Management service cannot process the request because the request
contained invalid selectors for the resource.
javax.xml.ws.soap.SOAPFaultException: The WS-Management service cannot
process the request because the request contained invalid selectors
for the resource.
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:161)
	at com.sun.proxy.$Proxy257.command(Unknown Source)
	at io.cloudsoft.winrm4j.client.WinRmClient.command(WinRmClient.java:274)
	at com.evolveum.powerhell.PowerHellWinRmExecImpl.runCommand(PowerHellWinRmExecImpl.java:56)
	at com.evolveum.polygon.connector.ldap.ad.AdLdapConnector.runScriptOnResource(AdLdapConnector.java:630)
	at org.identityconnectors.framework.impl.api.local.operations.ScriptOnResourceImpl.runScriptOnResource(ScriptOnResourceImpl.java:66)
	at sun.reflect.GeneratedMethodAccessor1404.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.identityconnectors.framework.impl.api.local.operations.ConnectorAPIOperationRunnerProxy.invoke(ConnectorAPIOperationRunnerProxy.java:98)
	at com.sun.proxy.$Proxy227.runScriptOnResource(Unknown Source)
	at sun.reflect.GeneratedMethodAccessor1404.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.identityconnectors.framework.impl.api.local.operations.ThreadClassLoaderManagerProxy.invoke(ThreadClassLoaderManagerProxy.java:96)
	at com.sun.proxy.$Proxy227.runScriptOnResource(Unknown Source)
	at sun.reflect.GeneratedMethodAccessor1404.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.identityconnectors.framework.impl.api.DelegatingTimeoutProxy.invoke(DelegatingTimeoutProxy.java:99)
	at com.sun.proxy.$Proxy227.runScriptOnResource(Unknown Source)
	at sun.reflect.GeneratedMethodAccessor1404.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.identityconnectors.framework.impl.api.LoggingProxy.invoke(LoggingProxy.java:83)
	at com.sun.proxy.$Proxy227.runScriptOnResource(Unknown Source)
	at org.identityconnectors.framework.impl.api.AbstractConnectorFacade.runScriptOnResource(AbstractConnectorFacade.java:265)
	at com.evolveum.midpoint.provisioning.ucf.impl.connid.ConnectorInstanceConnIdImpl.executeScriptIcf(ConnectorInstanceConnIdImpl.java:2957)
	at com.evolveum.midpoint.provisioning.ucf.impl.connid.ConnectorInstanceConnIdImpl.checkAndExecuteAdditionalOperations(ConnectorInstanceConnIdImpl.java:2892)
	at com.evolveum.midpoint.provisioning.ucf.impl.connid.ConnectorInstanceConnIdImpl.modifyObject(ConnectorInstanceConnIdImpl.java:1878)
	at com.evolveum.midpoint.provisioning.impl.ResourceObjectConverter.executeModify(ResourceObjectConverter.java:782)
	at com.evolveum.midpoint.provisioning.impl.ResourceObjectConverter.modifyResourceObject(ResourceObjectConverter.java:584)
	at com.evolveum.midpoint.provisioning.impl.ShadowCache.modifyShadow(ShadowCache.java:906)
	at com.evolveum.midpoint.provisioning.impl.ProvisioningServiceImpl.modifyObject(ProvisioningServiceImpl.java:644)
	at sun.reflect.GeneratedMethodAccessor888.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
	at com.evolveum.midpoint.util.aspect.MidpointInterceptor.wrapSubsystem(MidpointInterceptor.java:137)
	at com.evolveum.midpoint.util.aspect.MidpointInterceptor.invoke(MidpointInterceptor.java:53)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
	at com.sun.proxy.$Proxy124.modifyObject(Unknown Source)
	at com.evolveum.midpoint.model.impl.lens.ChangeExecutor.modifyProvisioningObject(ChangeExecutor.java:1505)
	at com.evolveum.midpoint.model.impl.lens.ChangeExecutor.executeModification(ChangeExecutor.java:1379)
	at com.evolveum.midpoint.model.impl.lens.ChangeExecutor.executeDelta(ChangeExecutor.java:915)
	at com.evolveum.midpoint.model.impl.lens.ChangeExecutor.executeChanges(ChangeExecutor.java:318)
	at com.evolveum.midpoint.model.impl.lens.Clockwork.lambda$processSecondary$0(Clockwork.java:630)
	at com.evolveum.midpoint.model.impl.lens.ClockworkMedic.partialExecute(ClockworkMedic.java:170)
	at com.evolveum.midpoint.model.impl.lens.ClockworkMedic.partialExecute(ClockworkMedic.java:150)
	at com.evolveum.midpoint.model.impl.lens.Clockwork.processSecondary(Clockwork.java:628)
	at com.evolveum.midpoint.model.impl.lens.Clockwork.click(Clockwork.java:471)
	at com.evolveum.midpoint.model.impl.lens.Clockwork.run(Clockwork.java:196)
	at com.evolveum.midpoint.model.impl.controller.ModelController.executeChanges(ModelController.java:547)
	at com.evolveum.midpoint.model.impl.controller.ModelController.executeChanges(ModelController.java:338)
	at sun.reflect.GeneratedMethodAccessor1387.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
	at com.evolveum.midpoint.util.aspect.MidpointInterceptor.wrapSubsystem(MidpointInterceptor.java:137)
	at com.evolveum.midpoint.util.aspect.MidpointInterceptor.invoke(MidpointInterceptor.java:53)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
	at com.sun.proxy.$Proxy126.executeChanges(Unknown Source)
	at com.evolveum.midpoint.model.impl.scripting.helpers.OperationsHelper.applyDelta(OperationsHelper.java:79)
	at com.evolveum.midpoint.model.impl.scripting.actions.RecomputeExecutor.execute(RecomputeExecutor.java:82)
	at com.evolveum.midpoint.model.impl.scripting.ScriptingExpressionEvaluator.executeAction(ScriptingExpressionEvaluator.java:227)
	at com.evolveum.midpoint.model.impl.scripting.ScriptingExpressionEvaluator.evaluateExpression(ScriptingExpressionEvaluator.java:206)
	at com.evolveum.midpoint.model.impl.scripting.expressions.SearchEvaluator.lambda$evaluate$1(SearchEvaluator.java:141)
	at com.evolveum.midpoint.model.impl.controller.ModelController.lambda$searchObjectsIterative$1(ModelController.java:1111)
	at com.evolveum.midpoint.repo.cache.RepositoryCache$1.handle(RepositoryCache.java:357)
	at com.evolveum.midpoint.repo.sql.helpers.ObjectRetriever.searchObjectsIterativeAttempt(ObjectRetriever.java:769)
	at com.evolveum.midpoint.repo.sql.SqlRepositoryServiceImpl.searchObjectsIterativeBySingleTransaction(SqlRepositoryServiceImpl.java:873)
	at com.evolveum.midpoint.repo.sql.SqlRepositoryServiceImpl.searchObjectsIterative(SqlRepositoryServiceImpl.java:847)
	at sun.reflect.GeneratedMethodAccessor658.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
	at com.evolveum.midpoint.util.aspect.MidpointInterceptor.wrapSubsystem(MidpointInterceptor.java:137)
	at com.evolveum.midpoint.util.aspect.MidpointInterceptor.invoke(MidpointInterceptor.java:53)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
	at com.sun.proxy.$Proxy60.searchObjectsIterative(Unknown Source)
	at com.evolveum.midpoint.repo.cache.RepositoryCache.searchObjectsIterative(RepositoryCache.java:362)
	at sun.reflect.GeneratedMethodAccessor658.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
	at com.evolveum.midpoint.util.aspect.MidpointInterceptor.wrapSubsystem(MidpointInterceptor.java:137)
	at com.evolveum.midpoint.util.aspect.MidpointInterceptor.invoke(MidpointInterceptor.java:53)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
	at com.sun.proxy.$Proxy60.searchObjectsIterative(Unknown Source)
	at com.evolveum.midpoint.model.impl.controller.ModelController.searchObjectsIterative(ModelController.java:1121)
	at sun.reflect.GeneratedMethodAccessor2389.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
	at com.evolveum.midpoint.util.aspect.MidpointInterceptor.wrapSubsystem(MidpointInterceptor.java:137)
	at com.evolveum.midpoint.util.aspect.MidpointInterceptor.invoke(MidpointInterceptor.java:53)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
	at com.sun.proxy.$Proxy126.searchObjectsIterative(Unknown Source)
	at com.evolveum.midpoint.model.impl.scripting.expressions.SearchEvaluator.evaluate(SearchEvaluator.java:165)
	at com.evolveum.midpoint.model.impl.scripting.ScriptingExpressionEvaluator.evaluateExpression(ScriptingExpressionEvaluator.java:204)
	at com.evolveum.midpoint.model.impl.scripting.ScriptingExpressionEvaluator.evaluateExpression(ScriptingExpressionEvaluator.java:174)
	at com.evolveum.midpoint.model.impl.scripting.ScriptingExpressionEvaluator.evaluateExpression(ScriptingExpressionEvaluator.java:148)
	at com.evolveum.midpoint.model.impl.controller.ModelController.evaluateExpression(ModelController.java:2037)
	at sun.reflect.GeneratedMethodAccessor2388.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
	at com.evolveum.midpoint.util.aspect.MidpointInterceptor.wrapSubsystem(MidpointInterceptor.java:137)
	at com.evolveum.midpoint.util.aspect.MidpointInterceptor.invoke(MidpointInterceptor.java:53)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
	at com.sun.proxy.$Proxy126.evaluateExpression(Unknown Source)
	at com.evolveum.midpoint.model.impl.scripting.ScriptExecutionTaskHandler.run(ScriptExecutionTaskHandler.java:80)
	at com.evolveum.midpoint.task.quartzimpl.execution.JobExecutor.executePlainTaskHandler(JobExecutor.java:671)
	at com.evolveum.midpoint.task.quartzimpl.execution.JobExecutor.executeHandler(JobExecutor.java:660)
	at com.evolveum.midpoint.task.quartzimpl.execution.JobExecutor.executeRecurrentTask(JobExecutor.java:535)
	at com.evolveum.midpoint.task.quartzimpl.execution.JobExecutor.execute(JobExecutor.java:190)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:588)
Caused by: org.apache.cxf.binding.soap.SoapFault: The WS-Management
service cannot process the request because the request contained
invalid selectors for the resource.
	at org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor.unmarshalFault(Soap12FaultInInterceptor.java:155)
	at org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor.handleMessage(Soap12FaultInInterceptor.java:66)
	at org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor.handleMessage(Soap12FaultInInterceptor.java:52)
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
	at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:112)
	at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)
	at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
	at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:805)
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1684)
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1560)
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1361)
	at org.apache.cxf.transport.http.asyncclient.AsyncHTTPConduit$AsyncWrappedOutputStream.close(AsyncHTTPConduit.java:415)
	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
	at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:658)
	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
	at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:518)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:427)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:328)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:281)
	at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139)
	... 135 common frames omitted
2019-02-14T14:33:04.556 ERROR
[com.evolveum.midpoint.provisioning.ucf.impl.connid.ConnIdUtil]
(midPointScheduler_Worker-4) FALLBACK:
javax.xml.ws.soap.SOAPFaultException -> null


Em qui, 7 de fev de 2019 às 12:11, Alcides Carlos de Moraes Neto <
alcides.neto at gmail.com> escreveu:

> So, I was checking the AdLdapConnector source code (
> https://github.com/Evolveum/connector-ldap/blob/master/src/main/java/com/evolveum/polygon/connector/ldap/ad/AdLdapConnector.java
> )
>
> The method cleanupScriptingBeforeTest() cleans a powerhellMap, I think
> that's what resolves the issue.
>
> Shouldn't the connector detect the error and re-establish the connection?
> Or should that be a task for the powerhell lib?
>
> Em ter, 5 de fev de 2019 às 19:39, Alcides Carlos de Moraes Neto <
> alcides.neto at gmail.com> escreveu:
>
>> I figured that this has something to do with a  "Shellid" parameter that
>> winrm4j uses.
>> I believe the shellid that's being passed is for a dead/terminated shell
>> and that gives the error.
>> If I click on Test Connection on the resource page, the error stops.
>> Something inside the connector is being reset.
>> Does the AdLdap connector have a winrm connection pool  or something like
>> that? Shouldn 't it be refreshed from time to time?
>>
>>
>> Em ter, 5 de fev de 2019 às 16:57, Alcides Carlos de Moraes Neto <
>> alcides.neto at gmail.com> escreveu:
>>
>>> Hello list,
>>>
>>> We have midPoint 3.8 running, with AD resource working fine most of the
>>> time, with some Powershell scripts. Connector version is the one bundled
>>> with midpoint, 1.6
>>> The scripts execute fine most of the time, however sometimes they fail
>>> with the following message:
>>>
>>> org.apache.cxf.binding.soap.SoapFault(The WS-Management service cannot
>>> process the request because the request contained invalid selectors for the
>>> resource. ):
>>>
>>> There is nothing else in the stack, just that repeated over and over.
>>>
>>> Usually, if you recompute the user one or two more times, the script
>>> will eventually execute successfully. We do have a few users that fail
>>> everytime, though. We have been debugging them but we can't seem to find
>>> the point of failure
>>> Any suggestions on what this may be?
>>>
>>> Here are snips of our resource and scripts configuration (private info
>>> removed):
>>>
>>> <gen604:host>...
>>> <gen604:port>636</gen604:port>
>>> <gen604:connectionSecurity>ssl</gen604:connectionSecurity>
>>> <gen604:bindDn>...
>>> <gen604:bindPassword>...
>>> <gen604:baseContext>DC=....
>>> <gen604:referralStrategy>follow</gen604:referralStrategy>
>>> <gen604:pagingStrategy>spr</gen604:pagingStrategy>
>>> <gen604:operationalAttributes>....
>>> <gen604:winRmHost>...
>>>  <gen604:winRmUsername>...
>>> <gen604:winRmDomain>...
>>> <gen604:winRmPassword>...
>>> <gen604:winRmPort>5986</gen604:winRmPort>
>>> <gen604:winRmUseHttps>true</gen604:winRmUseHttps>
>>>
>>> <script>
>>>          <host>resource</host>
>>>          <language>cmd</language>
>>>          <argument>....</argument>
>>>          <code>powershell -file
>>> "c:\midpoint-scripts\enable-mailbox.ps1"</code>
>>> ...
>>> </scripts>
>>>
>>>
>>>
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20190214/5fc23180/attachment.htm>


More information about the midPoint mailing list