microsoft / DurableFunctionsMonitor

A monitoring/debugging UI tool for Azure Durable Functions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[VsCode] Fail to load instance history

junalmeida opened this issue · comments

When trying to see an orchestration history, I get this:

image

@junalmeida , can you please enable logging and then check the 'Durable Functions Monitor' output channel for some more detailed error messages when it happens?

image

Also, does it happen for just this single instance or for some others (and how much similar they are)?

Here goes the log when the error happens. So far this happens with this single instance. Other instances of this orchestration seems to return with no problem.

[2022-03-17T20:22:56.912Z] Executing 'DfmAboutFunction' (Reason='This function was programmatically called via the host APIs.', Id=c14a5b4e-7428-4757-94b1-3907946c6079)
[2022-03-17T20:22:57.242Z] Executing 'DfmAboutFunction' (Reason='This function was programmatically called via the host APIs.', Id=ac19ca02-c406-402c-bbb8-179b387b49d6)
[2022-03-17T20:22:57.549Z] Executed 'DfmAboutFunction' (Succeeded, Id=c14a5b4e-7428-4757-94b1-3907946c6079, Duration=653ms)
[2022-03-17T20:22:57.549Z] Executed 'DfmAboutFunction' (Succeeded, Id=ac19ca02-c406-402c-bbb8-179b387b49d6, Duration=302ms)
[2022-03-17T20:22:58.146Z] Executing 'DfmGetOrchestrationsFunction' (Reason='This function was programmatically called via the host APIs.', Id=3b3f0d05-2bd2-4620-b3f0-d975a071cf38)
[2022-03-17T20:22:59.918Z] Host lock lease acquired by instance ID '0000000000000000000000001326EE58'.
[2022-03-17T20:23:01.828Z] Executing 'DfmGetIdSuggestionsFunction' (Reason='This function was programmatically called via the host APIs.', Id=72c7478b-5b82-4b53-9da6-99a7475ddee8)
[2022-03-17T20:23:01.927Z] Executed 'DfmGetIdSuggestionsFunction' (Succeeded, Id=72c7478b-5b82-4b53-9da6-99a7475ddee8, Duration=106ms)
[2022-03-17T20:23:03.421Z] Executing 'DfmGetOrchestrationFunction' (Reason='This function was programmatically called via the host APIs.', Id=44e4b7e5-e1c0-4fbe-81e8-2b97a15d59c6)
[2022-03-17T20:23:03.692Z] Executed 'DfmGetOrchestrationFunction' (Succeeded, Id=44e4b7e5-e1c0-4fbe-81e8-2b97a15d59c6, Duration=271ms)
[2022-03-17T20:23:03.853Z] Executing 'DfmGetOrchestrationHistoryFunction' (Reason='This function was programmatically called via the host APIs.', Id=8338edd3-a3e6-4a64-a650-423d21c32b27)
[2022-03-17T20:23:05.793Z] Failed to get execution history from storage, falling back to DurableClient
[2022-03-17T20:23:05.794Z] System.Private.CoreLib: An item with the same key has already been added. Key: 9.
[2022-03-17T20:23:59.965Z] Executed 'DfmGetOrchestrationsFunction' (Succeeded, Id=3b3f0d05-2bd2-4620-b3f0-d975a071cf38, Duration=61829ms)
[2022-03-17T20:23:59.997Z] Executing 'DfmGetOrchestrationsFunction' (Reason='This function was programmatically called via the host APIs.', Id=bcafdfd1-81f3-409b-80a4-4b1265af72ca)
[2022-03-17T20:24:40.124Z] DFM failed
[2022-03-17T20:24:40.124Z] Newtonsoft.Json: Index is less than 0. (Parameter 'index').
[2022-03-17T20:24:40.125Z] Executed 'DfmGetOrchestrationHistoryFunction' (Succeeded, Id=8338edd3-a3e6-4a64-a650-423d21c32b27, Duration=96273ms)

Btw I have a question for you: I've noticed that the total run time for each activity on the Gantt chart is a sum of "waiting time" with "execution" time. Is there a way for you to show those timings separately?

I say that because on the servers I have a 10 minute limit, and I can see some taking 20 min. So, I suppose this is the sum of waiting time (scheduled) with actual execution time.

@junalmeida , so the logs tell us that this particular instance's history fails to be fetched both by DfMon's custom algorithm and by DurableClient (which is used as a fallback method).

The culprit seems to be a duplicated TaskScheduledId in the execution history. I have no idea what circumstances could lead to that, but the workaround is straightforward (just committed it).
Note that this is just a hypothesis, and it is to be validated once we release the updated version (in a few days).

Regarding your question, let's discuss it separately via #23.

@scale-tone Thanks for addressing this :) I'm happy to test it once available.

Should be fixed in v5.3. Please, validate.

Yes, it works. Error is gone and I can see all details, Sequence diagram and Gantt chart for this instance. Thank you for addressing this.