Starts in:
2 DAYS
17 HRS
43 MIN
22 SEC
Starts in:
2 D
17 H
43 M
22 S

Activities of "cangunaydin"

  • ABP Framework version: v8.1.4
  • UI Type: Angular
  • Database System: EF Core ( PostgreSQL.)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace: StackExchange.Redis.RedisCommandException: Multi-key operations must involve a single slot; keys can use 'hash tags' to help this, i.e. '{/users/12345}/account' and '{/users/12345}/contacts' will always be in the same slot at StackExchange.Redis.ConnectionMultiplexer.PrepareToPushMessageToBridge[T](Message message, ResultProcessor1 processor, IResultBox1 resultBox, ServerEndPoint& server) in //src/StackExchange.Redis/ConnectionMultiplexer.cs:line 1966at StackExchange.Redis.ConnectionMultiplexer.TryPushMessageToBridgeAsync[T](Message message, ResultProcessor1 processor, IResultBox1 resultBox, ServerEndPoint& server) in //src/StackExchange.Redis/ConnectionMultiplexer.cs:line 2004 at StackExchange.Redis.ConnectionMultiplexer.ExecuteAsyncImpl[T](Message message, ResultProcessor1 processor, Object state, ServerEndPoint server) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 2182 at StackExchange.Redis.RedisBase.ExecuteAsync[T](Message message, ResultProcessor1 processor, ServerEndPoint server) in //src/StackExchange.Redis/RedisBase.cs:line 54at StackExchange.Redis.RedisDatabase.KeyDeleteAsync(RedisKey[] keys, CommandFlags flags) in //src/StackExchange.Redis/RedisDatabase.cs:line 769 at Volo.Abp.Caching.StackExchangeRedis.AbpRedisCache.RemoveManyAsync(IEnumerable1 keys, CancellationToken token) at Volo.Abp.Caching.DistributedCache2.<&gt;c__DisplayClass63_0.<g__RemoveRealCache|0&gt;d.MoveNext()
  • Steps to reproduce the issue: Create a redis cluster by using helm bitnami chart inside kubernetes environment. Give the redis connection string to your abp app to use this redis-cluster for distributed cache. Then try to change the database connection string and save. Then switch back to shared database. You will get the above error.

The Problem i am facing is related with redis cache. If you use Redis Cluster instead of single instance of redis, you are facing an issue that some values are remaining in redis cache or they are not the same with the values in db. This brings the unstable behavior in the application. To give an example. 1- Change Database Connection Strings for a tenant. 2- Then try to login with that tenant, it will use the new connection string. 3- Afterwards try to revert it back to shared database. 4- You will get the error and it is not going to delete it from redis cache. 5- Even in database it is using the shared database, it will still use the connection string, since it stayed in cache in that way.

ps: it can be also vice versa( from redis cache it is gonna come an empty connection strings while in db there are connection strings). So the point is cache not becoming stable with database.

/// <summary>
    /// Apply pending EF Core schema migrations to the database.
    /// Returns true if any migration has applied.
    /// </summary>
    protected virtual async Task<bool> MigrateDatabaseSchemaAsync(Guid? tenantId)
    {
        var result = false;
        Logger.LogError($"MigrateDatabaseSchemaAsync tenantId: {tenantId}");
        using (CurrentTenant.Change(tenantId))
        {
            using (var uow = UnitOfWorkManager.Begin(requiresNew: true, isTransactional: false))
            {
                async Task<bool> MigrateDatabaseSchemaWithDbContextAsync()
                {
                    var dbContext = await uow.ServiceProvider
                        .GetRequiredService<IDbContextProvider<TDbContext>>()
                        .GetDbContextAsync();

                    if ((await dbContext.Database.GetPendingMigrationsAsync()).Any())
                    {
                        await dbContext.Database.MigrateAsync();
                        Logger.LogError($"Migrated Database for tenant: {tenantId}");
                        return true;
                    }

                    return false;
                }
                Logger.LogError($"Starting migration for {tenantId}");
                if (tenantId == null)
                {
                    //Migrating the host database
                    Logger.LogInformation($"Migrating database of host. Database Name = {DatabaseName}");
                    Logger.LogError($"Migrating database of host. Database Name = {DatabaseName}");
                    result = await MigrateDatabaseSchemaWithDbContextAsync();
                }
                else
                {
                    var tenantConfiguration = await TenantStore.FindAsync(tenantId.Value);
                    Logger.LogError("Tenant Configuration: "+tenantConfiguration?.Name);
                    Logger.LogError("Connection string values: " + (tenantConfiguration?.ConnectionStrings?.Values != null ? string.Join(", ", tenantConfiguration.ConnectionStrings.Values) : "null"));
                    Logger.LogError($"Connections strings is null: {tenantConfiguration?.ConnectionStrings != null}");
                    Logger.LogError($"tenantConfiguration.ConnectionStrings.Default is null or whitespace: {tenantConfiguration?.ConnectionStrings?.Default.IsNullOrWhiteSpace()}");
                    Logger.LogError($"tenantConfiguration.ConnectionStrings.GetOrDefault is null or whitespace: {tenantConfiguration?.ConnectionStrings?.GetOrDefault(DatabaseName).IsNullOrWhiteSpace()}");
                    if (tenantConfiguration != null
                        && tenantConfiguration.ConnectionStrings != null
                        && (!tenantConfiguration.ConnectionStrings.Default.IsNullOrWhiteSpace() || !tenantConfiguration.ConnectionStrings.GetOrDefault(DatabaseName).IsNullOrWhiteSpace()))
                    {
                        //Migrating the tenant database (only if tenant has a separate database)
                        Logger.LogInformation($"Migrating separate database of tenant. Database Name = {DatabaseName}, TenantId = {tenantId}");
                        Logger.LogError($"Migrating separate database of tenant. Database Name = {DatabaseName}, TenantId = {tenantId}");
                        result = await MigrateDatabaseSchemaWithDbContextAsync();
                        Logger.LogError($"Migrated separate database of tenant. Database Name = {DatabaseName}, TenantId = {tenantId}");
                        Logger.LogError("Connection string values: " + (tenantConfiguration?.ConnectionStrings?.Values != null ? string.Join(", ", tenantConfiguration.ConnectionStrings.Values) : "null"));
                    }
                }

                await uow.CompleteAsync();
            }
        }

        return result;
    }

The tenant configuration here

var tenantConfiguration = await TenantStore.FindAsync(tenantId.Value);

is giving me an empty connection strings time to time even if connection strings are defined in my database. I fix this by changing it to a single instance of redis cache, but it could be nice to use redis-cluster for performance. if you want to try, you can use helm chart that is provided by bitnami from this link. https://github.com/bitnami/charts/tree/main/bitnami/redis-cluster

what i mean is intercepting the service. i just want to connect to the cluster and intercept the service so i can attach my debugger to the remote aks cluster. Do you need to deploy your app through Abp Studio for it? or can you do that with manual deployment? https://abp.io/docs/latest/studio/kubernetes#intercept-a-service

Utilizing ABP Studio's interception feature, you have the flexibility to run the entire solution in a Kubernetes cluster while running only a single (or a few) services on your local machine using your IDE. This approach allows you to concentrate on running, testing, and debugging your service without concerning yourself with the configuration and launch details of the rest of the system.

  • ABP Framework version: v8.1.4
  • UI Type: Angular
  • Database System: EF Core (PostgreSQL with pgbouncer)
  • Auth Server Separated (for Angular): yes

Hello. I didn't switch to abp studio. I still use abp cli for my app. But my application is deployed on Kubernetes Cluster on azure. I have some manifest files to deploy the application. What i wonder is, If i use abp studio, can i debug my app remotely from my local machine. Even if i do not use the helm charts that abp studio is produced? So i want to deploy my app as usual but use abp studio to debug it. Is it possible to do sth like that?

Hello, i think the functionality is very simple. I want to control the left menu programmatically from the angular code. I have checked the source code. NavbarService is the service that is used internally to control the menu for leptonx theme as i understand. That's why i tried that code to make what i want.

NavBarService is defined in lepton-x core package.

Anyway, so if we come to the main point, is there a way to change the highlighted menu item. And if there is none, since i need the functionality how can i do that? I believe there should be a way to do that. At least i should be able to replace or override a function or service so i can achieve what i want. Cause the functionality is there when i add it through route providers. When i navigate to route it already highlights that menu item.

Nothing over here? No reply?

Hello again, Thank you for the reply. I understand how i can tweak it. But i have some questions cause still i didn't understand the reasons.

It must be working right for the main project since then all configs are based on that project apart from the extra application that you have added.

I didn't understand this part. angular-extra project is using the same server side, and have the same configuration and same nuget packages. How it is different from the angular project? What is it different as configuration wise? Cause registerlocale function is coming from '@volo/abp.ng.language-management/locale'; for both projects? and it has been configuration in app.module.

 CoreModule.forRoot({
      environment,
      registerLocaleFn: registerLocale(),
    }),

Hello again, I understand but shouldn't leptonx theme do this in the background? Cause it works on main angular project without any configuration. en-GB is sth already registered on the server side. When you get the languages from the server side, according to me it should find the localization file and shouldn't throw the error. I don't think you should do the default configuration again. For some reason @angular/common/locales are not loaded in the angular-extra project. I want to know why it is not loaded in angular-extra project but loaded in the angular project.

when you look at the image below you can see @angular/common/locales not exists in the resources.

I have prepared the sample app and sent it to the email address. you need to run postgres and redis inside docker container. To do that you can run the powershell file from aspnet-core/etc/docker/run-docker-sideapps.ps1 path.

what i want to achieve, you can see it below. Also i write todo comment inside the project.

Hope this will be enough.

Hello Sumeyye, It took little bit of time, but i managed to create a sample and i have sent it to your email address. You need to run a docker container for postgres and redis to start the backend.

There is a folder angular-extra so you can run it after you start the backend and on your console you should see the error.

I think you totally understand this wrong. Without navigation, I want to achieve the same thing. You are navigating in your example.

Showing 11 to 20 of 124 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06