Base solution for your next web application
Open Closed

Redis setup error #12396


User avatar
0
uenlkr4e created

Hi,
I tried enabling the Redis server for caching but I keep getting the following error.

Castle.MicroKernel.ComponentActivator.ComponentActivatorException: ComponentActivator: could not instantiate Abp.Runtime.Caching.Redis.AbpRedisCache
---> StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s). Error connecting right now. To allow this multiplexer to continue retrying until it's able to connect, use abortConnect=false in your connection string or AbortOnConnectFail=false; in your code.

I followed the instructions in documentation and un-commented the following section in my web core module:

Configuration.Caching.UseRedis(options =>
            {
                options.ConnectionString = _appConfiguration["Abp:RedisCache:ConnectionString"];
                options.DatabaseId = _appConfiguration.GetValue("Abp:RedisCache:DatabaseId");
            });

and in my appsettings.json i have the following config:

"Abp": {
    "RedisCache": {
      "ConnectionString": "rediss://default:myPasswordHere@quiet-mako-61290.upstash.io:6379",
      "DatabaseId": 0
    }

Am i missing something?
thank you


4 Answer(s)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi @uenlkr4e

    Can you make sure that the connection string format is correct? Are you sure the correct protocol is 'rediss://' ? When I checked the Upstash documentation, I found a usage of 'redis://'. If the issue persists after updating the protocol, could you please verify the correctness of the password and the specified endpoint?

  • User Avatar
    0
    uenlkr4e created

    Hi,
    I tried it with redis, and rediss and all combinations.
    the connection string is right from the upstash dashboard, i didnt create it myself.

    and i tried it with another service provider (aiven), but got the same error.
    i can connect both providers using a db client.

    thanks

  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi @uenlkr4e

    It appears that your connection string is incorrectly configured. If you define it as indicated in the code snippet below, the issue should be resolved.

    "Abp": {
      "RedisCache": {
        "ConnectionString": "your-subdomain.upstash.io:6379,password=your-password,ssl=True",
        "DatabaseId": -1
      }
    },
    
  • User Avatar
    0
    uenlkr4e created

    this worked, thank you.