Activities of "jackmcelhinney"

Thanks, that resolved it. I had went ahead and upgraded to node v22 based on Angular 18's compatibility.

  • ABP Framework version: v8.3.2
  • UI Type: Angular
  • Database System: EF Core SQL Server
  • Tiered (for MVC) or Auth Server Separated (for Angular): no

Hello. After upgrading to 8.3.2 (also with 8.3.1), I get the following error in the routing module:

Error: src/app/app-routing.module.ts:190:29 - error TS2322: Type 'Promise<Type<any> | NgModuleFactory<...> | Routes | DefaultExport<Type<any>> | DefaultExport<Routes> | NgModuleFactory<...>>' is not assignable to type 'Type<any> | NgModuleFactory<any> | Routes | Observable<Type<any> | Routes | DefaultExport<Type<any>> | DefaultExport<Routes>> | Promise<...>'.
  Type 'Promise<Type<any> | NgModuleFactory<...> | Routes | DefaultExport<Type<any>> | DefaultExport<Routes> | NgModuleFactory<...>>' is not assignable to type 'Promise<Type<any> | NgModuleFactory<any> | Routes | DefaultExport<Type<any>> | DefaultExport<Routes>>'.
    Type 'Type<any> | NgModuleFactory<...> | Routes | DefaultExport<Type<any>> | DefaultExport<Routes> | NgModuleFactory<...>' is not assignable to type 'Type<any> | NgModuleFactory<any> | Routes | DefaultExport<Type<any>> | DefaultExport<Routes>'.
      Type 'NgModuleFactory<AccountPublicModule>' is not assignable to type 'Type<any> | NgModuleFactory<any> | Routes | DefaultExport<Type<any>> | DefaultExport<Routes>'.
        Type 'NgModuleFactory<AccountPublicModule>' is not assignable to type 'NgModuleFactory<any>'.
          The types of 'create(...).componentFactoryResolver.resolveComponentFactory(...).inputs' are incompatible between these types.
            Type '{ propName: string; templateName: string; transform?: (value: any) => any; }[]' is not assignable to type '{ propName: string; templateName: string; transform?: (value: any) => any; isSignal: boolean; }[]'.
              Property 'isSignal' is missing in type '{ propName: string; templateName: string; transform?: (value: any) => any; }' but required in type '{ propName: string; templateName: string; transform?: (value: any) => any; isSignal: boolean; }'.

190         loadChildren: () => import('@volo/abp.ng.account/public').then(m => m.AccountPublicModule.forLazy())
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/@angular/core/index.d.ts:1859:9
    1859         isSignal: boolean;
                 ~~~~~~~~
    'isSignal' is declared here.
  node_modules/@angular/router/index.d.ts:1372:44
    1372 export declare type LoadChildrenCallback = () => Type<any> | NgModuleFactory<any> | Routes | Observable<Type<any> | Routes | DefaultExport<Type<any>> | DefaultExport<Routes>> | Promise<NgModuleFactory<any> | Type<any> | Routes | DefaultExport<Type<any>> | DefaultExport<Routes>>;
                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The expected type comes from the return type of this signature.

The module is imported in my routing module the same as the startup template:

{
    path: 'account',
    loadChildren: () => import('@volo/abp.ng.account/public').then(m => m.AccountPublicModule.forLazy())
},

Using Angular ~18.1.0.

"dependencies": {
    "@abp/ng.components": "8.3.2",
    "@abp/ng.core": "8.3.2",
    "@abp/ng.oauth": "8.3.2",
    "@abp/ng.setting-management": "8.3.2",
    "@abp/ng.theme.shared": "8.3.2",
    "@angular/animations": "~18.1.0",
    "@angular/common": "~18.1.0",
    "@angular/compiler": "~18.1.0",
    "@angular/core": "~18.1.0",
    "@angular/forms": "~18.1.0",
    "@angular/localize": "~18.1.0",
    "@angular/platform-browser": "~18.1.0",
    "@angular/platform-browser-dynamic": "~18.1.0",
    "@angular/router": "~18.1.0",
    ...
    "@volo/abp.commercial.ng.ui": "8.3.2",
    "@volo/abp.ng.account": "8.3.2",
    "@volo/abp.ng.audit-logging": "8.3.2",
    "@volo/abp.ng.gdpr": "8.3.2",
    "@volo/abp.ng.identity": "8.3.2",
    "@volo/abp.ng.language-management": "8.3.2",
    "@volo/abp.ng.openiddictpro": "8.3.2",
    "@volo/abp.ng.saas": "8.3.2",
    "@volo/abp.ng.text-template-management": "8.3.2",
    "@volosoft/abp.ng.theme.lepton-x": "3.3.1",
    ...
    "rxjs": "7.8.1",
    "tslib": "~2.8.0",
    "zone.js": "~0.14.10"
},
"devDependencies": {
    "@abp/ng.schematics": "8.3.2",
    "@angular-devkit/build-angular": "~18.1.0",
    "@angular-eslint/builder": "~18.1.0",
    "@angular-eslint/eslint-plugin": "~18.1.0",
    "@angular-eslint/eslint-plugin-template": "~18.1.0",
    "@angular-eslint/schematics": "~18.1.0",
    "@angular-eslint/template-parser": "~18.1.0",
    "@angular/cli": "~18.1.0",
    "@angular/compiler-cli": "~18.1.0",
    "@angular/language-service": "~18.1.0",
    "@types/node": "~20.16.14",
    "@typescript-eslint/eslint-plugin": "~8.9.0",
    "@typescript-eslint/parser": "~8.9.0",
    ...
    "ng-packagr": "~18.1.0",
    "ngxs-schematic": "^1.1.9",
    "protractor": "^7.0.0",
    "ts-node": "~10.9.2",
    "tslint": "^6.1.3",
    "typescript": "~5.5.4"
}

I have tried, deleting yarn.lock/node_modules but no luck. Any ideas?

Thanks

  • ABP Framework version: v8.3.1
  • UI Type: Angular
  • Database System: EF Core, SQL Server
  • Tiered (for MVC) or Auth Server Separated (for Angular): no

Hello, the migration guide and startup template show that 8.3.1 has upgraded Angular to version 18, but it seems like there are some dependencies that have not been upgraded to the Angular 18 version.

  • @abp/ng.theme.shared uses @ng-bootstrap/ng-bootstrap~16.0.0 where 17.x.x is required for Angular 18.
  • @abp/ng.components uses ng-zorro-antd^17.0.0 which I believe should be ^18.0.0 for Angular 18

Output from yarn check:

yarn check v1.22.19
warning "@angular-devkit/build-angular#@angular/build#postcss@^8.4.0" could be deduped from "8.4.47" to "postcss@8.4.47"
error "@abp/ng.theme.shared#@ng-bootstrap/ng-bootstrap#@angular/common@^17.0.0" doesn't satisfy found match of "@angular/common@18.1.5"
error "@abp/ng.theme.shared#@ng-bootstrap/ng-bootstrap#@angular/core@^17.0.0" doesn't satisfy found match of "@angular/core@18.1.5"
error "@abp/ng.theme.shared#@ng-bootstrap/ng-bootstrap#@angular/forms@^17.0.0" doesn't satisfy found match of "@angular/forms@18.1.5"
error "@abp/ng.theme.shared#@ng-bootstrap/ng-bootstrap#@angular/localize@^17.0.0" doesn't satisfy found match of "@angular/localize@18.1.5"
error "@volo/abp.ng.account#angularx-qrcode#@angular/core@^17.0.0" doesn't satisfy found match of "@angular/core@18.1.5"
warning "@angular-devkit/build-angular#autoprefixer#postcss@^8.1.0" could be deduped from "8.4.47" to "postcss@8.4.47"
error "@abp/ng.components#ng-zorro-antd#@angular/animations@^17.0.0" doesn't satisfy found match of "@angular/animations@18.1.5"
error "@abp/ng.components#ng-zorro-antd#@angular/common@^17.0.0" doesn't satisfy found match of "@angular/common@18.1.5"
error "@abp/ng.components#ng-zorro-antd#@angular/forms@^17.0.0" doesn't satisfy found match of "@angular/forms@18.1.5"
error "@abp/ng.components#ng-zorro-antd#@angular/core@^17.0.0" doesn't satisfy found match of "@angular/core@18.1.5"
error "@abp/ng.components#ng-zorro-antd#@angular/platform-browser@^17.0.0" doesn't satisfy found match of "@angular/platform-browser@18.1.5"
error "@abp/ng.components#ng-zorro-antd#@angular/router@^17.0.0" doesn't satisfy found match of "@angular/router@18.1.5"
warning "@angular-devkit/build-angular#postcss-loader#postcss@^7.0.0 || ^8.0.1" could be deduped from "8.4.47" to "postcss@8.4.47"
error "ng-zorro-antd#@ant-design/icons-angular#@angular/common@^17.0.1" doesn't satisfy found match of "@angular/common@18.1.5"
error "ng-zorro-antd#@ant-design/icons-angular#@angular/core@^17.0.1" doesn't satisfy found match of "@angular/core@18.1.5"
error "ng-zorro-antd#@ant-design/icons-angular#@angular/platform-browser@^17.0.1" doesn't satisfy found match of "@angular/platform-browser@18.1.5"

Though my project runs fine locally, I am assuming these mismatches are the cause of these errors in my build pipeline.

./src/main.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: Cannot resolve type entity i9.NgbNavModule to symbol

./src/polyfills.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: Cannot resolve type entity i9.NgbNavModule to symbol

Error: node_modules/@abp/ng.components/extensible/lib/components/date-time-picker/extensible-date-time-picker.component.d.ts:2:51 - error TS2307: Cannot find module '@ng-bootstrap/ng-bootstrap' or its corresponding type declarations.

2 import { NgbInputDatepicker, NgbTimepicker } from '@ng-bootstrap/ng-bootstrap';

...

Error: Can't resolve 'node_modules/ng-zorro-antd/tree/style/index.min.css' in '/home/vsts/work/1/s'

package.json

...
"dependencies": {
    "@abp/ng.components": "8.3.1",
    "@abp/ng.core": "8.3.1",
    "@abp/ng.oauth": "8.3.1",
    "@abp/ng.setting-management": "8.3.1",
    "@abp/ng.theme.shared": "8.3.1",
    "@angular/animations": "~18.1.0",
    "@angular/common": "~18.1.0",
    "@angular/compiler": "~18.1.0",
    "@angular/core": "~18.1.0",
    "@angular/forms": "~18.1.0",
    "@angular/localize": "~18.1.0",
    "@angular/platform-browser": "~18.1.0",
    "@angular/platform-browser-dynamic": "~18.1.0",
    "@angular/router": "~18.1.0",
...
"devDependencies": {
    "@abp/ng.schematics": "8.3.1",
    "@angular-devkit/build-angular": "~18.1.0",
    "@angular-eslint/builder": "~18.1.0",
    "@angular-eslint/eslint-plugin": "~18.1.0",
    "@angular-eslint/eslint-plugin-template": "~18.1.0",
    "@angular-eslint/schematics": "~18.1.0",
    "@angular-eslint/template-parser": "~18.1.0",
    "@angular/cli": "~18.1.0",
    "@angular/compiler-cli": "~18.1.0",
    "@angular/language-service": "~18.1.0",
    ...
    "ng-packagr": "~18.1.0",
    "ngxs-schematic": "^1.1.9",
    "protractor": "^7.0.0",
    "ts-node": "~10.9.2",
    "tslint": "^6.1.3",
    "typescript": "~5.5.4"
...

I have tried deleting yarn.lock and node_modules, and re-running yarn to be sure, but it seems these dependencies have not been updated. Please let me know if I am missing something.

Thanks, Jack

Hello,

I believe the issue is related to the subdomain tenant resolver, but I'm having trouble getting a local project running with subdomains so can't provide exact steps to reproduce. It seems the tenant is not set when OnGetAsync is called. Another solution to the issue is disabling the tenant filter on the verify token step:

public override async Task<IActionResult> OnGetAsync()
{
    var localLoginResult = await CheckLocalLoginAsync();
    if (localLoginResult != null)
    {
        LocalLoginDisabled = true;
        return localLoginResult;
    }

    ValidateModel();
    using (_dataFilter.Disable<IMultiTenant>())
    {
        InvalidToken = !await AccountAppService.VerifyPasswordResetTokenAsync(
        new VerifyPasswordResetTokenInput
        {
            UserId = UserId,
            ResetToken = ResetToken
        }
        );
    }

    SetNormalizeReturnUrl();
    return Page();
}

Also, the VerifyPasswordResetTokenAsync and VerifyEmailConfirmationTokenAsync methods in AccountAppService are not marked as virtual so cannot be overridden.

Let me know if you have any ideas on how the tenant is not set on the OnGetAsync but is set when the reset password form is submitted.

  • ABP Framework version: v7.0.3
  • UI type: Angular
  • DB provider: EF Core
  • Identity Server Separated (Angular): no

Hello,

After upgrading to 7.0.3, users receive an error after clicking the link to reset their password. The error does not happen when running locally, only when deployed to our site which uses the subdomain tenant resolver. The error seems to be caused by this addition to the OnGetAsync() in the ResetPasswordModel:

ValidateModel();
InvalidToken = !await AccountAppService.VerifyPasswordResetTokenAsync(
    new VerifyPasswordResetTokenInput
    {
        UserId = UserId,
        ResetToken = ResetToken
    }
);

If I override and remove this block, the reset password seems to work correctly. The affected code does not seem to change in 7.1 or 7.2. The logs are below. Please let me know if you are able to reproduce the issue or know what may be causing this.

Thanks!

Volo.Abp.Domain.Entities.EntityNotFoundException: There is no such an entity. Entity type: Volo.Abp.Identity.IdentityUser, id: d02816ad-c3fc-1220-bd00-39f94be54514     at Volo.Abp.Identity.IdentityUserManager.GetByIdAsync(Guid id)     at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)     at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()     at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)     at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)     at Volo.Abp.Account.AccountAppService.VerifyPasswordResetTokenAsync(VerifyPasswordResetTokenInput input)     at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)     at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()     at Volo.Abp.GlobalFeatures.GlobalFeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation)     at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)     at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)     at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()     at Volo.Abp.Authorization.AuthorizationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)     at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)     at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)     at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()     at Volo.Abp.Auditing.AuditingInterceptor.ProceedByLoggingAsync(IAbpMethodInvocation invocation, AbpAuditingOptions options, IAuditingHelper auditingHelper, IAuditLogScope auditLogScope)     at Volo.Abp.Auditing.AuditingInterceptor.InterceptAsync(IAbpMethodInvocation invocation)     at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)     at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)     at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()     at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)     at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)     at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)     at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()     at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)     at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)     at Volo.Abp.Account.Public.Web.Pages.Account.ResetPasswordModel.OnGetAsync()     at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Convert[T](Object taskAsObject)     at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Execute(Object receiver, Object[] arguments)     at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync()     at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync()     at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Rethrow(PageHandlerExecutedContext context)     at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)     at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeInnerFilterAsync()     at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)     at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ExceptionContextSealed context)     at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)     at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)     at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)     at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)     at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)     at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)     at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)     at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)     at Volo.Abp.AspNetCore.Serilog.AbpSerilogMiddleware.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.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)     at Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.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.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)     at Microsoft.AspNetCore.Builder.ApplicationBuilderAbpOpenIddictMiddlewareExtension.<>c__DisplayClass0_0.<<UseAbpOpenIddictValidation>b__0>d.MoveNext()  --- End of stack trace from previous location ---     at Volo.Abp.AspNetCore.Uow.AbpUnitOfWorkMiddleware.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.ExceptionHandling.AbpExceptionHandlingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)     at Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingMiddleware.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.MultiTenancy.MultiTenancyMiddleware.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.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)     at Company.WebPlatform.WebPlatformHttpApiHostModule.<>c__DisplayClass18_0.<<OnApplicationInitialization>b__1>d.MoveNext() in D:\a\1\s\src\Company.WebPlatform.HttpApi.Host\WebPlatformHttpApiHostModule.cs:line 668  --- End of stack trace from previous location ---     at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|8_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)

