Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Listresource.ps1 Swis function is not working in SAM 2019.4 #223

Open
josedhinagar opened this issue Apr 29, 2020 · 7 comments
Open

Listresource.ps1 Swis function is not working in SAM 2019.4 #223

josedhinagar opened this issue Apr 29, 2020 · 7 comments

Comments

@josedhinagar
Copy link

josedhinagar commented Apr 29, 2020

I have installed Orion.SDK and imported powerOrion,SwisPowerShell modules, But facing below issue, while executing.. "

.\ImportListResources.ps1 $swis 2 600
Creating schedule list resources job...
Waiting until job status will be 'ReadyForImport'...
Importing list resources...
Invoke-SwisVerb : Could not load file or assembly 'SolarWinds.Interfaces.Discovery.Strings, Version=3.5.0.638,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
At C:\SAM\New folder\OrionSDK-master\Samples\PowerShell\ImportListResources.ps1:72 char:17

  • ... ortResult = Invoke-SwisVerb $swis "orion.nodes" "ImportListResourcesR ...
  • CategoryInfo : InvalidOperation: (:) [Invoke-SwisVerb], FaultException`1
  • FullyQualifiedErrorId : SwisError,SwisPowerShell.InvokeSwisVerb
    Import of ListResources result for NodeId:2 finished with errors.
    At C:\SAM\New folder\OrionSDK-master\Samples\PowerShell\ImportListResources.ps1:76 char:5
  • throw ("Import of ListResources result for NodeId:" + $nodeId + " ...
  • CategoryInfo : OperationStopped: (Import of ListR...ed with errors.:String) [], RuntimeException
  • FullyQualifiedErrorId : Import of ListResources result for NodeId:2 finished with errors.
    Problem is exactly at below function;
    $importResult = Invoke-SwisVerb $swis "orion.nodes" "ImportListResourcesResult" @($jobId, $nodeId)

In SAM 2019.4.1 , Noticed that in Swis ,it is looking for version '3.5.0.638' ,while actually we have a updated version '3.5.0.652' in Orion application files
Application file: SolarWinds.Interfaces.Discovery.Strings.dll
Path :C:\Program Files (x86)\SolarWinds\Orion\Interfaces.Discovery
Current Version : 3.5.0.652

My environment have only SAM ,, Kindly requesting some help to overcome this

@tdanner
Copy link
Contributor

tdanner commented Apr 29, 2020

Do you have multiple polling engines? The exact build number of that file is not particularly important, but you may be hitting a problem where the polling engine running that operation is just missing that file.

@josedhinagar
Copy link
Author

We executed it from Standalone SAM instance,, No polling engine was installed

@danjagnow
Copy link
Contributor

Can you run the script and then retrieve the most recent entries from the SWIS log file on the Orion server? It should be at the following location in a default Orion installation:

C:\ProgramData\SolarWinds\InformationService\v3.0\Orion.InformationService.log

@danjagnow
Copy link
Contributor

@danjagnow
Copy link
Contributor

@josedhinagar
Copy link
Author

Hi @danjagnow

We checked it today, the error was different,:

PS C:\SAMAgent\OrionSDK-master\Samples\PowerShell> $swis = Connect-Swis -Hostname IP -UserName Admin -Password ****
swis.log.txt

.\ImportListResources.ps1 $swis 3 300
Creating schedule list resources job...
Waiting until job status will be 'ReadyForImport'...
Importing list resources...
Invoke-SwisVerb : One of the known types provided to the serializer via 'knownTypes' argument was invalid because it was null. All
known types specified must be non-null values.
At C:\SAMAgent\OrionSDK-master\Samples\PowerShell\ImportListResources.ps1:72 char:17

  • ... ortResult = Invoke-SwisVerb $swis "orion.nodes" "ImportListResourcesR ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [Invoke-SwisVerb], FaultException`1
    • FullyQualifiedErrorId : SwisError,SwisPowerShell.InvokeSwisVerb
      Import of ListResources result for NodeId:3 finished with errors.
      At C:\SAMAgent\OrionSDK-master\Samples\PowerShell\ImportListResources.ps1:76 char:5
  • throw ("Import of ListResources result for NodeId:" + $nodeId + " ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : OperationStopped: (Import of ListR...ed with errors.:String) [], RuntimeException
    • FullyQualifiedErrorId : Import of ListResources result for NodeId:3 finished with errors.

SWIS log information:

2020-05-04 07:06:41,346 [11] ERROR SolarWinds.Orion.Core.Models.Discovery.TypeResolverProxy - SwisPowerShell (null) Cannot load type SolarWinds.APM.BlackBox.IIS.Common.Models.Discovery.IISDiscoveredInstance,SolarWinds.APM.BlackBox.IIS.Common
2020-05-04 07:06:41,346 [11] ERROR SolarWinds.InformationService.Core.InformationService - SwisPowerShell (null) Exception for Operation: <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Header>
<a:Action s:mustUnderstand="1">http://schemas.solarwinds.com/2007/08/informationservice/InformationService/Invoke</a:Action>
<a:MessageID>urn:uuid:b99d773b-d41f-4e0a-8c0c-f2b57d7cad6a</a:MessageID>
<a:ReplyTo>
<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
</a:ReplyTo>

en-US


true
SwisPowerShell
PT30S

2
true
<a:To s:mustUnderstand="1">net.tcp://10.85.200.218:17777/SolarWinds/InformationService/v3/Orion/ssl</a:To>
<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<u:Timestamp u:Id="_0">
<u:Created>2020-05-04T14:06:41.683Z</u:Created>
<u:Expires>2020-05-04T14:11:41.683Z</u:Expires>
</u:Timestamp>
<c:SecurityContextToken u:Id="uuid-4a8d62e7-ca49-4a8c-8085-e0084c8d6722-352" xmlns:c="http://schemas.xmlsoap.org/ws/2005/02/sc">
<c:Identifier>urn:uuid:12040911-5bee-4909-9867-12dba9ec7ccc</c:Identifier>
</c:SecurityContextToken>













TWQK2WjcrCwVaK22ZdoFOn1ODuY=


zEXpJfciPjpjuKEgjrf8oH1HFuo=

<o:SecurityTokenReference>
<o:Reference URI="#uuid-4a8d62e7-ca49-4a8c-8085-e0084c8d6722-352">
</o:Reference>
</o:SecurityTokenReference>


</o:Security>
</s:Header>
<s:Body>

orion.nodes
ImportListResourcesResult

<b:XmlElement>
b8476e3e-44fb-425f-971f-2e853530096e
</b:XmlElement>
<b:XmlElement>
3
</b:XmlElement>


</s:Body>
</s:Envelope>
2020-05-04 07:06:41,346 [11] ERROR SolarWinds.InformationService.Core.InformationService - SwisPowerShell (null) Exception caught in method SolarWinds.InformationService.Core.InformationService.Invoke
System.ArgumentException: One of the known types provided to the serializer via 'knownTypes' argument was invalid because it was null. All known types specified must be non-null values.

Server stack trace:
at System.Runtime.Serialization.XmlObjectSerializerContext.GetDataContractsForKnownTypes(IList1 knownTypeList) at System.Runtime.Serialization.DataContractSerializer.get_KnownDataContracts() at System.Runtime.Serialization.XmlObjectSerializerContext.GetDataContractFromSerializerKnownTypes(XmlQualifiedName qname) at System.Runtime.Serialization.XmlObjectSerializerContext.ResolveDataContractFromKnownTypes(XmlQualifiedName typeName) at System.Runtime.Serialization.XmlObjectSerializerContext.ResolveDataContractFromKnownTypes(String typeName, String typeNs, DataContract memberTypeContract, Type declaredType) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract& dataContract) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 id, RuntimeTypeHandle declaredTypeHandle, String name, String ns) at ReadArrayOfanyTypeFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString , XmlDictionaryString , CollectionDataContract ) at System.Runtime.Serialization.CollectionDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract& dataContract) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, String name, String ns) at System.Runtime.Serialization.DataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName, DataContractResolver dataContractResolver) at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver) at SolarWinds.Orion.Common.SerializationHelper.FromXmlReader[T](XmlReader reader, Boolean verifyObjectName, IEnumerable1 knownTypes)
at SolarWinds.Orion.Core.Models.DiscoveredObjects.DiscoveredObjectTree.ReadXml(XmlReader reader)
at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadIXmlSerializable(XmlSerializableReader xmlSerializableReader, XmlReaderDelegator xmlReader, XmlDataContract xmlDataContract, Boolean isMemberType)
at System.Runtime.Serialization.XmlDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context)
at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, Int32 declaredTypeID, Type declaredType, String name, String ns)
at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, String name, String ns)
at ReadDiscoveredObjectTreeWcfWrapperFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] )
at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context)
at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, Int32 declaredTypeID, Type declaredType, String name, String ns)
at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, String name, String ns)
at System.Runtime.Serialization.NetDataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName)
at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver)
at System.Runtime.Serialization.NetDataContractSerializer.ReadObject(XmlDictionaryReader reader, Boolean verifyObjectName)
at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.PartInfo.ReadObject(XmlDictionaryReader reader, XmlObjectSerializer serializer)
at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part, Boolean isRequest)
at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeReply(Message message, Object[] parameters)
at System.ServiceModel.Dispatcher.ProxyOperationRuntime.AfterReply(ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
at SolarWinds.Data.Providers.Orion.Verbs.Nodes.<>c.b__10_0(Exception ex)
at SolarWinds.Orion.Core.Common.Proxy.BusinessLayer.CoreBusinessLayerApiProxyExceptionHandlerInterceptor.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at SolarWinds.Orion.Core.Common.Proxy.BusinessLayer.CoreBusinessLayerApiProxyMethodRedirectInterceptor.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Castle.Proxies.ICoreBusinessLayerProxy.GetOneTimeJobResult(Guid jobId)
at SolarWinds.Data.Providers.Orion.Verbs.Nodes.ImportListResourcesResult(String jobId, Int32 nodeId)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at SolarWinds.InformationService.Verb.VerbExecutor.ReflectionInvocation(Object hostInstance, Object[] parameters)
at SolarWinds.InformationService.Verb.VerbExecutorContext.Invoke()
at SolarWinds.InformationService.Core.InformationService.Invoke[T](String entity, String verb, Action1 setupParameters, Func2 extractReturnValue)

@hsehgal609
Copy link

was this ever resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants