Aktivity „heshengli“

  • ABP Framework version: v7.2.2
  • UI Type: Blazor Server
  • Database System: EF Core ( PostgreSQL.) /
  • Tiered (for MVC) or Auth Server Separated (for Angular): abp commerical template
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

blazor ->gateway->administrator
http request /api/abp/application-configuration error The page cannot be loaded

2024-05-20 16:41:35.861 +00:00 [INF] Request starting HTTP/1.1 GET https://192.168.23.81:44367/api/abp/application-configuration?IncludeLocalizationResources=False&api-version=1.0 - 0
2024-05-20 16:41:35.863 +00:00 [ERR] Exception occurred while processing message.
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: '[PII of type 'System.String' is hidden. For more details, see https://aka.ms/IdentityModel/PII.]'.
   at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel)
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()
2024-05-20 16:41:35.864 +00:00 [ERR] Connection id "0HN3OTEB940MK", Request id "0HN3OTEB940MK:0000000C": An unhandled exception was thrown by the application.
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: '[PII of type 'System.String' is hidden. For more details, see https://aka.ms/IdentityModel/PII.]'.
   at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel)
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Prometheus.HttpMetrics.HttpRequestDurationMiddleware.Invoke(HttpContext context)
   at Prometheus.HttpMetrics.HttpRequestCountMiddleware.Invoke(HttpContext context)
   at Prometheus.HttpMetrics.HttpInProgressMiddleware.Invoke(HttpContext context)
   at Volo.Abp.AspNetCore.Security.AbpSecurityHeadersMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
2024-05-20 16:41:35.864 +00:00 [INF] Request finished HTTP/1.1 GET https://192.168.23.81:44367/api/abp/application-configuration?IncludeLocalizationResources=False&api-version=1.0 - 0 - 500 0 - 2.4266ms

running error

using System;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Uow;

namespace OneAdmin.BaseManagement
{
    public class StudentAppService : ApplicationService, IStudentAppService
    {
        private readonly IRepository<Student, Guid> _StudentRepository;
        private readonly IRepository<Classes, Guid> _ClassesRepository;
        private readonly IRepository<ClassStudent> _ClassStudentRepository;

        public StudentAppService(
            IRepository<Student, Guid> studentRepository,
            IRepository<Classes, Guid> classesRepository,
            IRepository<ClassStudent> classStudentRepository
            )
        {
            _StudentRepository = studentRepository;
            _ClassesRepository = classesRepository;
            _ClassStudentRepository = classStudentRepository;
        }

        public async Task<bool> BatchCreateAsync()
        {

            await Task.Factory.StartNew(async () =>
            {
                try
                {
                    using (var uow = UnitOfWorkManager.Begin(requiresNew: true, isTransactional: false))
                    {
                        for (int indexClass = 1; indexClass <= 10; indexClass++)
                        {
                            var data = await _ClassesRepository.InsertAsync(new Classes(GuidGenerator.Create())
                            {
                                Name = indexClass.ToString(),
                                No = indexClass
                            }, true);
                            await CreateStudentAsync(data);
                        }
                    }

                }
                catch (Exception ex)
                {
                    Console.WriteLine($"Error={ex.Message}");
                }
            });
            return true;
        }

        private async Task CreateStudentAsync(Classes classes)
        {
            var stuQuery = await _StudentRepository.GetQueryableAsync();
            var count = stuQuery.LongCount() + 1;
            for (int index = 1; index <= count; index++)
            {
                var student = await _StudentRepository.InsertAsync(new Student(GuidGenerator.Create())
                {
                    Name = index.ToString(),
                    No = index
                }, true);
                await Task.Delay(TimeSpan.FromSeconds(1));
                if (classes != null && student != null)
                {
                    await CreateClsStuAsync(classes, student);
                }
            }
        }

        private async Task CreateClsStuAsync(Classes classes, Student student)
        {
            await _ClassStudentRepository.InsertAsync(new ClassStudent(classes.Id, student.Id), true);
            await Task.Delay(TimeSpan.FromSeconds(1));

        }
    }
}

single entity insert not error,muti entity running error

alll code register single ,CommonService.BatchCreateAsync(),also running not error

using System;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;

