FluidFramework icon indicating copy to clipboard operation
FluidFramework copied to clipboard

QoS Report Unhandled Errors for the Week of 08/10/2020

Open ruchika-m opened this issue 6 years ago • 4 comments

Describe the bug

Seeing the following unhandled errors originate in this week's (08/10/2020) QoS Report. These are currently only reported for Teams Web host application

Message-1: "Uncaught AssertionError: Unsafe to transition to read-only state!" Associated stack: AssertionError: Unsafe to transition to read-only state! at _t. (https://officefluidprodversionedcdn.azureedge.net/5317403/container/officeContainer.js:158:5319) at _t.a.emit (https://officefluidprodversionedcdn.azureedge.net/5317403/host/IframeContainer.js:11:4738) at St.r (https://officefluidprodversionedcdn.azureedge.net/5317403/host/IframeContainer.js:179:753) at St.a.emit (https://officefluidprodversionedcdn.azureedge.net/5317403/host/IframeContainer.js:11:4738) at St.forceReadonly (https://officefluidprodversionedcdn.azureedge.net/5317403/host/IframeContainer.js:229:3210) at Tt.forceReadonly (https://officefluidprodversionedcdn.azureedge.net/5317403/host/IframeContainer.js:235:2979) at ForceReadonly (https://officefluidprodversionedcdn.azureedge.net/5317403/host/IframeContainer.js:259:15434) at o (https://officefluidprodversionedcdn.azureedge.net/5317403/host/IframeContainer.js:245:24050)

Message-2: "Uncaught AssertionError: replayPendingStates called twice for same clientId!" Associated Stack: AssertionError: replayPendingStates called twice for same clientId! at Ae.replayPendingStates (https://officefluidprodversionedcdn.azureedge.net/5317403/container/officeContainer.js:155:3156) at _t. (https://officefluidprodversionedcdn.azureedge.net/5317403/container/officeContainer.js:158:5428) at _t.a.emit (https://officefluidprodversionedcdn.azureedge.net/5317403/host/IframeContainer.js:11:4738) at St.r (https://officefluidprodversionedcdn.azureedge.net/5317403/host/IframeContainer.js:179:753) at St.a.emit (https://officefluidprodversionedcdn.azureedge.net/5317403/host/IframeContainer.js:11:4738) at St.forceReadonly (https://officefluidprodversionedcdn.azureedge.net/5317403/host/IframeContainer.js:229:3210) at Tt.forceReadonly (https://officefluidprodversionedcdn.azureedge.net/5317403/host/IframeContainer.js:235:2979) at ForceReadonly (https://officefluidprodversionedcdn.azureedge.net/5317403/host/IframeContainer.js:259:15434) at o (https://officefluidprodversionedcdn.azureedge.net/5317403/host/IframeContainer.js:245:24050)

To Reproduce

No repro, since these are recorded through telemetry

Logs

Use the following query to look through all the error logs: union kind=outer (Office_Fluid_App_Error | where Data_eventName == "UnhandledError" or Data_eventName == "UnhandledRejection" ), (Office_Fluid_OfficeWebHost_Error | where Data_eventName == "UnhandledError" or Data_eventName == "UnhandledRejection")| where Event_Time > ago(7d) | where Data_message contains "Uncaught AssertionError: replayPendingStates called twice for same clientId!" | summarize dcount=dcount(Data_hostCorrelationId) by Data_message, Data_eventName, Data_stack, Data_hostName | order by dcount desc

ruchika-m avatar Aug 10 '20 21:08 ruchika-m

Both are introduced in #2908

curtisman avatar Aug 13 '20 18:08 curtisman

Another thing to look into are why these assert aren't log in the runtime and result in uncaught promise rejection and leaked into the app.

curtisman avatar Aug 13 '20 18:08 curtisman

I only see 2 hits over 10 days, for either error. I believe that's the result of me adding more strict checks around when read-only transitions can happen and host eventually changing behavior.

@ruchika-m, I do not see any usage as of now of forceReadonly in bohemia repo. Can you please take a look at the history here and next steps? I.e. the asserts reflect more strict requirements around where it can be used, so any re-introduction should follow those requirements.

As for why we do not catch it: this is EventEmitter's callback, so exception propagates to the host, but they do not do anything with it. I'm adding proper logging around just that event, but not solving general problem (yet) of exceptions thrown while emitting events.

vladsud avatar Aug 29 '20 18:08 vladsud

@vladsud these particular errors are only happening on Teams Web. Seems from your comment that these are stricter checks meant to make sure that the method is not used incorrectly. They also seem to be coming from old app version so maybe teams made a change to fix this on their end but let me follow up with them. Closing the issue since this doesn't look actionable on runtime's end

ruchika-m avatar Aug 31 '20 00:08 ruchika-m