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

Массовые SerializationException #39

Open
NicholasNoise opened this issue Oct 8, 2019 · 2 comments
Open

Массовые SerializationException #39

NicholasNoise opened this issue Oct 8, 2019 · 2 comments
Labels
Milestone

Comments

@NicholasNoise
Copy link
Contributor

Описание ошибки

В тестовой и продуктивной средах встречается масса ошибок SerializationException (в среднем 4 для тестовой среды и 20 для продуктива). У нас их ловит на бэкенде свой GlobalExceptionHandler.

Текст ошибки

System.Runtime.Serialization.SerializationException: 'EdmEntityObject' cannot be serialized using the ODataMediaTypeFormatter.
at System.Web.OData.Formatter.ODataMediaTypeFormatter.GetSerializer (System.Type type, System.Object value, Microsoft.OData.Edm.IEdmModel model, System.Web.OData.Formatter.Serialization.ODataSerializerProvider serializerProvider) [0x000ef] in <2e50d258365747bf8e23647205ede093>:0
at System.Web.OData.Formatter.ODataMediaTypeFormatter.WriteToStream (System.Type type, System.Object value, System.IO.Stream writeStream, System.Net.Http.HttpContent content, System.Net.Http.Headers.HttpContentHeaders contentHeaders) [0x00025] in <2e50d258365747bf8e23647205ede093>:0
at System.Web.OData.Formatter.ODataMediaTypeFormatter.WriteToStreamAsync (System.Type type, System.Object value, System.IO.Stream writeStream, System.Net.Http.HttpContent content, System.Net.TransportContext transportContext, System.Threading.CancellationToken cancellationToken) [0x00059] in <2e50d258365747bf8e23647205ede093>:0
--- End of stack trace from previous location where exception was thrown ---

at System.Web.Http.WebHost.HttpControllerHandler.WriteBufferedResponseContentAsync (System.Web.HttpContextBase httpContextBase, System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpResponseMessage response, System.Web.Http.ExceptionHandling.IExceptionLogger exceptionLogger, System.Web.Http.ExceptionHandling.IExceptionHandler exceptionHandler, System.Threading.CancellationToken cancellationToken) [0x000ae] in :0

Шаги воспроизведения

Абсолютно непонятно, как повторить и кто создаёт некорректный payload для сериализации.

Конфигурация

Локально: Windows, .net 461, IIS 10 Express
Удалённо: Linux, mono 5.18.0, docker (flexberry/alt.p8-apache2-mono:5.18.0)

Пути решения

Требуется расширенный дебаг.

Исходный код

Исключение прилетает из этого метода:
https://github.com/OData/WebApi/blob/v5.7.0/OData/src/System.Web.OData/OData/Formatter/ODataMediaTypeFormatter.cs#L622
Предлагаю добавить дополнительное логирование в:
https://github.com/Flexberry/NewPlatform.Flexberry.ORM.ODataService/blob/develop/NewPlatform.Flexberry.ORM.ODataService/Formatter/CustomODataSerializerProvider.cs

@PashaMasalkin
Copy link
Contributor

На стенде EmberFlexdberry на локальном бэкенде ошибка не повторяется.

@NicholasNoise
Copy link
Contributor Author

Логирование чуть-чуть детализирует ситуацию:
'EdmEntityObject' (IEdmModel type='DataObjectEdmModel') cannot be serialized using the 'CustomODataSerializerProvider'
Но понятнее не становится.

@bratchikov bratchikov added the bug label Oct 27, 2019
@bratchikov bratchikov added this to the 5.1 milestone Oct 27, 2019
@bratchikov bratchikov modified the milestones: 5.1, 6.2 May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants