target framework : .net 8.0 Volo version: 8.2.2 windows server 2022
hello,
i have a problem on deploying application to iis server.
On application publish we had some issues about redis connection. when i look redis its working (checking from console).
when i type from ubuntu console on wsl redis-cli ping PONG i get PONG answer. but application cannot connect to it.
2025-10-24 15:24:55.984 +03:00 [INF] Application is shutting down...
2025-10-24 15:35:38.457 +03:00 [INF] Starting MyBankStore.AuthServer.
2025-10-24 15:35:45.310 +03:00 [FTL] MyBankStore.AuthServer terminated unexpectedly!
Volo.Abp.AbpInitializationException: An error occurred during ConfigureServicesAsync phase of the module MyBankStore.MyBankStoreAuthServerModule, MyBankStore.AuthServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. See the inner exception for details.
---> 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.
at StackExchange.Redis.ConnectionMultiplexer.ConnectImpl(ConfigurationOptions configuration, TextWriter log, Nullable1 serverType, EndPointCollection endpoints) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 708 at StackExchange.Redis.ConnectionMultiplexer.Connect(ConfigurationOptions configuration, TextWriter log) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 673 at StackExchange.Redis.ConnectionMultiplexer.Connect(String configuration, TextWriter log) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 651 at MyBankStore.MyBankStoreAuthServerModule.ConfigureServices(ServiceConfigurationContext context) in C:\PROJELER\MyBankStore\src\MyBankStore.AuthServer\MyBankStoreAuthServerModule.cs:line 177 at Volo.Abp.Modularity.AbpModule.ConfigureServicesAsync(ServiceConfigurationContext context) at Volo.Abp.AbpApplicationBase.ConfigureServicesAsync() --- End of inner exception stack trace --- at Volo.Abp.AbpApplicationBase.ConfigureServicesAsync() at Volo.Abp.AbpApplicationFactory.CreateAsync[TStartupModule](IServiceCollection services, Action1 optionsAction)
at Microsoft.Extensions.DependencyInjection.ServiceCollectionApplicationExtensions.AddApplicationAsync[TStartupModule](IServiceCollection services, Action1 optionsAction) at Microsoft.Extensions.DependencyInjection.WebApplicationBuilderExtensions.AddApplicationAsync[TStartupModule](WebApplicationBuilder builder, Action1 optionsAction)
at MyBankStore.Program.Main(String[] args) in C:\PROJELER\MyBankStore\src\MyBankStore.AuthServer\Program.cs:line 36
thanks..
6 Answer(s)
-
0
Ensure your Redis server is accessible from Windows Server 2022 where IIS is running. The fact that
redis-cli pingworks in WSL/Ubuntu does not guarantee that the Windows environment (where your IIS app pool runs) can reach Redis. By default, Redis on WSL or Linux binds to127.0.0.1(localhost), which is not accessible from Windows unless you configure it to listen on all interfaces.Update your Redis configuration (
/etc/redis/redis.confor equivalent) to bind to0.0.0.0and setprotected-mode no(for testing only; use proper security in production). Restart Redis after changes.In your ABP app's
appsettings.json, set the Redis connection string to the correct host and port. If Redis is running on WSL, use the WSL IP address (find it withip addrin Ubuntu) or uselocalhostif you have configured port forwarding.Example:
"Redis": { "Configuration": "localhost:6379" }- If you are using a password, include it:
"Redis": { "Configuration": "localhost:6379,password=yourpassword" }- If you want the app to keep retrying on connection failure, add
abortConnect=falseto the connection string:
"Redis": { "Configuration": "localhost:6379,abortConnect=false" }Make sure the Windows firewall allows outbound connections to the Redis port (default 6379).
If you are using Docker for Redis, ensure the container port is mapped to the host and accessible from Windows.
After updating the configuration, restart your IIS application.
For ABP 8.x, the recommended configuration key is
Redis:Configuration. You do not need to manually configure StackExchange.Redis in code; ABP will use the configuration automatically.For troubleshooting, try connecting to Redis from Windows using a tool like
redis-cli.exefor Windows or a .NET console app using the same connection string.
Sources:
- Universal Redis Configuration for ABP Applications with .NET Aspire Support
- Password required Redis with ABP Framework and Docker
- ABP Framework Redis Integration
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
-
0
hi
Can you confirm your Redis connection string is correct? Does your Redis server need a password?
You can check your
appsettings.jsonfile.Thanks
-
0
Hi,
auth project application.json file
"Redis": { "Configuration": "127.0.0.1" }i installed redis insight on windows server machine. wsl linux (ubuntu) is on.
Try Workbench, our advanced CLI. Check out our Quick Guides to learn more about Redis capabilities. Connecting... Pinging Redis server on 127.0.0.1:6379 Connected. Ready to execute commands. > ping "PONG" > ping "PONG" > ------------------------------------- we wait approximately 10 Seconds ------------------------------------- > > ping "Could not connect to 127.0.0.1:6379, please check the connection details." -
0
hi
Can you try to set
AbortOnConnectFailtofalse?Please update your
MyBankStoreAuthServerModulefileChange
var connection = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!);tovar connection = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!, options => options.AbortOnConnectFail = false);Also
PostConfigure<RedisCacheOptions>public override void ConfigureServices(ServiceConfigurationContext context) { PostConfigure<RedisCacheOptions>(options => { options.ConfigurationOptions ??= new ConfigurationOptions(); options.ConfigurationOptions.AbortOnConnectFail = false; }); }Thanks.
-
0
Hi still getting same errors after redis restart.
> ping "PONG" > ping "PONG" > ping "PONG" > ping "Could not connect to 127.0.0.1:6379, please check the connection details." > ping "Could not connect to 127.0.0.1:6379, please check the connection details." > ping "Could not connect to 127.0.0.1:6379, please check the connection details." > ping "Could not connect to 127.0.0.1:6379, please check the connection details."added >>>
PostConfigure<RedisCacheOptions>(options => { options.ConfigurationOptions ??= new ConfigurationOptions(); options.ConfigurationOptions.AbortOnConnectFail = false; });changed >>>
context.Services.AddSingleton<IDistributedLockProvider>(sp => { //var connection = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!); var connection = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!, options => options.AbortOnConnectFail = false); return new RedisDistributedSynchronizationProvider(connection.GetDatabase()); }); -
0
- Solution
Root cause is networking, not ABP. Your IIS worker (Windows process) is trying to connect to 127.0.0.1:6379 on Windows, but your Redis is running inside WSL. That loopback is not always reachable from Windows, and WSL can recycle/change connectivity. That’s why RedisInsight shows PONG, then later “Could not connect…”.
Fix options (pick one):
- Preferred: Run Redis natively on Windows or in Docker with a host port binding, then point ABP to that host:port. Example appsettings: { "Redis": { "Configuration": "localhost:6379,abortConnect=false" } }
- Or, expose the WSL Redis to Windows:
- In WSL redis.conf: bind 0.0.0.0 and set a password; if needed, protected-mode no (only temporarily for testing). Restart Redis.
- Find WSL IP from Windows: wsl.exe -d Ubuntu ip -4 addr show eth0 (or use wsl hostname -I). Use that IP in appsettings instead of 127.0.0.1: { "Redis": { "Configuration": "WSL_IP:6379,abortConnect=false,password=yourpassword" } }
- Ensure Windows Firewall allows outbound 6379 to that IP.
- Note: WSL IP can change after restart; prefer fixed host (Docker or Windows service) for production.
Remove custom ConnectionMultiplexer.Connect code and let ABP wire Redis via configuration. In ABP 8.x, using Volo.Abp.Caching.StackExchangeRedis, setting Redis:Configuration is enough for distributed cache and distributed locks. If you need a distributed lock provider, use the same options and reuse the IConnectionMultiplexer singleton instead of creating a new one. Example module: using Microsoft.Extensions.Caching.StackExchangeRedis; using StackExchange.Redis; using Medallion.Threading.Redis;
[DependsOn(typeof(Volo.Abp.Caching.StackExchangeRedis.AbpCachingStackExchangeRedisModule))] public class MyBankStoreAuthServerModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { PostConfigure<RedisCacheOptions>(options => { options.ConfigurationOptions ??= ConfigurationOptions.Parse(context.Services.GetConfiguration()["Redis:Configuration"]); options.ConfigurationOptions.AbortOnConnectFail = false; });
context.Services.AddSingleton<IConnectionMultiplexer>(sp => { var cfg = sp.GetRequiredService<IConfiguration>()["Redis:Configuration"]; var opts = ConfigurationOptions.Parse(cfg); opts.AbortOnConnectFail = false; return ConnectionMultiplexer.Connect(opts); }); context.Services.AddSingleton<IDistributedLockProvider>(sp => { var mux = sp.GetRequiredService<IConnectionMultiplexer>(); return new RedisDistributedSynchronizationProvider(mux.GetDatabase()); }); }}
If your Redis requires SSL (e.g., Azure), include ssl=True and the password: "Redis": { "Configuration": "mycache.redis.cache.windows.net:6380,password=KEY,ssl=True,abortConnect=false" }
Quick health checks from Windows (not WSL):
- Test TCP: PowerShell: Test-NetConnection -ComputerName <host> -Port 6379
- Use a Windows redis-cli or a .NET console app with the same connection string as your IIS app.
Why AbortOnConnectFail=false didn’t help: It only makes the multiplexer keep retrying; it won’t fix an unreachable endpoint. You must point to a reachable host:port from the IIS worker process.
- Sources
- ABP Redis integration and configuration:
- https://abp.io/docs/latest/framework/fundamentals/redis-cache
- Community article with unified Redis configuration patterns (includes Redis:Configuration usage and abortConnect guidance):
- https://abp.io/community/articles/qp90c7u4
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.