Error: More than one sibling of component, Same Key Value

Hello,

Most of the time application works properly however Time to time, I am getting below error;

Even If I have only 1 chart and 1 datagrid in my project.

System.InvalidOperationException: More than one sibling of component 'Radzen.Blazor.Rendering.Path' has the same key value, 'M 517.7057926829268 224.98666666666668 A 0 0 0 0 1 517.7057926829268 224.98666666666668 L 509.79420731707313 224.98666666666668 A 0 0 0 0 1 509.79420731707313 224.98666666666668 L 509.79420731707313 236 L 517.7057926829268 236 Z'. Key values must be unique.
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ThrowExceptionForDuplicateKey(Object key, RenderTreeFrame& frame)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.BuildKeyToInfoLookup(DiffContext diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForFramesWithSameSequence(DiffContext& diffContext, Int32 oldFrameIndex, Int32 newFrameIndex)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForFramesWithSameSequence(DiffContext& diffContext, Int32 oldFrameIndex, Int32 newFrameIndex)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForFramesWithSameSequence(DiffContext& diffContext, Int32 oldFrameIndex, Int32 newFrameIndex)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForFramesWithSameSequence(DiffContext& diffContext, Int32 oldFrameIndex, Int32 newFrameIndex)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForFramesWithSameSequence(DiffContext& diffContext, Int32 oldFrameIndex, Int32 newFrameIndex)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ComputeDiff(Renderer renderer, RenderBatchBuilder batchBuilder, Int32 componentId, ArrayRange1 oldTree, ArrayRange1 newTree)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost: Error: Unhandled exception in circuit 'jo687lCl-HSuK-kC-UdypURZTEqe7nUxVB2HLrzvIL0'.

Every minute two functions getting call;

 async void RunTimer()
        {
            while (await periodicTimer.WaitForNextTickAsync())
            {
                getTA();
                getWE();
                await InvokeAsync(StateHasChanged);
            }
        }

Here is the .razor part;

<RadzenRow>
    <RadzenColumn>
        <RadzenChart Style="color: #ffffff" >
            <RadzenStackedColumnSeries Fills="@(new [] { "#60C73C" })" Data="@listTACPU" CategoryProperty="SAMPLE_TIME" Title=CPU ValueProperty="COUNT" />
            <RadzenStackedColumnSeries Fills="@(new [] { "#D6FDD0" })" Data="@listTASCHEDULER" CategoryProperty="SAMPLE_TIME" Title=SCHEDULER ValueProperty="COUNT" />
            <RadzenStackedColumnSeries Fills="@(new [] { "#0350DE" })" Data="@listTAUSERIO" CategoryProperty="SAMPLE_TIME" Title=USERIO ValueProperty="COUNT" />
            <RadzenStackedColumnSeries Fills="@(new [] { "#3D94E0" })" Data="@listTASYSTEMIO" CategoryProperty="SAMPLE_TIME" Title=SYSTEMIO ValueProperty="COUNT" />
            <RadzenStackedColumnSeries Fills="@(new [] { "#7F2510" })" Data="@listTACONCURRENCY" CategoryProperty="SAMPLE_TIME" Title=CONCURRENCY ValueProperty="COUNT" />
            <RadzenStackedColumnSeries Fills="@(new [] { "#AF361B" })" Data="@listTAAPPLICATION" CategoryProperty="SAMPLE_TIME" Title=APPLICATION ValueProperty="COUNT" />
            <RadzenStackedColumnSeries Fills="@(new [] { "#D46E2C" })" Data="@listTACOMMIT" CategoryProperty="SAMPLE_TIME" Title=COMMIT ValueProperty="COUNT" />
            <RadzenStackedColumnSeries Fills="@(new [] { "#594418" })" Data="@listTACONFIGURATION" CategoryProperty="SAMPLE_TIME" Title=CONFIGURATION ValueProperty="COUNT" />
            <RadzenStackedColumnSeries Fills="@(new [] { "#727257" })" Data="@listTAADMINISTRATIVE" CategoryProperty="SAMPLE_TIME" Title=ADMINISTRATIVE ValueProperty="COUNT" />
            <RadzenStackedColumnSeries Fills="@(new [] { "#9D9375" })" Data="@listTANETWORK" CategoryProperty="SAMPLE_TIME" Title=NETWORK ValueProperty="COUNT" />
            <RadzenStackedColumnSeries Fills="@(new [] { "#BFB79E" })" Data="@listTAQUEUEING" CategoryProperty="SAMPLE_TIME" Title=QUEUEING ValueProperty="COUNT" />
            <RadzenStackedColumnSeries Fills="@(new [] { "#C8C2B1" })" Data="@listTACLUSTER" CategoryProperty="SAMPLE_TIME" Title=CLUSTER ValueProperty="COUNT" />
            <RadzenStackedColumnSeries Fills="@(new [] { "#DF77A8" })" Data="@listTAOTHER" CategoryProperty="SAMPLE_TIME" Title=OTHER ValueProperty="COUNT" />
            <RadzenCategoryAxis Formatter="FormatAsSecond"></RadzenCategoryAxis>
        </RadzenChart>
    </RadzenColumn>
    <RadzenColumn Style="color: #ffffff">
        <RadzenDataGrid TItem="Lists.list_WE" Data="@listWE">
            <Columns>
                <RadzenDataGridColumn property="EVENT" TItem=Lists.list_WE Title="EVENT"></RadzenDataGridColumn>
                <RadzenDataGridColumn property="COUNT" TItem=Lists.list_WE Title="Wait(ms)"></RadzenDataGridColumn>
            </Columns>
        </RadzenDataGrid>
    </RadzenColumn>
</RadzenRow>

Hi @lumosapp,

We will need a reproduction of this error that we can run locally.

Uploaded.

test_ash.zip (1.5 MB)

That project is adding the same data item to the series which indeed is causing a problem as there is more than one item with the exact same coordinates (they are overlapping). What is the reason of having such duplicate items in your data?

Since real project have lots of depedency to a lot class to collect data, I can only reproduce in this way.

When I use line series or any other normal series, it works. The problem is about Stacked Charts.

Maybe is this relevant to the bug that I open below topic for it.

No, it is not. It is related to you using the same data items for the same series. As a result the key ends up the same. You can easily fix that by ensuring you don't have the same values for the same category.

1 Like

Thank you, I will investigate in that way.