walkinside / sdk

Develop powerful desktop and web applications on top of Walkinside 3D engine
4 stars 4 forks source link

Crash when requesting large entities from webserver #39

Closed kkneip closed 6 years ago

kkneip commented 7 years ago

When fetching large entity blob data from a model published to the webserver walkinside crashes.

The reasons seems to be that JSON serialization causes an error on server side. Event log states:

Event code: 3005 
Event message: An unhandled exception has occurred. 
Event time: 15.11.2017 11:02:18 
Event time (UTC): 15.11.2017 10:02:18 
Event ID: a8255d19a00d46c199238ce8daac9f72 
Event sequence: 12 
Event occurrence: 1 
Event detail code: 0 

Application information: 
    Application domain: /LM/W3SVC/1/ROOT/walkinsideservice-1-131552137288571050 
    Trust level: Full 
    Application Virtual Path: /walkinsideservice 
    Application Path: C:\Walkinside\wsmodels\ 
    Machine name: POLBES008 

Process information: 
    Process ID: 189160 
    Process name: w3wp.exe 
    Account name: KP07D0\polbesvc-walkinside 

Exception information: 
    Exception type: InvalidOperationException 
    Exception message: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.
   at System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, StringBuilder output, SerializationFormat serializationFormat)
   at System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, SerializationFormat serializationFormat)
   at Vrc.Wi.Services.JsonSerializer.serializeEntities2(IEnumerable`1 entities, StreamWriter writer) in e:\jenkins\workspace\walkinside-server-1.11-full-pipeline\server\wsmodels\contracts\JsonSerializer.cs:line 196
   at Vrc.Wi.Services.JsonSerializer.Serialize[T](T value, Stream out) in e:\jenkins\workspace\walkinside-server-1.11-full-pipeline\server\wsmodels\contracts\JsonSerializer.cs:line 39
   at CsConneg.Dispatcher.doDispatch(String acceptHeaderValue)
   at CsConneg.Dispatcher.doDispatch(String acceptHeaderValue)
   at Vrc.Wi.WsModels.ApiHandler.ProcessRequest(HttpContext context) in e:\jenkins\workspace\walkinside-server-1.11-full-pipeline\server\wsmodels\main\Api.ashx.cs:line 192
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Request information: 
    Request URL: http://polbes008.kp07d0.kp.thyssenkrupp.com/walkinsideservice/api.ashx?resource=entities 
    Request path: /walkinsideservice/api.ashx 
    User host address: 10.84.199.184 
    User: KP07D0\10513280 
    Is authenticated: True 
    Authentication Type: Negotiate 
    Thread account name: KP07D0\polbesvc-walkinside 

Thread information: 
    Thread ID: 9 
    Thread account name: KP07D0\polbesvc-walkinside 
    Is impersonating: False 
    Stack trace:    at System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, StringBuilder output, SerializationFormat serializationFormat)
   at System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, SerializationFormat serializationFormat)
   at Vrc.Wi.Services.JsonSerializer.serializeEntities2(IEnumerable`1 entities, StreamWriter writer) in e:\jenkins\workspace\walkinside-server-1.11-full-pipeline\server\wsmodels\contracts\JsonSerializer.cs:line 196
   at Vrc.Wi.Services.JsonSerializer.Serialize[T](T value, Stream out) in e:\jenkins\workspace\walkinside-server-1.11-full-pipeline\server\wsmodels\contracts\JsonSerializer.cs:line 39
   at CsConneg.Dispatcher.doDispatch(String acceptHeaderValue)
   at CsConneg.Dispatcher.doDispatch(String acceptHeaderValue)
   at Vrc.Wi.WsModels.ApiHandler.ProcessRequest(HttpContext context) in e:\jenkins\workspace\walkinside-server-1.11-full-pipeline\server\wsmodels\main\Api.ashx.cs:line 192
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Custom event details:

Any ideas how to handle this? Is there a possibility to increase maxJsonLength property? I tried this link (modifying web.config), but unfortunately it did not help.

Splitting the entity's data into multiple smaller packages is not appreciated.

Many thanks in advance and best regards,

Karsten

kveretennicov commented 7 years ago

This limit is not configurable at the moment, neither via SDK nor otherwise. You will need a fixed version of the product to work with large amount of entity data.

gcorvala commented 6 years ago

Hi @kkneip, we implemented a fix in the latest release. Feel free to reopen if you face again the same problem. Regards.