Hi,
As can be seen in this screenshot. We deployed v13.4.0 today after upgrading from v13.1.0 and have noticed a significant increase in Redis server usage.
Is there something new in v13.4.0 that could explain the difference to v13.1.0. Is there something we should be looking at optimising.
We have a massive spike at deployment time which was around 1pm in the graph. We managed to get that stablised but are still seeing quite a lot more usage of Reids that we previously did.
Thanks Rick
Hi,
We run in a load balanced environment for our app servers in production. PeriodicBackgroundWorkers don't appear to play nicely in this environment.
As they are in memory scheduled jobs they clash with each other quite often.
For example we get this error in our production logs a lot. We also re-wrote the ExpiredAuditLogDeleterWorker to be a hangfirejob.
Is there any recommendation or plans on how we can easily remove/convert these background jobs into hangfire jobs which will only run on one server and not have concurrency issues like most of the non hangfire run periodic workers do?
Thanks Rick
2024-05-15T08:35:27.585+10:00 - (null) - (null) - b1c4f22152a4 - Abp.Authorization.Users.UserTokenExpirationWorker2[[XXXX.MultiTenancy.Tenant, XXXX.Core, Version=13.1.0.1574, Culture=neutral, PublicKeyToken=null],[XXXX.Authorization.Users.User, XXXX.Core, Version=13.1.0.1574, Culture=neutral, PublicKeyToken=null]] - Abp.Domain.Uow.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. ---> 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. at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ThrowAggregateUpdateConcurrencyException(RelationalDataReader reader, Int32 commandIndex, Int32 expectedRowsAffected, Int32 rowsAffected) at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.Consume(RelationalDataReader reader) at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection) at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(IEnumerable
1 commandBatches, IRelationalConnection connection) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(IList1 entriesToSave) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(StateManager stateManager, Boolean acceptAllChangesOnSuccess) at Pomelo.EntityFrameworkCore.MySql.Storage.Internal.MySqlExecutionStrategy.Execute[TState,TResult](TState state, Func
3 operation, Func3 verifySucceeded) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(Boolean acceptAllChangesOnSuccess) at Microsoft.EntityFrameworkCore.DbContext.SaveChanges(Boolean acceptAllChangesOnSuccess) at Abp.EntityFrameworkCore.AbpDbContext.SaveChanges() --- End of inner exception stack trace --- at Abp.EntityFrameworkCore.AbpDbContext.SaveChanges() at Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.SaveChanges() at Abp.Domain.Uow.UnitOfWorkBase.Complete() at Abp.Authorization.Users.UserTokenExpirationWorker
2.DoWork() at Abp.Threading.BackgroundWorkers.PeriodicBackgroundWorkerBase.Timer_Elapsed(Object sender, EventArgs e)
Abp.Domain.Uow.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.
---> 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.
at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ThrowAggregateUpdateConcurrencyException(RelationalDataReader reader, Int32 commandIndex, Int32 expectedRowsAffected, Int32 rowsAffected)
at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.Consume(RelationalDataReader reader)
at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(IEnumerable1 commandBatches, IRelationalConnection connection) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(IList
1 entriesToSave)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(StateManager stateManager, Boolean acceptAllChangesOnSuccess)
at Pomelo.EntityFrameworkCore.MySql.Storage.Internal.MySqlExecutionStrategy.Execute[TState,TResult](TState state, Func3 operation, Func
3 verifySucceeded)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(Boolean acceptAllChangesOnSuccess)
at Microsoft.EntityFrameworkCore.DbContext.SaveChanges(Boolean acceptAllChangesOnSuccess)
at Abp.EntityFrameworkCore.AbpDbContext.SaveChanges()
--- End of inner exception stack trace ---
at Abp.EntityFrameworkCore.AbpDbContext.SaveChanges()
at Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.SaveChanges()
at Abp.Domain.Uow.UnitOfWorkBase.Complete()
at Abp.Authorization.Users.UserTokenExpirationWorker`2.DoWork()
at Abp.Threading.BackgroundWorkers.PeriodicBackgroundWorkerBase.Timer_Elapsed(Object sender, EventArgs e)
Hi,
HOWEVER the feature is enabled in the DB and in Redis itself. It's just that when you get that feature back from redis it won't be set to true for some reason.
We've tried debugging the aspnetboilerplate to find where this goes wrong and we couldn't narrow it down.
Thanks Rick
Hi,
We are on v13.1.0. Angular front end, .net core backend (separate projects).
We cut and paste the html from this page, into a simple component. https://preview.keenthemes.com/html/metronic/docs/base/cards#collapsible
The collapsing section doesn't work. It looks to be something to do with how the new Metronic uses bootstrap cards and bootstrap collapse.js
I can't figure out how this should work and be initialized etc. I notice plugins.bundles.js is never included which seems to include bootstrap so not sure if that is the problem.
I also notice that KTApp.init() is never called any more (it used be called by app.js in a DomContentLoaded but that is now gone), so not sure if that is the issue either.
Are you able to help with what is going on and why they don't work.
Thanks Rick
Hi All,
I'm going to document notes of frustration here on the upgrade from v12 to v13.
First thing is the change from Newtonsoft to System.Text.Json is massive and one to be very aware of.
Issue List
Oh boy where to start on this one. If you are storing json in the DB at all you're going to have a lot of fun. System.Text.Json doesn't use camelCase by default and our Json was all camelCase. That's easy enough to work around you can just use the JsonExtensions.CreateJsonSerializerOptions and pass in the correct parameters when you are using FromJsonString etc.
Next thing to note however is that CreateJsonSerializationOptions adds in a bunch of AbpConvertors. One of them doesn't play nicely with nullable objects. Eg: We have a nullable int. We want to also use the numberhandling options to allow for numbers to be strings. ~~ Except this doesn't work when you have a nullable int because the AbpConvertor takes over and doesn't respect the numberhandling options or attributes.~~
Ok the attribute doesn't work but the options on the seralizer do. However you need to note that the serializer options are cached and once they are setup and used once they cannot ever be changed. We had to modify our startup.cs to create the JSON serialisation options with all combinations of camelcase and write intended. Set the number handling options we want there to ensure the options were cached with our correct settings from the start.
To handle that we have to manually remove that convertor from our options after creation and then it seems to work.
~~3) Scrollbars in modals seem to disappear when the modal loses focus. This is in particular to scrollbars which exist within the modal and not full pages scrollbars. We're still investigating this one.~~ This is not an issue and was our own fault.
Hi Support Team,
Do you have any ideas what could be causing this error. https://github.com/aspnetboilerplate/aspnetboilerplate/issues/6755
I have been developing alone for a while now with no problems on version 12.4.2.
Recently something has happened to my machine and now when I try and browser to the swagger page (or run nwswag) I get the same error as linked in that article.
I could try and upgrade to version 13 which I believe is the version in which that issue is fixed. But I have others on my team using the same code as me who don't have the issue.
My guess is something related to either a windows or .net patch or update but we haven't been able to isolate it yet.
Do you have any ideas what could be causing this issue all of a sudden for me?
Thanks Rick
We have a bunch of widgets defined for our tenant dashboard and most of them have permissionDependencies on them to control which of our tenants can see what widgets.
Our defaultTenantDashboard is configured to have all the tenant widgets available to them.
(All above setup in DashboardCustomisation.cs).
In the GetDefaultAngularTenantDashboardView() method we have setup the dashboard to include widgets that not all users will have access to. The permissions control which ones actually get displayed.
Now if a tenant tries to "Back to Default" or delete the last page on their dashboard. They will get an error if they do not have access to a particular widget that is defined in the GetDefaultAngularTenantDashboardView.
The error comes from the DashboardCustomisationAppService and in the SaveDashboardSettingForUser() method, which has been passed the GetDefaultDashboardValue from the DeletePage method.
In this case the dashboard that is passed into this method already has widgets on it that the user is not authorized to see and thus the check around allWidgetsOfDashboard.Any etc fails and we throw the UnknownWidgetId error.
Essentially because our DefaultAngularDashboard includes widgets that not all users will see in it and it is filtered out elsewhere we fail.
Could this please be looked into.
Thanks Rick
Hi,
Could I request a feature/method of adding a permission that doesn't automatically get added to the admin role.
I have a scenario where I have 2 or 3 permissions that are for very specialist functions that no roles should have by default.
Every other permission I want the admin role to get by default. I would love for there to be a way for me to add an attribute or something to the CreateChildPermission call that allows me to say this permission should not be given to anyone by default, including static roles that actually want all permissions by default.
Thanks Rick
Hi,
It looks as though a combination of ngx-bootstrap tooltips and raw bootstrap tooltips are being used and I'm unsure which ones we should use.
Eg: Roles and tenant settings pages use the raw bootstrap tooltips and other pages (tenant features, widgets and others) use the ngx-bootstrap.
Furthermore the ones that use the raw bootstrap ones (or at least the metronic wrapper around it). Use a strange syntax of data-toggle="tooltip" instead of data-bs-toggle="tooltip"
Further to this none of the other standard options for the bootstrap tooltip and the ones documented on the metronic site don't work either. https://preview.keenthemes.com/html/metronic/docs/base/tooltips#delay-options
Eg:
I add data-bs-delay-hide="1000" to the roles.component.html tooltip and it doesn't work. I tried with data-delay-hide as well. No good.
I also see a lot of default things being set in the metronic theme that don't get applied such as all of the following styles in the style.bundle.css
/* rtl:end:ignore */ .tooltip-inner { max-width: var(--bs-tooltip-max-width); padding: var(--bs-tooltip-padding-y) var(--bs-tooltip-padding-x); color: var(--bs-tooltip-color); text-align: center; background-color: var(--bs-tooltip-bg); border-radius: var(--bs-tooltip-border-radius); }
In particular I'm trying to configure the max-width. I've tried it using the bootstrap options to add my own custom css class (as per above doesn't work).
-bs-tooltip-max-width is set to 200px by default but if I change the title of the roles.component.html tooltip to a really long string it doesn't adhere to the max width.
Some magic appears to be going on that I couldn't find yet :)
Any tips on how we should be doing this consistently.
Thanks Rick
Application.Current.Quit is used in I think two places in the MAUI project.
However this doesn't actually work on IOS and does nothing. There is a suggested workaround here (however not necessarily recommended).
https://learn.microsoft.com/en-us/answers/questions/1142884/how-to-close-net-maui-app-on-ios
We're working around it for now but noticed it caused a strange behaviour issue that when you say no to a retry it behaves as if you clicked yes.