Thanks @maliming that worked. This section of the docs may need to be updated to use Configure instead of PreConfigure:

https://docs.abp.io/en/abp/latest/Modules/OpenIddict#automatically-removing-orphaned-tokens-authorizations

  • ABP Framework version: v6.0.2
  • UI type: Angular
  • DB provider: EF Core
  • Identity Server Separated (Angular): no

After updating to OpenIddict, we want to adjust the token lifetimes and pruning behavior. We successfully changed the lifetimes with PreConfigure<OpenIddictServerBuilder> in the Host module, but PreConfigure<TokenCleanupOptions> is not working.

Host module:

public override void PreConfigureServices(ServiceConfigurationContext context)
{
    ...
    PreConfigure<OpenIddictServerBuilder>(builder =>
    {
        ...
        builder.SetRefreshTokenLifetime(TimeSpan.FromMinutes(15)); // Test lifetime
    });
    
    PreConfigure<TokenCleanupOptions>(options =>
    {
        options.CleanupPeriod = 60000;
        options.MinimumAuthorizationLifespan = TimeSpan.FromMinutes(15);
        options.MinimumTokenLifespan = TimeSpan.FromMinutes(15);
    });
    ...
}

With these values, the refresh token lifetime is set to 15 minutes, but the pruning job still runs once an hour and does not use the new minimum lifespans. Is this a bug or is something wrong with this configuration?

Thanks!

Possibly related to this? https://github.com/abpframework/abp/issues/4272

I don't think this is related to user requests cancelling, because this happens consistently every few hours even in the test project running locally with no user interaction and the API idling.

I now believe there is an impact on users when this happens, as I was on our site and got a service unavailable error for a few seconds at the same time these errors were logged. The errors are always in SettingManagement so it seems like there's an issue in that module handling cancellation or cache refreshes.

  • ABP Framework version: v5.3.3
  • UI type: Angular
  • DB provider: EF Core
  • Identity Server Separated (Angular): no

After configuring our project to use the Redis Cache, we are getting occasional errors (once or twice a day) logged in the background. Based on the traces, it appears this may be happening in the SettingManagement module after the cache tries to refresh.

Usually 1 warning and 3 errors get logged at the same time:

Warning: The operation was canceled. Exception:

