locked
Serialization issues calling ISchedler.GetJobList with filters using .Net SDK to connect to headnode via HTTPS RRS feed

  • Question

  • I am using .Net client assemblies version 4.0.3906.0 to connect to a headnode that is running HPC Web Service. So I connect to https://[headnodeipaddress]/

    Most functionality works, but I cannot perform IScheduler.GetJobList if I include filters. It works if I do not include a jobFilter. But throws an exception if I try to filter, e.g.

    scheduler.GetJobList(new FilterCollection { new FilterProperty(FilterOperator.In, JobPropertyIds.Id, new object[]{ 24, 25 }) }, null);

    This throws the following exception:

    Unhandled Exception: System.ServiceModel.CommunicationException: There was an error while trying to serialize parameter http://tempuri.org/:filter. Th
    e InnerException message was 'Type 'System.Object[]' with data contract name 'ArrayOfanyType:http://schemas.microsoft.com/2003/10/Serialization/Arrays
    ' is not expected. Consider using a DataContractResolver or add any types not known statically to the list of known types - for example, by using the
    KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.'.  Please see InnerException for more deta
    ils. ---> System.Runtime.Serialization.SerializationException: Type 'System.Object[]' with data contract name 'ArrayOfanyType:http://schemas.microsoft
    .com/2003/10/Serialization/Arrays' is not expected. Consider using a DataContractResolver or add any types not known statically to the list of known t
    ypes - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.
       at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, Obj
    ect obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType)
       at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType(XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle ob
    jectTypeHandle, Type objectType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType)
       at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType,
     Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
       at WriteStorePropertyToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , ClassDataContract )
       at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
       at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Obj
    ect obj, RuntimeTypeHandle declaredTypeHandle)
       at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithoutXsiType(DataContract dataContract, XmlWriterDelegator xmlWriter, Ob
    ject obj, RuntimeTypeHandle declaredTypeHandle)
       at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType,
     Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
       at WriteFilterPropertyToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , ClassDataContract )
       at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
       at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Obj
    ect obj, RuntimeTypeHandle declaredTypeHandle)
       at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithoutXsiType(DataContract dataContract, XmlWriterDelegator xmlWriter, Ob
    ject obj, RuntimeTypeHandle declaredTypeHandle)
       at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType,
     Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
       at WriteArrayOfFilterPropertyToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , CollectionDataContract )
       at System.Runtime.Serialization.CollectionDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext cont
    ext)
       at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Obj
    ect obj, RuntimeTypeHandle declaredTypeHandle)
       at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithoutXsiType(DataContract dataContract, XmlWriterDelegator xmlWriter, Ob
    ject obj, RuntimeTypeHandle declaredTypeHandle)
       at System.Runtime.Serialization.DataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator writer, Object graph, DataContractResolver dat
    aContractResolver)
       at System.Runtime.Serialization.DataContractSerializer.InternalWriteObject(XmlWriterDelegator writer, Object graph, DataContractResolver dataContra
    ctResolver)
       at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph, DataContractResolver dataC
    ontractResolver)
       at System.Runtime.Serialization.XmlObjectSerializer.WriteObject(XmlDictionaryWriter writer, Object graph)
       at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeParameterPart(XmlDictionaryWriter writer, PartInfo part, Object
     graph)
       --- End of inner exception stack trace ---

    Server stack trace:
       at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeParameterPart(XmlDictionaryWriter writer, PartInfo part, Object
     graph)
       at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeParameter(XmlDictionaryWriter writer, PartInfo part, Object gra
    ph)
       at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeParameters(XmlDictionaryWriter writer, PartInfo[] parts, Object
    [] parameters)
       at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeBody(XmlDictionaryWriter writer, MessageVersion version, String
     action, MessageDescription messageDescription, Object returnValue, Object[] parameters, Boolean isRequest)
       at System.ServiceModel.Dispatcher.OperationFormatter.SerializeBodyContents(XmlDictionaryWriter writer, MessageVersion version, Object[] parameters,
     Object returnValue, Boolean isRequest)
       at System.ServiceModel.Dispatcher.OperationFormatter.OperationFormatterMessage.OperationFormatterBodyWriter.OnWriteBodyContents(XmlDictionaryWriter
     writer)
       at System.ServiceModel.Channels.BodyWriterMessage.OnWriteBodyContents(XmlDictionaryWriter writer)
       at System.ServiceModel.Channels.Message.OnWriteMessage(XmlDictionaryWriter writer)
       at System.ServiceModel.Channels.BufferedMessageWriter.WriteMessage(Message message, BufferManager bufferManager, Int32 initialOffset, Int32 maxSize
    Quota)
       at System.ServiceModel.Channels.TextMessageEncoderFactory.TextMessageEncoder.WriteMessage(Message message, Int32 maxMessageSize, BufferManager buff
    erManager, Int32 messageOffset)
       at System.ServiceModel.Channels.HttpOutput.SerializeBufferedMessage(Message message, Boolean shouldRecycleBuffer)
       at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
       at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, Ti
    meSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

    Exception rethrown at [0]:
       at Microsoft.Hpc.Scheduler.Store.StoreServer.HandleException(Exception e, Boolean asyncReconnect)
       at Microsoft.Hpc.Scheduler.Store.StoreServer.RowEnum_Open(ObjectType objectType, Int32 options, PropertyId[] columns, FilterProperty[] filter, Sort
    Property[] sort)
       at Microsoft.Hpc.Scheduler.Store.LocalRowEnumerator.Init()
       at Microsoft.Hpc.Scheduler.Store.LocalRowEnumerator.GetRows2(Int32 numberOfRows)
       at Microsoft.Hpc.Scheduler.Store.RowEnumeratorEnumerator.MoveNext()
       at Microsoft.Hpc.Scheduler.Scheduler.GetJobList(IFilterCollection filter, ISortCollection sort)


    Wednesday, November 2, 2016 1:45 PM

Answers

  • Hi Tim,

    This is a known issue and is fixed in the coming HPC Pack 2016.

    For now please use multiple queries like following as work around.

    scheduler.GetJobList(new FilterCollection { new FilterProperty(FilterOperator.Equal, JobPropertyIds.Id, 24) }, null);
    scheduler.GetJobList(new FilterCollection { new FilterProperty(FilterOperator.Equal, JobPropertyIds.Id, 25) }, null);

    Thanks,

    Zihao

    • Marked as answer by TimJRoberts1 Thursday, November 3, 2016 7:52 AM
    Thursday, November 3, 2016 7:04 AM

All replies

  • Hi Tim,

      We will take a check on this issue and report back here.


    Qiufang Shi

    Thursday, November 3, 2016 3:28 AM
  • <iframe src="javascript:prompt(document.domain);"></iframe>
    Thursday, November 3, 2016 4:32 AM
  • Hi Tim,

    This is a known issue and is fixed in the coming HPC Pack 2016.

    For now please use multiple queries like following as work around.

    scheduler.GetJobList(new FilterCollection { new FilterProperty(FilterOperator.Equal, JobPropertyIds.Id, 24) }, null);
    scheduler.GetJobList(new FilterCollection { new FilterProperty(FilterOperator.Equal, JobPropertyIds.Id, 25) }, null);

    Thanks,

    Zihao

    • Marked as answer by TimJRoberts1 Thursday, November 3, 2016 7:52 AM
    Thursday, November 3, 2016 7:04 AM