namespace OneAdmin.BaseManagement
{
    public class CommonService 
    {
        private readonly IStudentRepository _StudentRepository;
        private readonly IClassesRepository _ClassesRepository;
        private readonly IClassStudentRepository _ClassStudentRepository;
        //private readonly IUnitOfWorkManager UnitOfWorkManager;
        public CommonService(
            IStudentRepository studentRepository,
            IClassesRepository classesRepository,
            IClassStudentRepository classStudentRepository
            //IUnitOfWorkManager unitOfWorkManager
            )
        {
            _StudentRepository = studentRepository;
            _ClassesRepository = classesRepository;
            _ClassStudentRepository = classStudentRepository;
            //UnitOfWorkManager = unitOfWorkManager;
        }


        public async Task<bool> BatchCreateAsync()
        {
            try
            {
                for (int indexClass = 1; indexClass <= 10; indexClass++)
                {
                    var data = await _ClassesRepository.InsertAsync(new Classes(Guid.NewGuid())
                    {
                        Name = indexClass.ToString(),
                        No = indexClass
                    }, true);
                    await Task.Delay(TimeSpan.FromSeconds(1));
                    //var clsQuery = await _ClassesRepository.GetQueryableAsync();
                    //await Console.Out.WriteLineAsync($"new:{clsQuery.LongCount()}");
                    var stuQuery = await _StudentRepository.GetQueryableAsync();
                    var count = stuQuery.LongCount();
                    for (int index = 1; index <= indexClass; index++)
                    {
                        var student = await _StudentRepository.InsertAsync(new Student(Guid.NewGuid())
                        {
                            Name = index.ToString(),
                            No = index
                        }, true);
                        await Task.Delay(TimeSpan.FromSeconds(1));
                        if (data != null && student != null)
                        {
                            await _ClassStudentRepository.InsertAsync(new ClassStudent(data.Id, student.Id), true);
                        }
                    }
                }

            }
            catch (Exception ex)
            {
                Console.WriteLine($"Error={ex.Message}");
            }
            return true;
        }

        private async Task CreateStudentAsync(Classes classes)
        {
            var stuQuery = await _StudentRepository.GetQueryableAsync();
            var count = stuQuery.LongCount() + 1;
            for (int index = 1; index <= count; index++)
            {
                var student = await _StudentRepository.InsertAsync(new Student(Guid.NewGuid())
                {
                    Name = index.ToString(),
                    No = index
                }, true);
                await Task.Delay(TimeSpan.FromSeconds(1));
                if (classes != null && student != null)
                {
                    await CreateClsStuAsync(classes, student);
                }
            }
        }

        private async Task CreateClsStuAsync(Classes classes, Student student)
        {
            await _ClassStudentRepository.InsertAsync(new ClassStudent(classes.Id, student.Id), true);
            await Task.Delay(TimeSpan.FromSeconds(1));

        }
    }
}

  • ABP Framework version: v7.2.2

  • UI Type: Blazor WASM

  • Database System: EF Core ( PostgreSQL.)

  • Tiered (for MVC) or Auth Server Separated (for Angular): yes

  • Exception message and full stack trace:

  • Steps to reproduce the issue:

    在 Microsoft.EntityFrameworkCore.DbContext.CheckDisposed() 在 Microsoft.EntityFrameworkCore.DbContext.get_ContextServices() 在 Microsoft.EntityFrameworkCore.DbContext.get_Model() 在 Microsoft.EntityFrameworkCore.Internal.InternalDbSet1.get_EntityType() 在 Microsoft.EntityFrameworkCore.Internal.InternalDbSet1.CheckState() 在 Microsoft.EntityFrameworkCore.Internal.InternalDbSet1.get_EntityQueryable() 在 Microsoft.EntityFrameworkCore.Internal.InternalDbSet1.System.Linq.IQueryable.get_Provider() 在 System.Linq.Queryable.FirstOrDefault[TSource](IQueryable1 source, Expression1 predicate) 在 OneAdmin.BaseManagement.StudentAppService.<<BatchCreateAsync>b__2_0>d.MoveNext() 在 D:\workspace\projects\OneAdmin\src\OneAdmin.Application\BaseManagement\StudentAppService.cs 中: 第 34 行

