2016-04-19 6 views
3

System Center Orchestratorセットアップの前面にある小さなWebインターフェイスを作成しています。ランブックに当たってデータを取り戻すことになっています。この部分はほとんど重要ではありません。OData/SC OrchestratorでArgumentOutOfRangeException(オフセットが適用されたときのUTC時間は0から10,000の間でなければなりません)

コードは、サンプルコードを使用して戻っていくつかのデータを取得するためにランブックのジョブを開始しようとしている(と私の要件に下塗り)https://msdn.microsoft.com/en-us/library/hh921685.aspx

から私が変更されている行だけは、私自身のOrchestratorへの参照です、ランブックGUID、およびランブックパラメータを含む。

この行はタイトルに例外をスロー:エラーを示す。このスタックトレースを持つ

context.SaveChanges(); 

はよく私のコードを超えて物事のODataのレルムのどこかに発信されているようだ:

[ArgumentOutOfRangeException: The UTC time represented when the offset is applied must be between year 0 and 10,000. 
Parameter name: offset] 
    System.DateTimeOffset.ValidateDate(DateTime dateTime, TimeSpan offset) +14215620 
    System.DateTimeOffset..ctor(DateTime dateTime) +56 
    Microsoft.Data.OData.Atom.EpmSyndicationWriter.CreateDateTimeStringValue(Object propertyValue, ODataWriterBehavior writerBehavior) +144 
    Microsoft.Data.OData.Atom.EpmSyndicationWriter.WriteEntryEpm(EntryPropertiesValueCache epmValueCache, IEdmEntityTypeReference entityType) +652 
    Microsoft.Data.OData.Atom.EpmSyndicationWriter.WriteEntryEpm(EpmTargetTree epmTargetTree, EntryPropertiesValueCache epmValueCache, IEdmEntityTypeReference type, ODataAtomOutputContext atomOutputContext) +80 
    Microsoft.Data.OData.Atom.ODataAtomWriter.EndEntry(ODataEntry entry) +627 
    Microsoft.Data.OData.ODataWriterCore.<WriteEndImplementation>b__16() +168 
    Microsoft.Data.OData.ODataWriterCore.InterceptException(Action action) +121 
    Microsoft.Data.OData.ODataWriterCore.WriteEndImplementation() +69 
    Microsoft.Data.OData.ODataWriterCore.WriteEnd() +40 
    System.Data.Services.Client.ODataWriterWrapper.WriteEnd(ODataEntry entry, Object entity) +47 
    System.Data.Services.Client.Serializer.WriteEntry(EntityDescriptor entityDescriptor, IEnumerable`1 relatedLinks, ODataRequestMessageWrapper requestMessage) +485 
    System.Data.Services.Client.BaseSaveResult.CreateRequestData(EntityDescriptor entityDescriptor, ODataRequestMessageWrapper requestMessage) +117 
    System.Data.Services.Client.BaseSaveResult.CreateChangeData(Int32 index, ODataRequestMessageWrapper requestMessage) +136 
    System.Data.Services.Client.SaveResult.CreateNonBatchChangeData(Int32 index, ODataRequestMessageWrapper requestMessage) +224 
    System.Data.Services.Client.SaveResult.CreateNextChange() +174 
    System.Data.Services.Client.DataServiceContext.SaveChanges(SaveChangesOptions options) +178 
    System.Data.Services.Client.DataServiceContext.SaveChanges() +37 
    S3Tools.RunbookOperations.GetClusters(String site) in [redacted]\RunbookOps.cs:58 

The UTC time represented when the offset is applied must be between year 0 and 10,000. Parameter name: offsetUTC time represented when the offset is applied must be between year 0 and 10,000 errorを確認しましたが、そのエラー(特に後者)がhttps://support.microsoft.com/en-us/kb/2346777ですが、MSが提供する修正プログラムはWindows 10には適用されません(私のworkstatiまたはWindows 2012 R2(Webサーバー)のいずれかを選択します。

私は自分のタイムゾーン(UTC + 10)や、誰もが任意のアイデアを持っているか、この前に遭遇した場合見る前にテストするために、サーバのいずれかを変更するには消極的です。

が、私はこれらのジョブを生成する非常に能力があるのPowerShellスクリプトを持っている(彼らはサービス参照を使用することはできませんが、手動で要求を生成する必要があります)。だから、私はCLR以外の何かが間違っていると信じたくない。

ボトムラインの質問:誰かがこれを見つけて修正しましたか?任意の合理的に有効なDateTime値に、当然のことながら、

job.CreationTime = DateTime.Now; 
job.LastModifiedTime = DateTime.Now; 

または:問題を軽減するこれらの2行を追加

+0

今朝私はワークステーションのタイムゾーンを変更して、これが何か違いがあるかどうかを調べることにしました。それはしませんでした。私はUTCとUTC-12の両方を試しました。だから私はそれがこの結果だとは思わない。 – Kruft

+0

私はちょうど[この技術記事]を見ました(https://social.technet.microsoft.com/Forums/en-US/e248ecef-9561-4409-8a3f-8299bcc721a4/exception-using-code-sample-in- utc-1-timezone?forum = scoqik)が動作するかもしれません。それを渦巻きにする。 – Kruft

答えて

1

質問に記載されているサンプルコードを使用すると、空のJobオブジェクトがCreationTimeまたはLastModifiedTimeプロパティに値を設定しないため、結果としてその値が渡されるようです。計算に時間が使用されると、結果は0,238,703,952,,0> 10,000年のタイムスパンになります。

ソリューションは、このTechNetのフォーラムのスレッドにあった:https://social.technet.microsoft.com/Forums/en-US/e248ecef-9561-4409-8a3f-8299bcc721a4/exception-using-code-sample-in-utc-1-timezone?forum=scoqik

JoakimJohanssonによって答えを持ちます。