Core Messaging Scheduler creating errors after upgrade

Overview

After upgrading DNN Evoq, you may experience error messages related to your CoreMessagingScheduler. These messages can be frequent and can even cause the error logs to expand to several GB before the cleaning processes can run. Messages may or may not be successfully sending at this time.

The error logs for this problem will contain several different messages, including:

System.NullReferenceException: Object reference not set to an instance of an object.

and

System.IndexOutOfRangeException: Archived

Common to all these errors will be a reference to DotNetNuke.Services.Social.Messaging. In the UI error logs, these will read as a Scheduler Event Failure:

SchedulerEventFailure.png

 

Solution

Part 1: Disabling the scheduler

  1. Go to Settings > Scheduler
  2. Take note of the current setting for Scheduler Mode so you can revert to that after you've fixed the problem (default is Timer Method)
  3. Set the Scheduler Mode to Disabled

If your error logs have become large enough to cause a problem for your site stability or performance, you can clear them by following the instructions in the article Fixing performance issues by truncating error logs. If disabling the scheduler doesn't stop the errors, you may need to recycle your app pool in IIS.

 

Part 2: Clearing the message queue

The Core Messaging Scheduler's Message Dispatch keeps its message queue in the table CoreMessaging_MessageRecipients. If an upgrade is run while the scheduler is still running, a mismatch can be created between the contents of that table and the other data stores that the messaging feature uses. To fix this problem, you will need to examine the contents of this table and delete pending messages.

WARNING: Always back up your SQL server before directly editing your database.

If you cannot truncate the entire table, you can try removing a small subset of messages. Try the following SQL queries in turn, testing the solution between each. These queries can be run directly in your preferred SQL IDE against your site's database, or they can be run in the integrated SQL Console.

  1. Delete messages which have not been sent and which were created before the upgrade:
    • delete from CoreMessaging_MessageRecipients 
      where emailsent=0
      and createdondate=<'2020-11-30' --Insert your upgrade date
  2. Messages which have not been sent
    • delete from CoreMessaging_MessageRecipients 
      where emailsent=0
  3. All messages created since one day before the upgrade
    • delete from CoreMessaging_MessageRecipients 
      where createdondate>dateadd(day,-1,'2020-11-30') --Insert your upgrade date
  4. All archived messages
    • delete from CoreMessaging_MessageRecipients
      where archived=1
  5. All messages
    • delete from CoreMessaging_MessageRecipients

 

Testing

  1. Re-enable your scheduler on its original setting.
  2. Check the error logs regularly to ensure Core Messaging errors have stopped.
  3. Messages should be successfully sending.

NOTE: As per our upgrade instructions, the Scheduler should always be disabled before an upgrade is performed in the future. This will minimize the chance of this error resurfacing.

Comments

0 comments

Please sign in to leave a comment.