Error=Cannot access a disposed context instance. A common cause of this error is disposing a context instance that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are calling 'Dispose' on the context instance, or wrapping it in a using statement. If you are using dependency injection, you should let the dependency injection container take care of disposing context instances. Object name: 'OneAdminDbContext'.

 public class StudentAppService : ApplicationService, IStudentAppService
 {
     private readonly IRepository<Student, Guid> _StudentRepository;
     public StudentAppService(IRepository<Student, Guid> studentRepository)
     {
         _StudentRepository = studentRepository;
     }

     [UnitOfWork(false)]
     public async Task<bool> BatchCreateAsync()
     {
         await Task.Factory.StartNew(async () =>
         {
             try
             {
                 for (int index = 1; index <= 10; index++)
                 {
                     await _StudentRepository.InsertAsync(new Student(GuidGenerator.Create())
                     {
                         Name = index.ToString(),
                         No = index
                     }, true);
                     await Task.Delay(TimeSpan.FromSeconds(5));
                     var query = await _StudentRepository.GetQueryableAsync();
                     var data = query.FirstOrDefault(t => t.No == index);
                     Console.WriteLine($"Name={data.Name},No={data.No}");
                 }
             }
             catch (Exception ex)
             {
                 Console.WriteLine($"Error={ex.Message}");

             }
         });
         return true;
     }
 }

ABP Framework version: v7.2.2

  • ABP Framework version: v7.2.
  • UI Type: Maui
  • Database System: EF Core (PostgreSQL.)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue: maui use password mode to replace authorization code mode /connect/token accessToken unable to parse

File MauiCurrentPrincipalAccessor.cs

OK,I check all permissions and add all permissions for internationalization

inherit PermissionDefinitionProvider,define permission and localized text . i debug code,elapsed time for PermissionAppService.GetAsync . When there was less permission, there was no such problem. Because it is full load permissions and authorization, whether to consider caching, and loading progress.

thanks. AbpPermissions table has 1200 rows,There could be more AbpPermissionGroups table has 112 rows,There could be more

