3

We are getting below error when publishing content for the first time to web database after Sitecore upgrade. The publishing method is publish site -> republish /smart publish.

Job started: Publish to 'web'|#Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: The supplied DateTime represents an invalid time. For example, when the clock is adjusted forward, any time in the period that is skipped is invalid. Parameter name: dateTime at System.TimeZoneInfo.ConvertTime(DateTime dateTime, TimeZoneInfo sourceTimeZone, TimeZoneInfo destinationTimeZone, TimeZoneInfoOptions flags, CachedData cachedData) at Sitecore.DateUtil.ToUniversalTime(DateTime serverTime) at Sitecore.Data.Items.ItemPublishing.GetDate(ID fieldId, DateTime defaultValue) at Sitecore.Data.Items.ItemPublishing.get_ValidFrom() at Sitecore.Data.Items.ItemPublishing.InValidRange(DateTime date) at Sitecore.Data.Items.ItemPublishing.IsValid(DateTime date, Boolean requireApproved, Database targetDatabase) at Sitecore.Data.Items.ItemPublishing.GetValidVersion(DateTime date, Boolean requireApproved, Boolean allowEmpty, Database targetDatabase) at Sitecore.Data.Items.ItemPublishing.GetValidVersion(DateTime date, Boolean requireApproved, Database targetDatabase) at Sitecore.Publishing.Pipelines.PublishItem.DetermineAction.Process(PublishItemContext context) at (Object , Object[] ) at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) at Sitecore.Publishing.Pipelines.PublishItem.PublishItemPipeline.Run(PublishItemContext context) at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessPublishingCandidate(PublishingCandidate entry, PublishContext context, List1& referrers, List1& children) at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessPublishingCandidate(PublishingCandidate entry, PublishContext context) at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessEntries(IEnumerable1 entries, PublishContext context) at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessPublishingCandidate(PublishingCandidate entry, PublishContext context) at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessEntries(IEnumerable1 entries, PublishContext context) at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessPublishingCandidate(PublishingCandidate entry, PublishContext context) at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessEntries(IEnumerable1 entries, PublishContext context) at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessPublishingCandidate(PublishingCandidate entry, PublishContext context) at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessEntries(IEnumerable1 entries, PublishContext context) at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessPublishingCandidate(PublishingCandidate entry, PublishContext context) at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessEntries(IEnumerable1 entries, PublishContext context) at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessPublishingCandidate(PublishingCandidate entry, PublishContext context) at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessEntries(IEnumerable1 entries, PublishContext context) at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessPublishingCandidate(PublishingCandidate entry, PublishContext context) at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessEntries(IEnumerable1 entries, PublishContext context) at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessPublishingCandidate(PublishingCandidate entry, PublishContext context) at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessEntries(IEnumerable1 entries, PublishContext context) at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.Process(PublishContext context) at (Object , Object[] ) at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) at Sitecore.Publishing.Pipelines.Publish.PublishPipeline.Run(PublishContext context) at Sitecore.Publishing.Publisher.PublishWithResult() --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj) at Sitecore.Jobs.JobRunner.RunMethod(JobArgs args) at (Object , Object[] ) at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) at Sitecore.Jobs.Job.ThreadEntry(Object state)

Has anyone come across this error? Please advice.

8
  • Does the time of the server correct? Can you check if the item date statistics are in the future and also the server time if it is corresponding to the Sitecore instance Commented Jun 20, 2017 at 20:16
  • @HishaamNamooya - all sitecore components including database, solr service are on the same machine. Commented Jun 20, 2017 at 20:19
  • are they in Cloud ? i.e. would have been deployed into new timezone. Also need to understand when was your last successful publish datetime. GMT +/- ? Commented Jun 20, 2017 at 20:22
  • Can you check from the ShowConfig.aspx page if you have specified a timezone. The setting name is ServerTimeZone Commented Jun 20, 2017 at 20:24
  • 2
    Database backup was taken from UTC timed server and restored onto local machine with EST timezone. So, setting ServerTimeZone to "UTC" allowed the publishing to finish successfully. Commented Jun 27, 2017 at 14:38

1 Answer 1

0

I witnessed very similar behavior, not during publishing, but when setting item restrictions. Upon item save, the same exception was witnessed.

The issue in our case was that a content author attempted to stage an item within the timespan of daylight savings time. This happened in Spring when clocks are moved forward an hour.

The user staged a version to be unpublished at 2:00 AM on Sunday, March 8th, 2020. The server is in the EST time zone and the ServerTimeZone setting is blank.

The solution was to choose a time outside of the 2:00 AM to 3:00 AM range where daylight savings kicks in.

Conversely, in November when clocks are set backward an hour, the issue is likely a bit different- where content could become published at e.g. 1:30am, then unpublished when clocks are set back to 1:00am, then republished again at 1:30am. Though this is dependent on how autopublish settings are set up and start/end times for restrictions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.