agentscope-ai / agentscope-ai/agentscope-java

[Bug]: After upgrading to version 2.0.3, there was an error when writing to the Redis cluster.

未關閉
#3,085 3 則留言 0 個 reaction 已指派 1 人 已被 @rudy2steiner 認領 在 GitHub 檢視
area/ext/memory bug
主要語言
Java
星號
5.6k
分支
1.3k
平均合併
4 天 12 小時
30 天內合併 PR
77

描述

After upgrading to version 2.0.3, there was an error when writing to the Redis cluster.
**Describe the bug**
The AgentScope 2.0.2 version is operating normally. Only upgrading AgentScope to 2.0.3 without modifying any business or Redis cluster-related configurations resulted in errors when writing to the Redis cluster after the upgrade.

**To Reproduce**
The store is using this: DistributedStore store = RedisDistributedStore.fromJedis(getJedisCluster(), agentScopeProperties.getRedis().getKeyPrefix());

**Expected behavior**
A clear and concise description of what you expected to happen.

**Error messages**
系统异常

java.lang.RuntimeException: Failed to save state if version: agent_state
at io.agentscope.extensions.redis.state.RedisAgentStateStore.saveIfVersion(RedisAgentStateStore.java:289)
at io.agentscope.core.ReActAgent.persistAgentStateCas(ReActAgent.java:557)
at io.agentscope.core.ReActAgent.lambda$saveStateToSession$1(ReActAgent.java:485)
at reactor.core.publisher.MonoRunnable.subscribe(MonoRunnable.java:49)
at reactor.core.publisher.Mono.subscribe(Mono.java:4569)
at reactor.core.publisher.MonoSubscribeOn$SubscribeOnSubscriber.run(MonoSubscribeOn.java:127)
at io.opentelemetry.instrumentation.reactor.v3_1.ContextPropagationOperator$RunnableWrapper.run(ContextPropagationOperator.java:374)
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:90)
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:309)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
at java.base/java.lang.Thread.run(Thread.java:1474)
Caused by: redis.clients.jedis.exceptions.JedisClusterOperationException: Keys must belong to same hashslot.
at redis.clients.jedis.ClusterCommandArguments.processKey(ClusterCommandArguments.java:36)
at redis.clients.jedis.CommandArguments.key(CommandArguments.java:131)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at redis.clients.jedis.CommandArguments.keys(CommandArguments.java:161)
at redis.clients.jedis.CommandObjects.eval(CommandObjects.java:3114)
at redis.clients.jedis.UnifiedJedis.eval(UnifiedJedis.java:4019)
at io.agentscope.extensions.redis.state.jedis.JedisClientAdapter.evalScript(JedisClientAdapter.java:173)
at io.agentscope.extensions.redis.state.RedisAgentStateStore.saveIfVersion(RedisAgentStateStore.java:283)
... 13 common frames omitted

**Environment (please complete the following information):**

- AgentScope-Java Version: [2.0.3]
- Java Version: [21]
- OS: [ windows10]

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。