I have narrowed the issue and it is related to the examine index. In the development environment I just need to rebuild and it works fine but on the test we need to stop application pool delete examin index and restart things.
I also get this from the logs
2016-02-16 08:12:50,006 [P4656/D62/T1] INFO Umbraco.Core.DatabaseContext - CanConnect = True
2016-02-16 08:12:50,051 [P4656/D62/T1] INFO Umbraco.Core.DatabaseContext - CanConnect = True
2016-02-16 08:12:50,051 [P4656/D62/T1] INFO Umbraco.Core.DatabaseContext - CanConnect = True
2016-02-16 08:12:50,072 [P4656/D62/T1] INFO Umbraco.Core.DatabaseContext - CanConnect = True
2016-02-16 08:12:50,072 [P4656/D62/T1] ERROR Umbraco.Core.CoreBootManager - An error occurred running OnApplicationStarted for handler Umbraco.Web.BatchedDatabaseServerMessengerStartup
System.ArgumentException: An entry with the same key already exists.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.SortedList`2.Add(TKey key, TValue value)
at Umbraco.Core.MainDom.Register(Action install, Action release, Int32 weight)
at Umbraco.Core.Sync.DatabaseServerMessenger.Boot()
at Umbraco.Web.BatchedDatabaseServerMessenger.Startup()
at Umbraco.Web.BatchedDatabaseServerMessengerStartup.ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
at Umbraco.Core.ApplicationEventHandler.OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
at Umbraco.Core.CoreBootManager.<Complete>b__a(IApplicationEventHandler x)
2016-02-16 08:12:50,074 [P4656/D62/T1] ERROR Umbraco.Core.UmbracoApplicationBase - An unhandled exception occurred
System.ArgumentException: An entry with the same key already exists.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.SortedList`2.Add(TKey key, TValue value)
at Umbraco.Core.MainDom.Register(Action install, Action release, Int32 weight)
at Umbraco.Core.Sync.DatabaseServerMessenger.Boot()
at Umbraco.Web.BatchedDatabaseServerMessenger.Startup()
at Umbraco.Web.BatchedDatabaseServerMessengerStartup.ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
at Umbraco.Core.ApplicationEventHandler.OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
at Umbraco.Core.CoreBootManager.<Complete>b__a(IApplicationEventHandler x)
at Umbraco.Core.EnumerableExtensions.ForEach[TItem](IEnumerable`1 items, Action`1 action)
at Umbraco.Core.CoreBootManager.Complete(Action`1 afterComplete)
at Umbraco.Web.WebBootManager.Complete(Action`1 afterComplete)
at Umbraco.Core.UmbracoApplicationBase.StartApplication(Object sender, EventArgs e)
at Umbraco.Core.UmbracoApplicationBase.Application_Start(Object sender, EventArgs e)
I have read that this could be related to a duplicate user but no such things exists in the database.
Another issue that might be causing this is that the dev site and the test site share the same umbraco database. I am not sure if that could cause this kind of conflict.
In any case I am really confused about this error and any help would be highly appreciated as it is really critical.
Thanks in advance,
Vasilis
* EDIT / [SOLVED] *
The problem was happening because I was using load balanced configuration in the umbracoConfig.settings to the dev server where that was not needed.
hey @Vasilis, did you get a resolution to this? I've just started working on a site in dev and it's now randomly throwing this exception for me too. I've found an iisreset clears it for me, but obviously that's not workable for live
Hey there. I am really sorry I didn't see this before. The problem was happening because I was using load balanced configuration in the umbracoConfig.settings to the dev server where that was not needed.
Did anyone find a solution to this issue?
I cam in this morning and my application in Dev is giving me the same error and stack trace, everything was good before I left the day before.
I'm looking at the CMS code for the last two methods in the stack and I can see why the problem can happen but not sure how:
at Umbraco.Core.**MainDom.Register**(Action install, Action release, Int32 weight)
at Umbraco.Core.Sync.**DatabaseServerMessenger.Boot**()
The code in the DatabaseServerMessenger.Boot is calling "Register" on the MainDom class with a "wight" parameter value of 10. In the Dom.Register class, this value gets added as a key into a sorted list which is giving the above error, I do not know why this is being added again...
_callbacks.Add(weight, release);
// register a main domain consumer
public bool Register(Action install, Action release, int weight = 100)
{
lock (_locko)
{
if (_signaled) return false;
if (install != null)
install();
if (release != null)
_callbacks.Add(weight, release);
return true;
}
}
The "DatabaseServerMessenger.Boot" method has a remarks that it is not thread safe and caller MUST ensure thread safety. Could this be related?
As I said, the application was running fine without anyone touching it until I came in the morning and I started receiving this error.
I just got this error after I removed my App_Data/umbraco.config file during a troubleshooting session in development.
The solution that worked for me was to remove the whole App_Data/TEMP folder and allow it all to be regenerated.
I'm not sure the root cause (I'm guessing it's related to indexing, as Vasilis indicated), but I wanted to post this workaround in case it helps anyone else.
An entry with the same key already exists
Hello,
I am building a site in Umbraco 7. I was on 7.3.x now updated to 7.4.0. On random occasions the site will break and I will get the following message.
I have narrowed the issue and it is related to the examine index. In the development environment I just need to rebuild and it works fine but on the test we need to stop application pool delete examin index and restart things.
I also get this from the logs
I have read that this could be related to a duplicate user but no such things exists in the database.
Another issue that might be causing this is that the dev site and the test site share the same umbraco database. I am not sure if that could cause this kind of conflict.
In any case I am really confused about this error and any help would be highly appreciated as it is really critical.
Thanks in advance, Vasilis
* EDIT / [SOLVED] * The problem was happening because I was using load balanced configuration in the umbracoConfig.settings to the dev server where that was not needed.
hey @Vasilis, did you get a resolution to this? I've just started working on a site in dev and it's now randomly throwing this exception for me too. I've found an iisreset clears it for me, but obviously that's not workable for live
@Vasilis? Any joy in resolving this?
Hey there. I am really sorry I didn't see this before. The problem was happening because I was using load balanced configuration in the umbracoConfig.settings to the dev server where that was not needed.
Full stack trace for me:
Did anyone find a solution to this issue? I cam in this morning and my application in Dev is giving me the same error and stack trace, everything was good before I left the day before.
I'm looking at the CMS code for the last two methods in the stack and I can see why the problem can happen but not sure how:
The code in the DatabaseServerMessenger.Boot is calling "Register" on the MainDom class with a "wight" parameter value of 10. In the Dom.Register class, this value gets added as a key into a sorted list which is giving the above error, I do not know why this is being added again... _callbacks.Add(weight, release);
The "DatabaseServerMessenger.Boot" method has a remarks that it is not thread safe and caller MUST ensure thread safety. Could this be related?
As I said, the application was running fine without anyone touching it until I came in the morning and I started receiving this error.
I just got this error after I removed my App_Data/umbraco.config file during a troubleshooting session in development.
The solution that worked for me was to remove the whole App_Data/TEMP folder and allow it all to be regenerated.
I'm not sure the root cause (I'm guessing it's related to indexing, as Vasilis indicated), but I wanted to post this workaround in case it helps anyone else.
is working on a reply...