System.OperationCanceledException: The operation was canceled.     at System.Threading.CancellationToken.ThrowOperationCanceledException()     at Volo.Abp.Caching.StackExchangeRedis.AbpRedisCache.GetAndRefreshManyAsync(IEnumerable`1 keys, Boolean getData, CancellationToken token)     at Volo.Abp.Caching.StackExchangeRedis.AbpRedisCache.GetManyAsync(IEnumerable`1 keys, CancellationToken token)     at Volo.Abp.Caching.DistributedCache`2.GetManyAsync(IEnumerable`1 keys, Nullable`1 hideErrors, Boolean considerUow, CancellationToken token)

Properties:

&lt;properties&gt;&lt;property key=&#39;SourceContext&#39;&gt;Volo.Abp.Caching.DistributedCache&lt;/property&gt;&lt;property key=&#39;ActionId&#39;&gt;15fe26d2-905e-451e-956e-9273e2ee2f29&lt;/property&gt;&lt;property key=&#39;ActionName&#39;&gt;Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationScriptController.Get (Volo.Abp.AspNetCore.Mvc)&lt;/property&gt;&lt;property key=&#39;RequestId&#39;&gt;0HMJE86AB1IHV:00000063&lt;/property&gt;&lt;property key=&#39;RequestPath&#39;&gt;/Abp/ApplicationConfigurationScript&lt;/property&gt;&lt;property key=&#39;ConnectionId&#39;&gt;0HMJE86AB1IHV&lt;/property&gt;&lt;property key=&#39;CorrelationId&#39;&gt;50d2b898ed494793b23a9d6d5f6f5da3&lt;/property&gt;&lt;/properties&gt;

Error: An error occurred using the connection to database '{database}' on server '{server}'. Exception: NULL Properties:

&lt;properties&gt;&lt;property key=&#39;database&#39;&gt;test-web-db&lt;/property&gt;&lt;property key=&#39;server&#39;&gt;tcp:redis-test.database.windows.net,1433&lt;/property&gt;&lt;property key=&#39;EventId&#39;&gt;&lt;structure type=&#39;&#39;&gt;&lt;property key=&#39;Id&#39;&gt;20004&lt;/property&gt;&lt;property key=&#39;Name&#39;&gt;Microsoft.EntityFrameworkCore.Database.Connection.ConnectionError&lt;/property&gt;&lt;/structure&gt;&lt;/property&gt;&lt;property key=&#39;SourceContext&#39;&gt;Microsoft.EntityFrameworkCore.Database.Connection&lt;/property&gt;&lt;property key=&#39;ActionId&#39;&gt;15fe26d2-905e-451e-956e-9273e2ee2f29&lt;/property&gt;&lt;property key=&#39;ActionName&#39;&gt;Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationScriptController.Get (Volo.Abp.AspNetCore.Mvc)&lt;/property&gt;&lt;property key=&#39;RequestId&#39;&gt;0HMJE86AB1IHV:00000063&lt;/property&gt;&lt;property key=&#39;RequestPath&#39;&gt;/Abp/ApplicationConfigurationScript&lt;/property&gt;&lt;property key=&#39;ConnectionId&#39;&gt;0HMJE86AB1IHV&lt;/property&gt;&lt;property key=&#39;CorrelationId&#39;&gt;50d2b898ed494793b23a9d6d5f6f5da3&lt;/property&gt;&lt;/properties&gt;

Error: An exception occurred while iterating over the results of a query for context type '{contextType}'.{newline}{error} Exception:

System.Threading.Tasks.TaskCanceledException: A task was canceled.     at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)     at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)     at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenAsync(CancellationToken cancellationToken, Boolean errorsExpected)     at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)     at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken)     at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)     at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()

Properties:

&lt;properties&gt;&lt;property key=&#39;contextType&#39;&gt;Volo.Abp.SettingManagement.EntityFrameworkCore.SettingManagementDbContext&lt;/property&gt;&lt;property key=&#39;newline&#39;&gt;  &lt;/property&gt;&lt;property key=&#39;error&#39;&gt;System.Threading.Tasks.TaskCanceledException: A task was canceled.     at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)     at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)     at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenAsync(CancellationToken cancellationToken, Boolean errorsExpected)     at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)     at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken)     at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)     at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()&lt;/property&gt;&lt;property key=&#39;EventId&#39;&gt;&lt;structure type=&#39;&#39;&gt;&lt;property key=&#39;Id&#39;&gt;10100&lt;/property&gt;&lt;property key=&#39;Name&#39;&gt;Microsoft.EntityFrameworkCore.Query.QueryIterationFailed&lt;/property&gt;&lt;/structure&gt;&lt;/property&gt;&lt;property key=&#39;SourceContext&#39;&gt;Microsoft.EntityFrameworkCore.Query&lt;/property&gt;&lt;property key=&#39;ActionId&#39;&gt;15fe26d2-905e-451e-956e-9273e2ee2f29&lt;/property&gt;&lt;property key=&#39;ActionName&#39;&gt;Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationScriptController.Get (Volo.Abp.AspNetCore.Mvc)&lt;/property&gt;&lt;property key=&#39;RequestId&#39;&gt;0HMJE86AB1IHV:00000063&lt;/property&gt;&lt;property key=&#39;RequestPath&#39;&gt;/Abp/ApplicationConfigurationScript&lt;/property&gt;&lt;property key=&#39;ConnectionId&#39;&gt;0HMJE86AB1IHV&lt;/property&gt;&lt;property key=&#39;CorrelationId&#39;&gt;50d2b898ed494793b23a9d6d5f6f5da3&lt;/property&gt;&lt;/properties&gt;

Error: An unhandled exception has occurred while executing the request. Exception:

System.Threading.Tasks.TaskCanceledException: A task was canceled.     at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)     at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)     at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenAsync(CancellationToken cancellationToken, Boolean errorsExpected)     at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)     at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken)     at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)     at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()     at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)     at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)     at Volo.Abp.SettingManagement.EntityFrameworkCore.EfCoreSettingRepository.GetListAsync(String[] names, String providerName, String providerKey, CancellationToken cancellationToken)     at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)     at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()     at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)     at ...

Properties:

<properties><property key='EventId'><structure type=''><property key='Id'>1</property><property key='Name'>UnhandledException</property></structure></property><property key='SourceContext'>Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware</property><property key='RequestId'>0HMJE86AB1IHV:00000063</property><property key='RequestPath'>/Abp/ApplicationConfigurationScript</property><property key='ConnectionId'>0HMJE86AB1IHV</property></properties>

I am able to reproduce this issue in a fresh project:

  • Create new project
  • Update appsettings
  • Update Application module to configure caching
[DependsOn(
    ...
    typeof(AbpCachingModule),
    typeof(AbpCachingStackExchangeRedisModule)
)]

...

Configure<AbpDistributedCacheOptions>(options =>
{
    //options.KeyPrefix = configuration["Redis:KeyPrefix"];
});
  • Optionally log to db table

Domain object:

public class Log : Entity<int>
{
    public string Message { get; set; }
    public string MessageTemplate { get; set; }
    public string Level { get; set; }
    public DateTime? Timestamp { get; set; }
    public string Exception { get; set; }
    public string Properties { get; set; }
}

DbContext:

public DbSet<Log> Logs { get; set; }
...
builder.Entity<Log>(b =>
{
    b.ToTable(RedisTestConsts.DbTablePrefix + "Logs", RedisTestConsts.DbSchema);
    b.ConfigureByConvention();

    b.Property(x => x.Message);
    b.Property(x => x.MessageTemplate);
    b.Property(x => x.Level);
    b.Property(x => x.Timestamp);
    b.Property(x => x.Exception);
    b.Property(x => x.Properties);
});

Program.cs

...
builder.Host
    .AddAppSettingsSecretsJson()
    .UseAutofac()
    .UseSerilog(
    (hostingContext, services, loggerConfiguration) => loggerConfiguration

        .MinimumLevel.Debug()

        .MinimumLevel.Override("Microsoft", LogEventLevel.Information)
        .Enrich.FromLogContext()

        .WriteTo.Async(c => c.File("Logs/logs.txt"))


        .AuditTo.MSSqlServer(
            connectionString: hostingContext.Configuration["ConnectionStrings:Default"],
            sinkOptions: new MSSqlServerSinkOptions()
            {
                TableName = "AppLogs"
            },
            restrictedToMinimumLevel: LogEventLevel.Warning)
    );
...
  • Run the app, log in, and click around to get everything cached.
  • Leave the API project running and eventually these errors will be logged.

Other information:

  • DB: Azure SQL Server Database
  • Redis Cache: Azure Cache for Redis - Standard 250 MB

I'm not sure if there is impact on the user when this happens, but we have alerting on errors so we would like to resolve these even if there is no user impact. Please let me know if you have any ideas or need more information.

Showing 1 to 10 of 42 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 01, 2024, 05:35