marcoCasamento / Hangfire.Redis.StackExchange

HangFire Redis storage based on original (and now unsupported) Hangfire.Redis but using lovely StackExchange.Redis client
Other
460 stars 109 forks source link

Error: ERR unknown command `ECHO`, with args beginning with: `??)` #107

Closed JasonLiuLiuLiuLiu closed 3 years ago

JasonLiuLiuLiuLiu commented 3 years ago

Hi guys,

When i use this package of latest version 1.8.4 from nuget i have get following error.

Execution BackgroundServerProcess is in the Failed state now due to an exception, execution will be retried no more than in 00:00:15 StackExchange.Redis.RedisConnectionException: No connection is active/available to service this operation: EXEC; Error: ERR unknown command `ECHO`, with args beginning with: `??)`, , mc: 1/1/0, mgr: 10 of 10 available, clientName: JASON-MINI, IOCP: (Busy=0,Free=1000,Min=8,Max=1000), WORKER: (Busy=0,Free=32767,Min=8,Max=32767), v: 2.1.30.38891
 ---> System.AggregateException: One or more errors occurred. (ProtocolFailure (None, last-recv: 56) on ********/Subscription, Flushed/ComputeResult, last: SUBSCRIBE, origin: SetResult, outstanding: 1, last-read: 0s ago, last-write: 0s ago, keep-alive: 60s, state: ConnectedEstablishing, mgr: 4 of 10 available, last-heartbeat: never, global: 0s ago, v: 2.1.30.38891) (ProtocolFailure (None, last-recv: 56) on sentinel122.testzw.in:26320/Subscription, Flushed/ComputeResult, last: SUBSCRIBE, origin: SetResult, outstanding: 1, last-read: 0s ago, last-write: 0s ago, keep-alive: 60s, state: ConnectedEstablishing, mgr: 4 of 10 available, last-heartbeat: never, global: 0s ago, v: 2.1.30.38891) (ProtocolFailure (None, last-recv: 128) on sentinel123.testzw.in:26320/Subscription, Flushed/ComputeResult, last: SUBSCRIBE, origin: SetResult, outstanding: 1, last-read: 0s ago, last-write: 0s ago, keep-alive: 60s, state: ConnectedEstablishing, mgr: 4 of 10 available, last-heartbeat: never, global: 0s ago, v: 2.1.30.38891)
 ---> StackExchange.Redis.RedisConnectionException: ProtocolFailure (None, last-recv: 56) on ********/Subscription, Flushed/ComputeResult, last: SUBSCRIBE, origin: SetResult, outstanding: 1, last-read: 0s ago, last-write: 0s ago, keep-alive: 60s, state: ConnectedEstablishing, mgr: 4 of 10 available, last-heartbeat: never, global: 0s ago, v: 2.1.30.38891
 ---> StackExchange.Redis.RedisServerException: Error: ERR unknown command `ECHO`, with args beginning with: `??)`,
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
 ---> (Inner Exception #1) StackExchange.Redis.RedisConnectionException: ProtocolFailure (None, last-recv: 56) on sentinel122.testzw.in:26320/Subscription, Flushed/ComputeResult, last: SUBSCRIBE, origin: SetResult, outstanding: 1, last-read: 0s ago, last-write: 0s ago, keep-alive: 60s, state: ConnectedEstablishing, mgr: 4 of 10 available, last-heartbeat: never, global: 0s ago, v: 2.1.30.38891
 ---> StackExchange.Redis.RedisServerException: Error: ERR unknown command `ECHO`, with args beginning with: `??)`,
   --- End of inner exception stack trace ---<---

 ---> (Inner Exception #2) StackExchange.Redis.RedisConnectionException: ProtocolFailure (None, last-recv: 128) on sentinel123.testzw.in:26320/Subscription, Flushed/ComputeResult, last: SUBSCRIBE, origin: SetResult, outstanding: 1, last-read: 0s ago, last-write: 0s ago, keep-alive: 60s, state: ConnectedEstablishing, mgr: 4 of 10 available, last-heartbeat: never, global: 0s ago, v: 2.1.30.38891
 ---> StackExchange.Redis.RedisServerException: Error: ERR unknown command `ECHO`, with args beginning with: `??)`,
   --- End of inner exception stack trace ---<---

   --- End of inner exception stack trace ---
   at StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl[T](Message message, ResultProcessor`1 processor, ServerEndPoint server) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 2605
   at StackExchange.Redis.RedisBase.ExecuteSync[T](Message message, ResultProcessor`1 processor, ServerEndPoint server) in /_/src/StackExchange.Redis/RedisBase.cs:line 54
   at StackExchange.Redis.RedisTransaction.Execute(CommandFlags flags) in /_/src/StackExchange.Redis/RedisTransaction.cs:line 53
   at Hangfire.Redis.RedisConnection.AnnounceServer(String serverId, ServerContext context)
   at Hangfire.Server.BackgroundServerProcess.CreateServer(BackgroundServerContext context) in D:\downloads\Hangfire-master\Hangfire-master\src\Hangfire.Core\Server\BackgroundServerProcess.cs:line 175
   at Hangfire.Server.BackgroundServerProcess.Execute(Guid executionId, BackgroundExecution execution, CancellationToken stoppingToken, CancellationToken stoppedToken, CancellationToken shutdownToken) in D:\downloads\Hangfire-master\Hangfire-master\src\Hangfire.Core\Server\BackgroundServerProcess.cs:line 97
   at Hangfire.Server.BackgroundProcessingServer.RunServer(Guid executionId, Object state) in D:\downloads\Hangfire-master\Hangfire-master\src\Hangfire.Core\Server\BackgroundProcessingServer.cs:line 246
   at Hangfire.Processing.BackgroundExecution.Run(Action`2 callback, Object state) in D:\downloads\Hangfire-master\Hangfire-master\src\Hangfire.Core\Processing\BackgroundExecution.cs:line 115|Hangfire.Processing.BackgroundExecution

I'm curious, so I downloaded the source code of this project from GitHub and added it as a project reference for debugging, the error disappeared and everything worked fine.

    <ItemGroup>
      <ProjectReference Include="D:\downloads\Hangfire.Redis.StackExchange-master\Hangfire.Redis.StackExchange-master\Hangfire.Redis.StackExchange\Hangfire.Redis.StackExchange.csproj" />
    </ItemGroup>

Do you guys have any suggestions?

JasonLiuLiuLiuLiu commented 3 years ago

This looks like the parameters passed to stackexchange redis are garbled, but why is there no exception when using source code instead of nuget package?
And I use the same redis connectionstring , some of my projects can work normally, but some projects have always reported this exception. the redis connectionstring like this.

"*******:26320,********:26320,******:26320,serviceName=mymaster,defaultDatabase=3,abortConnect=false,allowAdmin=true"
JasonLiuLiuLiuLiu commented 3 years ago

This issue have been resolved by update stackexchange.redis to latest, thanks all !