Open Closed

RedisConnectionException: No connection requires writable - not eligible for replica #6892


User avatar
0
dev@veek.vn created

Hi,

I encountered an exception when setting data in Redis. Could you please help me with this?

My code:

private readonly IDistributedCache<RouteHistoryModeDto, string> _robotRouteHistoryCache;
// save to cache
await _robotRouteHistoryCache.SetAsync(string.Format(RouteHistoryConsts.CacheRouteHistoryModeKey, robot.Code),
                                               new RouteHistoryModeDto
                                               {
                                                   RouteHistoryId = routeHistory.Id,
                                                   ControlMode = routeHistory.ControlMode,
                                                   OperationMode = routeHistory.OperationMode,
                                                   DateTime = routeHistory.DateTime,
                                                   Odometer = routeHistory.Odometer,
                                                   TravelDistance = nextTravelDistance,
                                                   TravelTakenTime = nextTravelTakenTime
                                               });
StackExchange.Redis.RedisConnectionException: No connection (requires writable - not eligible for replica) is active/available to service this operation: EXPIRE c:AA.Core.BackOffice.RouteHistories.RouteHistoryModeDto,k:BackOffice:route-history-mode-bulldog015f899b, mc: 1/1/0, mgr: 10 of 10 available, clientName: localhost(SE.Redis-v2.6.122.38350), IOCP: (Busy=0,Free=1000,Min=1,Max=1000), WORKER: (Busy=2,Free=32765,Min=8,Max=32767), POOL: (Threads=7,QueuedItems=0,CompletedItems=488495,Timers=36), v: 2.6.122.38350
   at StackExchange.Redis.ConnectionMultiplexer.ThrowFailed[T](TaskCompletionSource`1 source, Exception unthrownException) in //src/StackExchange.Redis/ConnectionMultiplexer.cs:line 2039
StackExchange.Redis.RedisConnectionException: No connection (requires writable - not eligible for replica) is active/available to service this operation: EXPIRE c:AA.Core.BackOffice.RobotErrors.RobotError,k:BackOffice:robot-error-bulldog015f899b, mc: 1/1/0, mgr: 10 of 10 available, clientName: localhost(SE.Redis-v2.6.122.38350), IOCP: (Busy=0,Free=1000,Min=1,Max=1000), WORKER: (Busy=2,Free=32765,Min=8,Max=32767), POOL: (Threads=7,QueuedItems=0,CompletedItems=488947,Timers=37), v: 2.6.122.38350
   at StackExchange.Redis.ConnectionMultiplexer.ThrowFailed[T](TaskCompletionSource`1 source, Exception unthrownException) in //src/StackExchange.Redis/ConnectionMultiplexer.cs:line 2039

ABP Framework version: v7.3.2 UI Type: Angular Database System: MongoDB Tiered (for MVC) or Auth Server Separated (for Angular): Yes Exception message and full stack trace: [Provide any relevant details] Steps to reproduce the issue:


3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Can you try another Redis server to test it? We didn't encounter such a problem.

    You could try Redis in docker container.

  • User Avatar
    0
    dev@veek.vn created

    ok maliming

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Thanks.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38