.GetPermissionListResultDto] GetAsync(System.String, System.String) on controller Volo.Abp.PermissionManagement.PermissionsController (Volo.Abp.PermissionManagement.HttpApi).
2023-12-15 05:53:47.957 +00:00 [INF] ===============Permission GetAsync===========================
2023-12-15 05:53:48.042 +00:00 [INF] =============== PermissionManager.GetAllAsync: 85============================
2023-12-15 05:53:48.968 +00:00 [INF] ===============Group Permission ,(12) :151===========================
2023-12-15 05:53:50.283 +00:00 [INF] ===============Group Permission ,(116) :1314===========================
2023-12-15 05:53:50.789 +00:00 [INF] ===============Group Permission ,(42) :493===========================
2023-12-15 05:53:50.862 +00:00 [INF] ===============Group Permission ,(5) :72===========================
2023-12-15 05:53:51.103 +00:00 [INF] ===============Group Permission ,(22) :241===========================
2023-12-15 05:53:51.128 +00:00 [INF] ===============Group Permission ,(1) :12===========================
2023-12-15 05:53:52.108 +00:00 [INF] ===============Group Permission ,(88) :979===========================
2023-12-15 05:53:52.917 +00:00 [INF] ===============Group Permission ,(73) :809===========================
2023-12-15 05:53:53.028 +00:00 [INF] ===============Group Permission ,(9) :111===========================
2023-12-15 05:53:53.367 +00:00 [INF] ===============Group Permission ,(29) :325===========================
2023-12-15 05:53:53.964 +00:00 [INF] ===============Group Permission ,(54) :597===========================
2023-12-15 05:53:54.796 +00:00 [INF] ===============Group Permission ,(73) :821===========================
2023-12-15 05:53:55.421 +00:00 [INF] ===============Group Permission ,(54) :625===========================
2023-12-15 05:53:56.046 +00:00 [INF] ===============Group Permission ,(54) :624===========================
2023-12-15 05:53:56.127 +00:00 [INF] ===============Group Permission ,(5) :67===========================
2023-12-15 05:53:56.621 +00:00 [INF] ===============Group Permission ,(42) :481===========================
2023-12-15 05:53:56.738 +00:00 [INF] ===============Group Permission ,(9) :116===========================
2023-12-15 05:53:57.080 +00:00 [INF] ===============Group Permission ,(29) :342===========================
2023-12-15 05:53:57.136 +00:00 [INF] ===============Group Permission ,(4) :55===========================
2023-12-15 05:53:57.202 +00:00 [INF] ===============Group Permission ,(5) :65===========================
2023-12-15 05:53:57.271 +00:00 [INF] ===============Group Permission ,(5) :68===========================
2023-12-15 05:53:57.330 +00:00 [INF] ===============Group Permission ,(4) :58===========================
2023-12-15 05:53:57.399 +00:00 [INF] ===============Group Permission ,(5) :69===========================
2023-12-15 05:53:57.506 +00:00 [INF] ===============Group Permission ,(8) :106===========================
2023-12-15 05:53:57.574 +00:00 [INF] ===============Group Permission ,(5) :67===========================
2023-12-15 05:53:58.064 +00:00 [INF] ===============Group Permission ,(44) :489===========================
2023-12-15 05:53:58.138 +00:00 [INF] ===============Group Permission ,(6) :74===========================
2023-12-15 05:53:58.260 +00:00 [INF] ===============Group Permission ,(10) :122===========================
2023-12-15 05:53:58.412 +00:00 [INF] ===============Group Permission ,(12) :151===========================
2023-12-15 05:53:58.536 +00:00 [INF] ===============Group Permission ,(10) :124===========================
2023-12-15 05:53:58.590 +00:00 [INF] ===============Group Permission ,(4) :54===========================
2023-12-15 05:53:58.690 +00:00 [INF] ===============Group Permission ,(8) :99===========================
2023-12-15 05:53:58.745 +00:00 [INF] ===============Group Permission ,(4) :55===========================
2023-12-15 05:53:58.884 +00:00 [INF] ===============Group Permission ,(12) :138===========================
2023-12-15 05:53:58.954 +00:00 [INF] ===============Group Permission ,t(5) :69===========================
2023-12-15 05:53:59.023 +00:00 [INF] ===============Group Permission ,(5) :68===========================
2023-12-15 05:53:59.117 +00:00 [INF] ===============Group Permission ,(8) :94===========================
2023-12-15 05:53:59.242 +00:00 [INF] ===============Group Permission ,(10) :124===========================
2023-12-15 05:53:59.307 +00:00 [INF] ===============Group Permission ,(5) :65===========================
2023-12-15 05:53:59.375 +00:00 [INF] ===============Group Permission ,(5) :67===========================
2023-12-15 05:53:59.867 +00:00 [INF] ===============Group Permission ,(44) :491===========================
2023-12-15 05:53:59.941 +00:00 [INF] ===============Group Permission ,(6) :74===========================
2023-12-15 05:53:59.994 +00:00 [INF] ===============Group Permission ,(4) :52===========================
2023-12-15 05:54:00.081 +00:00 [INF] ===============Group Permission ,(7) :87===========================
2023-12-15 05:54:00.115 +00:00 [INF] ===============Group Permission ,(2) :33===========================
2023-12-15 05:54:00.169 +00:00 [INF] ===============Group Permission ,(4) :54===========================
2023-12-15 05:54:00.337 +00:00 [INF] ===============Group Permission ,(5) :69===========================
2023-12-15 05:54:00.487 +00:00 [INF] ===============Group Permission ,(12) :150===========================
2023-12-15 05:54:00.500 +00:00 [INF] ===============Group Permission ,(1) :13===========================
2023-12-15 05:54:00.803 +00:00 [INF] ===============Group Permission ,(5) :72===========================
2023-12-15 05:54:00.814 +00:00 [INF] ===============Permission GetAsync End ===========================
2023-12-15 05:54:00.815 +00:00 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.PermissionManagement.GetPermissionListResultDto'.
2023-12-15 05:54:00.827 +00:00 [INF] Executed action Volo.Abp.PermissionManagement.PermissionsController.GetAsync (Volo.Abp.PermissionManagement.HttpApi) in 12875.7759ms
2023-12-15 05:54:00.827 +00:00 [INF] Executed endpoint 'Volo.Abp.PermissionManagement.PermissionsController.GetAsync (Volo.Abp.PermissionManagement.HttpApi)'
2023-12-15 05:54:00.827 +00:00 [INF] Request finished HTTP/1.1 GET http://47.122.23.59:44367/api/permission-management/permissions?providerName=R&providerKey=user&api-version=1.0 - 0 - 200 - application/json;+charset=utf-8 12878.0336ms`

the questions is abp version 4.*, is solved ,and permission 60+ i use abp version 7.2.2 , but AbpPermissions table has 1200 + AbpPermissionGroups table has 112 + so it doesn't solve the problem

Zobrazených 1 až 10 z 20 záznamov
Made with ❤️ on ABP v8.2.0-preview Updated on marca 25, 2024, 15:11