Skip to content
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

[BUG] Save causes "Sequence contains more than one matching element" #3568

Open
6TELOIV opened this issue Jan 27, 2025 · 4 comments
Open

[BUG] Save causes "Sequence contains more than one matching element" #3568

6TELOIV opened this issue Jan 27, 2025 · 4 comments

Comments

@6TELOIV
Copy link
Contributor

6TELOIV commented Jan 27, 2025

Bug Affects...

[x] edit experience / UI
[x] admin experience UI
[x] Content Types or data management
[x] Platform parts (Dnn/Oqtane)
[x] other / unknown

Current Behavior / Expected Behavior

Occasionally (rarely), users will get a 400 error when saving, with the message "Sequence contains more than one matching element". Once the issue occurs, that specific content item is "corrupt" and will ALWAYS give the same error, regardless of user nor system restarts. The only workaround is deleting and recreating the item from scratch.

To Reproduce (Steps, Videos, Screenshots, Apps)

Unsure how to reproduce; this seems to be a data race issue, where somehow under laggy conditions, multiple entries for the same EntityId are added to the database? I've attached the log for our specific instance of the error, which only really gives insight into the situation once the issue has occured, not how it got that way. It may be near impossible to identify when the issue begins, as there is nothing wrong until the editor tries to save the item again once the corruption has occured; no error occurs when the corruption/duplication happens

Your environment

  • 2sxc version(s): 17.09.00
  • Browser: all
  • DNN / Oqtane: DNN 19.13.02
  • Hosting platform: all
  • Ui Languages: any/all

Additional context

Log: Sequence contains more than one matching element.htm.txt
Previous probably related issue: #3436
Line causing the overall error: DbEntity_read.cs#L89

@6TELOIV 6TELOIV changed the title [BUG] Sequence contains m [BUG] Save causes "Sequence contains more than one matching element" Jan 27, 2025
@6TELOIV
Copy link
Contributor Author

6TELOIV commented Jan 27, 2025

My analysis above may be incorrect, based on the line that is causing the error:

dbEntityList
  .GroupBy(e => e.EntityGuid)
  .ToDictionary(
      g => g.Key,
      g => g.Single(e => !e.PublishedEntityId.HasValue).EntityId //This line is finding multiple instead of Single
  );

It may be a data race where 2 "published" entities are created due to multiple saves going through???

Again, not sure what the originating CAUSE is, just the fact that something goes wrong, and then the content item becomes un-saveable.

@iJungleboy
Copy link
Contributor

iJungleboy commented Jan 31, 2025

Possibly related to #3561 - nope, not likely.

@iJungleboy
Copy link
Contributor

actually I think it's probably not related.

The 3561 is a very recent bug.

How often does this happen - every month, every 3 months, every day?

@6TELOIV
Copy link
Contributor Author

6TELOIV commented Feb 4, 2025

This is the first time it's happened and I've investigated, and we've had 2sxc for about 9 months. At our rate of editing and the amount of content items we'd have, I'd estimate this bug occurs on a magnitude of 1 in 10,000 to 100,000 edits.

I'll post back here if it happens again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants