We are using Entity Framework 6.4.4 in our project and have ran into a serious problem recently. After running for 10-20 hours (maybe around a million requests) we suddenly get a massive amount of EF materialization errors. Looks like all EF mappings get messed up for some reason and wrong properties are being used even for basic methods like Find.
Couple examples of the errors we receive:
The '...' property on '...' could not be set to a 'System.Byte' value. You must set this property to a non-null value of type 'System.Guid'. at
System.Data.Entity.Core.Common.Internal.Materialization.Shaper.HandleEntityAppendOnly[TEntity](Func`2 constructEntityDelegate, EntityKey entityKey, EntitySet entitySet) at lambda_method(Closure , Shaper )
Shaper....SingleOrDefault[TSource]_InternalSet`1.FindInStore_InternalSet`1.Find
The '...' property on '...' could not be set to a 'System.Byte' value. You must set this property to a non-null value of type 'System.DateTime'
All of this code works until some specific moment so it does not look like an issue with our existing mappings. We were not able to find anyone similar issues so far. Perhaps upgrading to EF Core would resolve them but that would require a huge time investment so right now we are looking for a temporary solution.
Does anyone have information as to what could be causing this? We hope to at least figure out if this is mostly caused by heavy load so we can optimize and scale our code or some sort of error on our part.