Open Closed

Unable to connect to to redis server #4594


User avatar
0
agawdat@vlenseg.com created

I am using the microservice template and I am unable to connect to redis, which is running properly in docker image and I can connect to it and ping from CLI. When running the auth server with the default configuration "localhost:6379" I get the "It was not possible to connect to the redis server(s)" exception. I tried all the solutions mentioned in the support forum and in StackExchange.Redis and nothing works. I changed the configuration to "localhost:6379,abortConnect=false,connectTimeout=30000,responseTimeout=30000" and then I get "SocketException: An existing connection was forcibly closed by the remote host" exception

Please I need urgent help here as this is a blocking issue and I can't get the solution running at all while I followed all the steps perfectly, so purchasing it makes no sense while it can't even run as is with all the defaults without changing a line of code.

Exception with default configuration:

SocketException: An existing connection was forcibly closed by the remote host. Pipelines.Sockets.Unofficial.Internal.Throw.Socket(int errorCode) in Throw.cs, line 59

ConnectionResetException: An existing connection was forcibly closed by the remote host. System.IO.Pipelines.Pipe.GetReadResult(out ReadResult result)

RedisConnectionException: SocketFailure (ReadSocketError/ConnectionReset, 0-read, last-recv: 0) on localhost:6379/Interactive, Flushed/Faulted, last: ECHO, origin: ReadFromPipe, outstanding: 8, last-read: 0s ago, last-write: 0s ago, keep-alive: 60s, state: ConnectedEstablishing, mgr: 9 of 10 available, last-heartbeat: never, global: 1s ago, v: 2.2.4.27433 StackExchange.Redis.TaskExtensions.TimeoutAfter(Task task, int timeoutMs) in TaskExtensions.cs, line 48

RedisConnectionException: No connection is active/available to service this operation: LRANGE Kyc-Protection-Keys; An existing connection was forcibly closed by the remote host., mc: 1/1/0, mgr: 10 of 10 available, clientName: DESKTOP-BN90G5M, IOCP: (Busy=0,Free=1000,Min=1,Max=1000), WORKER: (Busy=2,Free=32765,Min=8,Max=32767), v: 2.2.4.27433 StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl<T>(Message message, ResultProcessor<T> processor, ServerEndPoint server) in ConnectionMultiplexer.cs, line 2798

CryptographicException: An error occurred while trying to encrypt the provided data. Refer to the inner exception for more information. For more information go to http://aka.ms/dataprotectionwarning Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.Protect(byte[] plaintext)

Exception with modified configuration:

[auth-server_a85ff5d8-2]: ---> StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s). [auth-server_a85ff5d8-2]: at StackExchange.Redis.ConnectionMultiplexer.ConnectImpl(ConfigurationOptions configuration, TextWriter log) in //src/StackExchange.Redis/ConnectionMultiplexer.cs:line 1163 [auth-server_a85ff5d8-2]: at StackExchange.Redis.ConnectionMultiplexer.Connect(ConfigurationOptions configuration, TextWriter log) in //src/StackExchange.Redis/ConnectionMultiplexer.cs:line 1032 [auth-server_a85ff5d8-2]: at StackExchange.Redis.ConnectionMultiplexer.Connect(String configuration, TextWriter log) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 1015 [auth-server_a85ff5d8-2]: at Vlens.Kyc.AuthServer.KycAuthServerModule.ConfigureServices(ServiceConfigurationContext context) in E:\Vlens\Vlens.Kyc\Code\apps\auth-server\src\Vlens.Kyc.AuthServer\KycAuthServerModule.cs:line 139 [auth-server_a85ff5d8-2]: at Volo.Abp.Modularity.AbpModule.ConfigureServicesAsync(ServiceConfigurationContext context) [auth-server_a85ff5d8-2]: at Volo.Abp.AbpApplicationBase.ConfigureServicesAsync()

  • ABP Framework version: v7.0.2
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes

4 Answer(s)
  • User Avatar
    0
    onurpicakci created

    Hi, I couldn't reproduce the same error, if you already have redis and rabbitmq installed in your docker images, can you clear their cache? If the same problem occurs again, can you delete the redis and rabbitmq images on docker and do a clean install following the document?

  • User Avatar
    0
    agawdat@vlenseg.com created

    I finally got it working, and guess what, the problem is in your documentation. I should run “run-tye.ps1” to run tye, while in the documentation there is no mention to this file, what it says to to run tye: "Use the command tye run under your main solution directory to run the solution." It is clear now that these are not the same as there are more to execute when running the script than just running tye run command.

    https://docs.abp.io/en/commercial/latest/startup-templates/microservice/tye-integration#running-tye

  • User Avatar
    0
    onurpicakci created

    I am glad the problem has been resolved. I am sorry for the ambiguity in the document. The necessary correction will be made.

  • User Avatar
    0
    agawdat@vlenseg.com created

    I see that the document is updated. Thank you, I will close the issue.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 05, 2024, 12:19