A DNN website, recently updated to 7.3, was showing excessive Event Log entries, with repeated errors Sequence contains more than one matching element.
From the Event Viewer the error was showing as:
System.InvalidOperationException: Sequence contains more than one matching element at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate) at DotNetNuke.Services.Scheduling.Scheduler.CoreScheduler.GetServer(String executingServer) at DotNetNuke.Services.Scheduling.Scheduler.CoreScheduler.LoadQueueFromTimer() at DotNetNuke.Services.Scheduling.Scheduler.CoreScheduler.Start()
Noting the reference to the function GetSever I reviewed the tables associated with the DNN installation. Looking in the table WebServers, I used the Microsoft SQL Server management Studio because access to the SQL was proving to be troublesome.
From within the DNN website the SQL Select * from WebServers, can be run from the Host SQL page.
I found two entries in the table, one dating from when the website was created and one more recently, possibly when the site was updated to DNN7.3.
| ServerID | ServerName | CreatedDate | LastActivityDate | URL | IISAppName | Enabled | ServerGroup | UniqueId | PingFailureCount |
|---|---|---|---|---|---|---|---|---|---|
| 1 | dnn7 | 11/29/2011 7:43:34 AM | 9/15/2014 10:04:49 AM | localhost/dnn7 | /LM/W3SVC/122/ROOT | 0 | |||
| 2 | dnn7 | 2/21/2014 10:11:28 AM | 1/30/2014 1:34:39 PM | /LM/W3SVC/129/ROOT | 0 |
I edited the second entry, changing the ServerName entry to dnn7a.
After making the change restart the application pool to ensure that the changes to the database take effect.
The application pool maybe restarted either by using the option from the Host Settings page, or by editing the web.config file, a space or line feed , somewhere near the top is the amendment which I usually make.
Following the change to the second entry I cleared the event log, waited for half an hour before checking again. I found that the run of errors associated with Scheduler.CoreScheduler.GetServer had ceased.
With this error cleared I was then seeing an error related to the SearchEngineScheduler in the EventViewer.


