London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
Sounds like you may have a corrupt entry in your tblScheduledItems table. That error message might occur if the next execution date field in the database entry has passed. Run this query to find the rows:
select * from tblScheduledItem where pkID ='8de3f2b0-6e12-4716-a6f9-736f7e2f8944'
Blog posts for tips on debugging and logging from the scheduler:
http://www.epinova.no/blog/Tore-Gjerdrum/dates/2010/11/enable-debugging-in-episerver-scheduler/
http://world.episerver.com/Blogs/Tobias-Nilsson/Dates/2010/12/Troubleshooting-the-Scheduler/
Thanks Arild, the second link was helpful for me: after deleting the rows from the scheduler tables, the scheduler runs good again.
Hi,
I have a weird problem with a scheduled job: when triggered by the scheduler, the scheduled job results in status FAILED, message "Object reference not set to an instance of an object". Also, no message is logged in the log file.
When the scheduled job is started manually, the scheduled job results in status OK; and it does write to the log file.
I don't think the cause of the error is in the scheduled job code (I placed a breakpoint in the code, this only gets triggered when I start the scheduled job manually), but here is my code anyway:
using EPiServer.Security; using log4net; using System.Reflection; namespace Planet3.EpiServer.Templates.Admin.Test { [EPiServer.PlugIn.ScheduledPlugIn( DisplayName = "Test Scheduled Job", Description = "Scheduled Job for Testing purposes", SortIndex = 1)] public static class TestScheduledPlugIn { private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public static string Execute() { var resultMessage = string.Empty; Log.InfoFormat("Scheduled job Test is started."); if (PrincipalInfo.CurrentPrincipal.Identity.Name == string.Empty) { Log.InfoFormat("Anonymous Principal, so scheduled job is triggered by the scheduler"); resultMessage += "Anonymous; "; } else { Log.InfoFormat("User Account = [{0}], so scheduled job is triggered manually", PrincipalInfo.CurrentPrincipal.Identity.Name); resultMessage += string.Format("Account=[{0}]; ", PrincipalInfo.CurrentPrincipal.Identity.Name); } if (System.Web.HttpContext.Current == null) { Log.InfoFormat("HttpContext.Current == null, so scheduled job is triggered by the scheduler"); resultMessage += "HttpContext.Current == null; "; } else { Log.InfoFormat("HttpContext.Current exists, so scheduled job is triggered manually"); resultMessage += "HttpContext.Current exists; "; } resultMessage += "The End."; return resultMessage; } } }
BTW, the log file also contain the following logging: "DataAbstraction.ScheduledJob - 3.1.3 Scheduled job has already been executed 8de3f2b0-6e12-4716-a6f9-736f7e2f8944. "
Hope you can help!
Best, Leonard