Just scaled down to 1 instance, but still got the error, so not related to load balanced env.
They are in web.stdout.log
Feel free to use both.
1st set of logs are from main server - 7.1.1 2nd set of logs are from identical copy of main server but on 8.2 - for test purposes, this is better, as it only has logs for the logins. and been using it for the past hour.
Sorry sent you wrong logs, sending again
Based on my experience, I think only load-balanced, as it was not happening on dev, which had 1 instance, getting this on our staging side which has a minimum of 4 instances at all times. But I will confirm this now, by scaling down to 1 instance.
Also emailing you logs at the moment.
hi
Thanks
We have changed the code in new version
https://github.com/abpframework/abp/issues/15530#issuecomment-1505182866 https://github.com/abpframework/abp/pull/16351
So sorry, I forgot to mention that I have migrated the project to 8.2 already. and this is currently on 8.2.
EDIT: I have updated my initial question to mention 8.2
Actually now that I see it I may not have overridden the methods correctly, since they are async
Actually it's happening a lot, and is breaking the login flow for oauth.
Any way to ignore it for now, this is quite urgent I have been trying to hijack the AbpOpenIddictTokenStore, but I don't think the service is being replaced.
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(IOpenIddictTokenStore<OpenIddictTokenModel>), typeof(AbpOpenIddictTokenStore))]
public class CustomAbpOpenIddictTokenStore : AbpOpenIddictTokenStore
{
private readonly HelperUtility _helperUtility;
public CustomAbpOpenIddictTokenStore(
HelperUtility helperUtility,
IOpenIddictTokenRepository repository,
IUnitOfWorkManager unitOfWorkManager,
IGuidGenerator guidGenerator,
IOpenIddictApplicationRepository applicationRepository,
IOpenIddictAuthorizationRepository authorizationRepository,
AbpOpenIddictIdentifierConverter identifierConverter,
IOpenIddictDbConcurrencyExceptionHandler concurrencyExceptionHandler,
IOptions<AbpOpenIddictStoreOptions> storeOptions)
: base(repository, unitOfWorkManager, guidGenerator, applicationRepository, authorizationRepository, identifierConverter, concurrencyExceptionHandler, storeOptions)
{
_helperUtility = helperUtility;
}
public override ValueTask DeleteAsync(OpenIddictTokenModel token, CancellationToken cancellationToken)
{
try
{
return base.DeleteAsync(token, cancellationToken);
}
catch (AbpDbConcurrencyException)
{
_ = _helperUtility.SendMsgToSlack("Caught abp Token ConcurrencyException");
return default;
}
catch (OpenIddictExceptions.ConcurrencyException)
{
_ = _helperUtility.SendMsgToSlack("Caught Token ConcurrencyException");
return default;
}
}
public override ValueTask UpdateAsync(OpenIddictTokenModel token, CancellationToken cancellationToken)
{
try
{
_ = _helperUtility.SendMsgToSlack("called update");
return base.UpdateAsync(token, cancellationToken);
}
catch (AbpDbConcurrencyException)
{
_ = _helperUtility.SendMsgToSlack("Caught abp Token ConcurrencyException");
return default;
}
catch (OpenIddictExceptions.ConcurrencyException)
{
_ = _helperUtility.SendMsgToSlack("Caught Token ConcurrencyException");
return default;
}
}
}
Getting an error for Concurrency Exception from AbpOpenIddictTokenStore, not sure what is happening, probably due to concurrency stamp, help is appreciated. It's happening after an OAUTH Login callback.
NOTE: running on load balanced environment.
Jul 18 01:47:06 ip-172-31-10-186 web: SELECT `o`.`Id`, `o`.`ApplicationId`, `o`.`AuthorizationId`, `o`.`ConcurrencyStamp`, `o`.`CreationDate`, `o`.`CreationTime`, `o`.`CreatorId`, `o`.`DeleterId`, `o`.`DeletionTime`, `o`.`ExpirationDate`, `o`.`ExtraProperties`, `o`.`IsDeleted`, `o`.`LastModificationTime`, `o`.`LastModifierId`, `o`.`Payload`, `o`.`Properties`, `o`.`RedemptionDate`, `o`.`ReferenceId`, `o`.`Status`, `o`.`Subject`, `o`.`Type`
Jul 18 01:47:06 ip-172-31-10-186 web: FROM `OpenIddictTokens` AS `o`
Jul 18 01:47:06 ip-172-31-10-186 web: WHERE (@__ef_filter__p_0 OR NOT (`o`.`IsDeleted`)) AND (`o`.`Id` = @__id_0)
Jul 18 01:47:06 ip-172-31-10-186 web: ORDER BY `o`.`Id`
Jul 18 01:47:06 ip-172-31-10-186 web: LIMIT 1
Jul 18 01:47:06 ip-172-31-10-186 web: 01:47:06 [INF] Executed DbCommand (16ms) [Parameters=[@p5='?' (DbType = Guid), @p0='?' (Size = 40), @p6='?' (Size = 40), @p1='?' (DbType = DateTime), @p2='?' (DbType = Guid), @p3='?' (Size = 4000), @p4='?' (Size = 100)], CommandType='Text', CommandTimeout='30']
Jul 18 01:47:06 ip-172-31-10-186 web: SET AUTOCOMMIT = 1;
Jul 18 01:47:06 ip-172-31-10-186 web: UPDATE `OpenIddictTokens` SET `ConcurrencyStamp` = @p0, `LastModificationTime` = @p1, `LastModifierId` = @p2, `Payload` = @p3, `ReferenceId` = @p4
Jul 18 01:47:06 ip-172-31-10-186 web: WHERE `Id` = @p5 AND `ConcurrencyStamp` = @p6;
Jul 18 01:47:06 ip-172-31-10-186 web: SELECT ROW_COUNT();
Jul 18 01:47:07 ip-172-31-10-186 web: 01:47:07 [WRN] There is an entry which is not saved due to concurrency exception:
Jul 18 01:47:07 ip-172-31-10-186 web: OpenIddictToken {Id: 3a13d5b2-5f8d-043f-eee2-1bf911ed7bac} Modified FK {ApplicationId: 3a13d507-855b-a008-1d8f-b2b5b6f05b1a} FK {AuthorizationId: 3a13d526-0d0d-ef2d-7bd5-21a0e3c43eda}
Jul 18 01:47:07 ip-172-31-10-186 web: 01:47:07 [ERR] The database operation was expected to affect 1 row(s), but actually affected 0 row(s); data may have been modified or deleted since entities were loaded. See https://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions.
Jul 18 01:47:07 ip-172-31-10-186 web: Volo.Abp.Data.AbpDbConcurrencyException: The database operation was expected to affect 1 row(s), but actually affected 0 row(s); data may have been modified or deleted since entities were loaded. See https://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions.
Jul 18 01:47:07 ip-172-31-10-186 web: ---> Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException: The database operation was expected to affect 1 row(s), but actually affected 0 row(s); data may have been modified or deleted since entities were loaded. See https://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions.
Jul 18 01:47:07 ip-172-31-10-186 web: at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ThrowAggregateUpdateConcurrencyExceptionAsync(RelationalDataReader reader, Int32 commandIndex, Int32 expectedRowsAffected, Int32 rowsAffected, CancellationToken cancellationToken)
Jul 18 01:47:07 ip-172-31-10-186 web: at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ConsumeResultSetWithRowsAffectedOnlyAsync(Int32 commandIndex, RelationalDataReader reader, CancellationToken cancellationToken)
Jul 18 01:47:07 ip-172-31-10-186 web: at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ConsumeAsync(RelationalDataReader reader, CancellationToken cancellationToken)
Jul 18 01:47:07 ip-172-31-10-186 web: at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
Jul 18 01:47:07 ip-172-31-10-186 web: at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
Jul 18 01:47:07 ip-172-31-10-186 web: at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)
Jul 18 01:47:07 ip-172-31-10-186 web: at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)
Jul 18 01:47:07 ip-172-31-10-186 web: at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)
Jul 18 01:47:07 ip-172-31-10-186 web: at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IList`1 entriesToSave, CancellationToken cancellationToken)
Jul 18 01:47:07 ip-172-31-10-186 web: at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(StateManager stateManager, Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
Jul 18 01:47:07 ip-172-31-10-186 web: at Pomelo.EntityFrameworkCore.MySql.Storage.Internal.MySqlExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
Jul 18 01:47:07 ip-172-31-10-186 web: at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
Jul 18 01:47:07 ip-172-31-10-186 web: at Volo.Abp.EntityFrameworkCore.AbpDbContext`1.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
Jul 18 01:47:07 ip-172-31-10-186 web: --- End of inner exception stack trace ---
Jul 18 01:47:07 ip-172-31-10-186 web: at Volo.Abp.EntityFrameworkCore.AbpDbContext`1.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
Jul 18 01:47:07 ip-172-31-10-186 web: at Volo.Abp.Domain.Repositories.EntityFrameworkCore.EfCoreRepository`2.UpdateAsync(TEntity entity, Boolean autoSave, CancellationToken cancellationToken)
Jul 18 01:47:07 ip-172-31-10-186 web: at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
Jul 18 01:47:07 ip-172-31-10-186 web: at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
Jul 18 01:47:07 ip-172-31-10-186 web: at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
Jul 18 01:47:07 ip-172-31-10-186 web: at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
Jul 18 01:47:07 ip-172-31-10-186 web: at Volo.Abp.OpenIddict.Tokens.AbpOpenIddictTokenStore.UpdateAsync(OpenIddictTokenModel token, CancellationToken cancellationToken)
Jul 18 01:47:07 ip-172-31-10-186 web: 01:47:07 [INF] Executed action Volo.Abp.OpenIddict.Controllers.AuthorizeController.HandleAsync (Volo.Abp.OpenIddict.AspNetCore) in 4617.1376ms
Jul 18 01:47:07 ip-172-31-10-186 web: 01:47:07 [INF] Executed endpoint 'Volo.Abp.OpenIddict.Controllers.AuthorizeController.HandleAsync (Volo.Abp.OpenIddict.AspNetCore)'
Any easy way to migrate to 8.1 on a big project? I've tried following docs, but end up being too many package inconsistencies.