I am trying to assign a Timespan to a Timespan Dom Field, but an exception is thrown when the value is high (but lower then the supposed max value).
I created the following test script:
When running this script results in the following exception:
Script 'Test Script' failed:
The following was returned from the script:
The script failed to execute.
EXIT: "Run|Something went wrong: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Duration was not a valid normalized duration
at Google.Protobuf.WellKnownTypes.Duration.ToTimeSpan()
at Skyline.DataMiner.Net.Apps.DataMinerObjectModel.Protobuf.SectionsProtobufMapper.FromProtoType(SingleValueWrapper singleValueWrapper)
at Skyline.DataMiner.Net.Apps.DataMinerObjectModel.Protobuf.SectionsProtobufMapper.FromProtoType(FieldValue fieldValue)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
at Skyline.DataMiner.Net.Apps.DataMinerObjectModel.Protobuf.ProtobufMapperHelper.RepeatedFieldToList[TProto,T](RepeatedField`1 repeatField, Func`2 conversionFunc)
at Skyline.DataMiner.Net.Apps.DataMinerObjectModel.Protobuf.SectionsProtobufMapper.FromProtoType(Section section)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
at Skyline.DataMiner.Net.Apps.DataMinerObjectModel.Protobuf.ProtobufMapperHelper.RepeatedFieldToList[TProto,T](RepeatedField`1 repeatField, Func`2 conversionFunc)
at Skyline.DataMiner.Net.Apps.DataMinerObjectModel.Protobuf.DomInstanceProtobufMapper.FromProtoType(DomInstance domInstance)
at Skyline.DataMiner.Net.Apps.DataMinerObjectModel.DomInstance..ctor(SerializationInfo info, StreamingContext context)
--- End of inner exception stack trace ---
Server stack trace:
at System.RuntimeMethodHandle.SerializationInvoke(IRuntimeMethodInfo method, Object target, SerializationInfo info, StreamingContext& context)
at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryRequestMessage(String objectUri, Stream inputStream, Boolean bStrictBinding, TypeFilterLevel securityLevel)
at System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Skyline.DataMiner.Net.ISLNet.HandleMessages(ConnectionToken token, DMSMessage[] inputMessages)
at Skyline.DataMiner.Net.LegacyRemotingConnection.TransportSpecificHandleMessage(ConnectionToken tok, DMSMessage[] msgs, Int32 timeout)
at Skyline.DataMiner.Net.Connection.InternalHandlePackedMessages(ConnectionToken tok, DMSMessage[] msgs, Int32 timeout)
at Skyline.DataMiner.Net.Connection.InternalHandleUnpackedMessages(DMSMessage[] msgs, Int32 timeout)
at Skyline.DataMiner.Net.Connection.HandleMessages(DMSMessage[] msgs, Int32 timeout)
at Skyline.DataMiner.Net.PersistentConnectionContainer.SendMessages(DMSMessage[] messages)
at Skyline.DataMiner.Automation.Engine.SendSLNetMessages(DMSMessage[] messages)
at Skyline.DataMiner.Net.ManagerStore.CrudHelperComponent`1.<>c__DisplayClass48_0.<WrapWithExtraInfoInjection>b__0(DMSMessage[] messages)
at Skyline.DataMiner.Net.ManagerStore.CrudHelperComponent`1.RetrieveResponse(DMSMessage request)
at Skyline.DataMiner.Net.ManagerStore.CrudHelperComponent`1.RetrieveResponse[TResp](DMSMessage request)
at Skyline.DataMiner.Net.ManagerStore.CrudHelperComponent`1.RetrieveCrudResponse(DMSMessage request)
at Skyline.DataMiner.Net.ManagerStore.BulkCrudHelperComponent`2.PerformCreateOrUpdate(List`1 objects, IAdditionalOperationMeta operationMeta)
at Skyline.DataMiner.Net.ManagerStore.BulkCrudHelperComponent`2.CreateOrUpdate(List`1 objects)
at Skyline.DataMiner.Net.Apps.DataMinerObjectModel.DomInstanceCrudHelperComponent.CreateOrUpdate(List`1 objects)
at Skyline.DataMiner.Utils.InventoryManager.Common.DOM.Applications.Helper.Helper.Save(DomHelper domHelper, List`1 instances)
at Test_Script_1.Script.RunSafe(IEngine engine)
at Test_Script_1.Script.Run(IEngine engine)"
Hi Tomás,
Based on the Google.Protobuf documentation, the maximum value for the Duration
class is approximately 10,000 years. Therefore, it is safe to assume that this is the maximum value you can insert into the DOM.
For more details, you can refer to the Google.Protobuf.WellKnownTypes.Duration Class Reference