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

Error in V8. Get errors when clicking settings or Permission Menu after creating a new tenant #18679

Closed
1 task done
zaktecs opened this issue Jan 3, 2024 · 9 comments
Closed
1 task done
Assignees
Labels

Comments

@zaktecs
Copy link

zaktecs commented Jan 3, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Description

Encountering an issue in V8. Errors occur when attempting to access settings or the permission menu after creating a new tenant.

Reproduction Steps

Create new tenant

Expected behavior

able to use permission settings

Actual behavior

When I click Users meny in Administration > Identity Management > Users> Permissions. I get the following error
https://localhost:44361/identity/users

[2024-01-03T09:53:37.445Z] Error: System.Collections.Generic.KeyNotFoundException: The given key 'SettingManagement.Emailing.Test' was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Volo.Abp.PermissionManagement.Blazor.Components.PermissionManagementModal.<>c__DisplayClass42_1.b__18(RenderTreeBuilder __builder6)
at Blazorise.TabPanel.BuildRenderTree(RenderTreeBuilder __builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
log @ blazor.server.js?_v=638343977580000000:1
unhandledError @ blazor.server.js?_v=638343977580000000:1
(anonymous) @ blazor.server.js?_v=638343977580000000:1
_invokeClientMethod @ blazor.server.js?_v=638343977580000000:1
_processIncomingData @ blazor.server.js?_v=638343977580000000:1
Yt.connection.onreceive @ blazor.server.js?_v=638343977580000000:1
s.onmessage @ blazor.server.js?_v=638343977580000000:1
PermissionAndSettingMenuError

SettingMenuError

Regression?

NO

Known Workarounds

None

Version

8.0

User Interface

Common (Default)

Database Provider

EF Core (Default)

Tiered or separate authentication server

None (Default)

Operation System

Windows (Default)

Other information

No response

@zaktecs zaktecs added the bug label Jan 3, 2024
@realLiangshiwei
Copy link
Member

I will check it

@realLiangshiwei realLiangshiwei self-assigned this Jan 3, 2024
This was referenced Jan 3, 2024
@zaktecs
Copy link
Author

zaktecs commented Jan 16, 2024

@realLiangshiwei , what was the solution to this problem? You have closed the case but the issue still exists. I've just created a new solution and added a tenant and the probblem still there as reported as above. Thanks

@realLiangshiwei
Copy link
Member

Hi,

You can try to replace the PermissionManagementModal.razor

MyPermissionManagementModal

@using Volo.Abp.DependencyInjection
@using Microsoft.Extensions.Localization
@using Volo.Abp.PermissionManagement.Localization
@using Volo.Abp.PermissionManagement.Blazor.Components
@inherits PermissionManagementModal

@attribute [ExposeServices(typeof(PermissionManagementModal))]
@attribute [Dependency(ReplaceServices = true)]

<Modal @ref="_modal" Closing="@ClosingModal">
    <ModalContent Size="ModalSize.Large" Centered="true">
        <ModalHeader>
            <ModalTitle>@L["Permissions"] - @_entityDisplayName</ModalTitle>
            <CloseButton Clicked="CloseModal" />
        </ModalHeader>
        <ModalBody MaxHeight="50">
            
            <Field>
                <Check Disabled="_selectAllDisabled" Cursor="Cursor.Pointer" @bind-Checked="@GrantAll" TValue="bool">
                    @L["SelectAllInAllTabs"]
                </Check>
            </Field>
            
            <Divider />
            
            @if (_groups != null)
            {
                <Tabs TabPosition="TabPosition.Start" Pills="true" @bind-SelectedTab="@_selectedTabName">
                    <Items>
                        @foreach (var group in _groups)
                        {
                            <Tab Name="@GetNormalizedGroupName(group.Name)">
                                @if (group.Permissions.Any(x => x.IsGranted))
                                {
                                    <span>
                                        <b>@group.DisplayName ( @(group.Permissions.Count(x => x.IsGranted)) )</b>
                                    </span>
                                }
                                else
                                {
                                    <span>
                                        @group.DisplayName ( @(group.Permissions.Count(x => x.IsGranted)) )
                                    </span>
                                }
                            </Tab>
                        }
                    </Items>
                    <Content>
                        @foreach (var group in _groups)
                        {
                            <TabPanel Name="@GetNormalizedGroupName(group.Name)">
                                <h4>@group.DisplayName</h4>
                                
                                <Divider />
                                
                                <Field>
                                    <Check
                                        Disabled="@(IsPermissionGroupDisabled(group))"
                                        Checked="@(group.Permissions.All(x => x.IsGranted))"
                                        Cursor="Cursor.Pointer"
                                        CheckedChanged="@(b => GroupGrantAllChanged(b, group))"
                                        TValue="bool">
                                        @L["SelectAllInThisTab"]
                                    </Check>
                                </Field>

                                <Divider />
                                
                                @foreach (var permission in group.Permissions)
                                {
                                    <Field Style="@($"margin-inline-start: {_permissionDepths.GetValueOrDefault(permission.Name, 0) * 20}px")">
                                        <Check
                                            Disabled="@(IsDisabledPermission(permission))"
                                            Cursor="Cursor.Pointer"
                                            Checked="@permission.IsGranted"
                                            CheckedChanged="@(b => PermissionChanged(b, group, permission))"
                                            TValue="bool">
                                            @GetShownName(permission)
                                        </Check>
                                    </Field>
                                }
                                
                            </TabPanel>
                        }
                    </Content>
                </Tabs>
            }
        </ModalBody>
        <ModalFooter>
            <Button Color="Color.Secondary" Clicked="CloseModal">@L["Cancel"]</Button>
            <Button Color="Color.Primary" Clicked="SaveAsync">@L["Save"]</Button>
        </ModalFooter>
    </ModalContent>
</Modal>

@pdegenhardt
Copy link

Why is this closed? We are getting the same problem. Is this going to be fixed?

@Autrick
Copy link

Autrick commented Jul 3, 2024

Is there any fix about this issiue?

@realLiangshiwei
Copy link
Member

the problem has been fixed

@Autrick
Copy link

Autrick commented Jul 3, 2024

what was the solution to this problem?

if you do this you will still have same error.

  1. Create blazor server project (abp new Acme.BookStore -u blazor-server)
  2. Create tenant
  3. Login with tenant user
  4. Click setting section (/setting-management)

and if you also mean this it didn't solve anything for me:

Hi,

You can try to replace the PermissionManagementModal.razor

MyPermissionManagementModal

@using Volo.Abp.DependencyInjection
@using Microsoft.Extensions.Localization
@using Volo.Abp.PermissionManagement.Localization
@using Volo.Abp.PermissionManagement.Blazor.Components
@inherits PermissionManagementModal

@attribute [ExposeServices(typeof(PermissionManagementModal))]
@attribute [Dependency(ReplaceServices = true)]

<Modal @ref="_modal" Closing="@ClosingModal">
    <ModalContent Size="ModalSize.Large" Centered="true">
        <ModalHeader>
            <ModalTitle>@L["Permissions"] - @_entityDisplayName</ModalTitle>
            <CloseButton Clicked="CloseModal" />
        </ModalHeader>
        <ModalBody MaxHeight="50">
            
            <Field>
                <Check Disabled="_selectAllDisabled" Cursor="Cursor.Pointer" @bind-Checked="@GrantAll" TValue="bool">
                    @L["SelectAllInAllTabs"]
                </Check>
            </Field>
            
            <Divider />
            
            @if (_groups != null)
            {
                <Tabs TabPosition="TabPosition.Start" Pills="true" @bind-SelectedTab="@_selectedTabName">
                    <Items>
                        @foreach (var group in _groups)
                        {
                            <Tab Name="@GetNormalizedGroupName(group.Name)">
                                @if (group.Permissions.Any(x => x.IsGranted))
                                {
                                    <span>
                                        <b>@group.DisplayName ( @(group.Permissions.Count(x => x.IsGranted)) )</b>
                                    </span>
                                }
                                else
                                {
                                    <span>
                                        @group.DisplayName ( @(group.Permissions.Count(x => x.IsGranted)) )
                                    </span>
                                }
                            </Tab>
                        }
                    </Items>
                    <Content>
                        @foreach (var group in _groups)
                        {
                            <TabPanel Name="@GetNormalizedGroupName(group.Name)">
                                <h4>@group.DisplayName</h4>
                                
                                <Divider />
                                
                                <Field>
                                    <Check
                                        Disabled="@(IsPermissionGroupDisabled(group))"
                                        Checked="@(group.Permissions.All(x => x.IsGranted))"
                                        Cursor="Cursor.Pointer"
                                        CheckedChanged="@(b => GroupGrantAllChanged(b, group))"
                                        TValue="bool">
                                        @L["SelectAllInThisTab"]
                                    </Check>
                                </Field>

                                <Divider />
                                
                                @foreach (var permission in group.Permissions)
                                {
                                    <Field Style="@($"margin-inline-start: {_permissionDepths.GetValueOrDefault(permission.Name, 0) * 20}px")">
                                        <Check
                                            Disabled="@(IsDisabledPermission(permission))"
                                            Cursor="Cursor.Pointer"
                                            Checked="@permission.IsGranted"
                                            CheckedChanged="@(b => PermissionChanged(b, group, permission))"
                                            TValue="bool">
                                            @GetShownName(permission)
                                        </Check>
                                    </Field>
                                }
                                
                            </TabPanel>
                        }
                    </Content>
                </Tabs>
            }
        </ModalBody>
        <ModalFooter>
            <Button Color="Color.Secondary" Clicked="CloseModal">@L["Cancel"]</Button>
            <Button Color="Color.Primary" Clicked="SaveAsync">@L["Save"]</Button>
        </ModalFooter>
    </ModalContent>
</Modal>

so what was the fix? where is you solution? Could you please send it please?

@realLiangshiwei
Copy link
Member

I could not reproduce the problem

abp new TestApp -u blazor-server -t app -v 8.2.0

@Autrick
Copy link

Autrick commented Jul 3, 2024

[12:09:20 WRN] Unhandled exception rendering component: Sequence contains no elements
System.InvalidOperationException: Sequence contains no elements
   at System.Linq.ThrowHelper.ThrowNoElementsException()
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at Volo.Abp.SettingManagement.Blazor.Pages.SettingManagement.SettingManagement.OnInitializedAsync()
   at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
[12:09:20 ERR] Unhandled exception in circuit 'S-_jLhqLvYtljBHdVlPPApquvjtBAaj3y3LwFD7QhM8'.
System.InvalidOperationException: Sequence contains no elements
   at System.Linq.ThrowHelper.ThrowNoElementsException()
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at Volo.Abp.SettingManagement.Blazor.Pages.SettingManagement.SettingManagement.OnInitializedAsync()
   at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
[12:09:20 WRN] Unhandled exception rendering component: Cannot access a disposed object.
System.ObjectDisposedException: Cannot access a disposed object.
   at Microsoft.AspNetCore.Components.RenderTree.ArrayBuilder`1.GrowBuffer(Int32 desiredCapacity)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame(DiffContext& diffContext, Int32 newFrameIndex)
   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.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, ArrayRange`1 oldTree, ArrayRange`1 newTree)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
[12:09:20 ERR] Unhandled exception in circuit 'S-_jLhqLvYtljBHdVlPPApquvjtBAaj3y3LwFD7QhM8'.
System.ObjectDisposedException: Cannot access a disposed object.
   at Microsoft.AspNetCore.Components.RenderTree.ArrayBuilder`1.GrowBuffer(Int32 desiredCapacity)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame(DiffContext& diffContext, Int32 newFrameIndex)
   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.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, ArrayRange`1 oldTree, ArrayRange`1 newTree)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
[12:09:20 DBG] Get dynamic claims cache for user: cfda7098-725f-bc4d-80eb-3a138a3c338b
[12:09:20 INF] Executed endpoint 'Microsoft.AspNetCore.Routing.RouteEndpoint'
[12:09:20 INF] Request finished HTTP/2 CONNECT https://localhost:44343/_blazor?id=SD7kXCoYuGhW36DiGYoyeQ - 200 null null 2557.6702ms
[12:09:20 INF] Connection id "0HN4R90N7CIHP", Request id "0HN4R90N7CIHP:0000001B": the application completed without reading the entire request body.

What could be the problem in that case? i just created an App with abp new TestApp -u blazor-server -t app -v 8.2.0

hmmmmm

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

4 participants