-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception 'An element with the same key but a different value already exists. Key: OrchardCore.Roles.Models.RolesDocument' on startup #4805
Comments
Complete callstack: |
Big power outage so from my phone as i could get a poor conection |
In yessql Store, on an immutable dico we use TryGetValue then do something then Add that may fail if the entry has just been set by another thread, we would need to use SetItem in place that doesn’t fail in this case. It was working before because we were using the cached value, here we would need to do the same to prevent one db query, but when updating user roles we use the aspnet user manager that also call in this case FindByNameAsync. That’s why in this method we load data from the database. For this last thing i will see what we can do as soon as i can start my computer, i still don’t have any electrical power. Meanwhile i think that this issue can be easily fixed through yessql. |
Sorry to have infected your country with our power outage @jtkech |
@jtkech which collection is it ? |
I see ... |
@Skrypt no problem, still not any power, i can just get Time to Time some connection from my phone, i’am under the snow, becomes to be very cold at home, it looks like your recent storry, we now are 2 black cats ;) @sebastienros in Store.cs, maybe same problem with different dicos |
Just submitted a PR that should fix it. It was worse than what is described here |
yes, just saw your pr, not so worse ;) |
I updated my solution to dev 3 days ago. Since that version, this exception is logged serveral times a day:
When I did encouter this issue myself yesterday, I was not doing anything. It happened when I first browsed to the website. I got a 500. After F5 the site worked fine. So I assume it's some kind of startup issue.
@jtkech : it might be related to #4001
The text was updated successfully, but these errors were encountered: