abp icon indicating copy to clipboard operation
abp copied to clipboard

Redis bug when creating separate Identity Server

Open DenverSearle opened this issue 6 years ago • 5 comments

ABP Framework version: v3.3 User Interface: Angular

  • Exception message and stack trace: 2020-11-10 17:08:34.362 +02:00 [INF] Hosting environment: Development 2020-11-10 17:08:34.362 +02:00 [INF] Content root path: C:\abp\test\aspnet-core\src\Test.IdentityServer 2020-11-10 17:08:34.630 +02:00 [INF] Request starting HTTP/2.0 GET https://localhost:44372/
    2020-11-10 17:08:34.955 +02:00 [WRN] Value cannot be null. (Parameter 'configuration') System.ArgumentNullException: Value cannot be null. (Parameter 'configuration') at StackExchange.Redis.ConnectionMultiplexer.PrepareConfig(Object configuration) in C:\projects\stackexchange-redis\src\StackExchange.Redis\ConnectionMultiplexer.cs:line 850 at StackExchange.Redis.ConnectionMultiplexer.CreateMultiplexer(Object configuration, TextWriter log, EventHandler1& connectHandler) in C:\projects\stackexchange-redis\src\StackExchange.Redis\ConnectionMultiplexer.cs:line 868 at StackExchange.Redis.ConnectionMultiplexer.ConnectImplAsync(Object configuration, TextWriter log) in C:\projects\stackexchange-redis\src\StackExchange.Redis\ConnectionMultiplexer.cs:line 818 at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.ConnectAsync(CancellationToken token) at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAndRefreshAsync(String key, Boolean getData, CancellationToken token) at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAsync(String key, CancellationToken token) at Volo.Abp.Caching.DistributedCache2.GetAsync(TCacheKey key, Nullable1 hideErrors, Boolean considerUow, CancellationToken token) 2020-11-10 17:08:37.259 +02:00 [WRN] Value cannot be null. (Parameter 'configuration') System.ArgumentNullException: Value cannot be null. (Parameter 'configuration') at StackExchange.Redis.ConnectionMultiplexer.PrepareConfig(Object configuration) in C:\projects\stackexchange-redis\src\StackExchange.Redis\ConnectionMultiplexer.cs:line 850 at StackExchange.Redis.ConnectionMultiplexer.CreateMultiplexer(Object configuration, TextWriter log, EventHandler1& connectHandler) in C:\projects\stackexchange-redis\src\StackExchange.Redis\ConnectionMultiplexer.cs:line 868 at StackExchange.Redis.ConnectionMultiplexer.ConnectImplAsync(Object configuration, TextWriter log) in C:\projects\stackexchange-redis\src\StackExchange.Redis\ConnectionMultiplexer.cs:line 818 at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.ConnectAsync(CancellationToken token) at Volo.Abp.Caching.StackExchangeRedis.AbpRedisCache.SetManyAsync(IEnumerable1 items, DistributedCacheEntryOptions options, CancellationToken token) at Volo.Abp.Caching.DistributedCache2.<>c__DisplayClass52_0.<g__SetRealCache|0>d.MoveNext() 2020-11-10 17:08:37.273 +02:00 [WRN] Value cannot be null. (Parameter 'configuration') System.ArgumentNullException: Value cannot be null. (Parameter 'configuration') at StackExchange.Redis.ConnectionMultiplexer.PrepareConfig(Object configuration) in C:\projects\stackexchange-redis\src\StackExchange.Redis\ConnectionMultiplexer.cs:line 850 at StackExchange.Redis.ConnectionMultiplexer.CreateMultiplexer(Object configuration, TextWriter log, EventHandler1& connectHandler) in C:\projects\stackexchange-redis\src\StackExchange.Redis\ConnectionMultiplexer.cs:line 868 at StackExchange.Redis.ConnectionMultiplexer.ConnectImplAsync(Object configuration, TextWriter log) in C:\projects\stackexchange-redis\src\StackExchange.Redis\ConnectionMultiplexer.cs:line 818 at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.ConnectAsync(CancellationToken token) at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAndRefreshAsync(String key, Boolean getData, CancellationToken token) at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAsync(String key, CancellationToken token) at Volo.Abp.Caching.DistributedCache2.GetAsync(TCacheKey key, Nullable1 hideErrors, Boolean considerUow, CancellationToken token) 2020-11-10 17:08:37.329 +02:00 [WRN] Value cannot be null. (Parameter 'configuration') System.ArgumentNullException: Value cannot be null. (Parameter 'configuration') at StackExchange.Redis.ConnectionMultiplexer.PrepareConfig(Object configuration) in C:\projects\stackexchange-redis\src\StackExchange.Redis\ConnectionMultiplexer.cs:line 850 at StackExchange.Redis.ConnectionMultiplexer.CreateMultiplexer(Object configuration, TextWriter log, EventHandler1& connectHandler) in C:\projects\stackexchange-redis\src\StackExchange.Redis\ConnectionMultiplexer.cs:line 868 at StackExchange.Redis.ConnectionMultiplexer.ConnectImplAsync(Object configuration, TextWriter log) in C:\projects\stackexchange-redis\src\StackExchange.Redis\ConnectionMultiplexer.cs:line 818 at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.ConnectAsync(CancellationToken token) at Volo.Abp.Caching.StackExchangeRedis.AbpRedisCache.SetManyAsync(IEnumerable1 items, DistributedCacheEntryOptions options, CancellationToken token) at Volo.Abp.Caching.DistributedCache2.<>c__DisplayClass52_0.<g__SetRealCache|0>d.MoveNext()

  • Steps needed to reproduce the problem.

  1. Create new abp app via CLI or Website (https://abp.io/get-started) - angular | ef core | separate identity server
  2. Specify the option to create a "Separate Identity Server"
  3. Open the solution file in VS and run the API.Host & Identity Server projects
  4. Check the Log files for both the API and Identity Server (see above stack trace for details)

To fix this problem I had to remove the "Redis" appsettings.json config section in both the API.Host and the Identity Server Project: "Redis": { "Configuration": "127.0.0.1" },

Once I removed that the solution then worked fine.

Closing: Thanks once again for an AMAZING framework ;)

DenverSearle avatar Nov 12 '20 09:11 DenverSearle

hi

Can you try to read the Redis:Configuration in your web module?

https://github.com/abpframework/abp/blob/rel-3.3/framework/src/Volo.Abp.Caching.StackExchangeRedis/Volo/Abp/Caching/StackExchangeRedis/AbpCachingStackExchangeRedisModule.cs#L23

maliming avatar Nov 12 '20 10:11 maliming

Without the "Redis" config setting: An unhandled exception occurred while processing the request. ArgumentNullException: Value cannot be null. (Parameter 'configuration') StackExchange.Redis.ConnectionMultiplexer.PrepareConfig(object configuration) in ConnectionMultiplexer.cs, line 850

With the "Redis" config section: An unhandled exception occurred while processing the request. RedisConnectionException: It was not possible to connect to the redis server(s). UnableToConnect on 127.0.0.1:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 16s ago, v: 2.0.593.37019

NB: I did mention the fix above: To fix this problem I had to remove the "Redis" appsettings.json config section in both the API.Host and the Identity Server Project: "Redis": { "Configuration": "127.0.0.1" },

Once I removed that the solution then worked fine.

DenverSearle avatar Nov 13 '20 08:11 DenverSearle

It was not possible to connect to the redis server(s). UnableToConnect on 127.0.0.1:6379

Is there a Redis server on your computer?

maliming avatar Nov 13 '20 11:11 maliming

No, I don't have Redis on my computer. I only needed to use the Api and Identity Server templates, why must I have Redis for that?

DenverSearle avatar Nov 13 '20 19:11 DenverSearle

See https://github.com/abpframework/abp/issues/5023

maliming avatar Nov 14 '20 02:11 maliming