Skip to content

【Bug】hiclaw-v1.1.1,worker的Matrix accessToken被file-sync同步覆盖后导致Worker永久断联,仅能通过容器重启恢复 || [Bug] hiclaw-v1.1.1, the worker's Matrix accessToken is overwritten by file-sync synchronization, causing the worker to be permanently disconnected, and can only be restored by restarting the container #809

Description

@Thassarian-Hitagi

Bug Description

只要worker重启过一次(token更新),后续worker只要执行文件同步(file-sync),就会100%断连。

Steps to Reproduce

1.当worker只要重启过一次,再根据任务要求执行file-sync的时候,会把minio中的openclaw.json(包含初始accessToken,此时已失效)同步到本地。
2.文件同步完成后,Worker仍可以正常发送至少1条消息(Matrix长连接会话令牌缓存有效期30120秒,此期间不需要重新校验Token)
3.等待30
120秒(到Matrix客户端默认心跳周期),Matrix连接被服务器主动断开,返回401/403认证错误
4.Matrix插件自动重连,一直使用已经被覆盖的无效旧Token,重连永久失败,Worker完全断联,仅能通过重启容器恢复

AI Analysis

根本原因:
1.Hiclaw Gateway内置工作区状态持久化机制:worker的本地文件自动同步到minio时,不包含工作区的openclaw.json (没问题,防止worker自己不小心改坏)
2.minio中的openclaw.json,文件中channels.matrix.accessToken是最初创建的时候生成的。
3.worker容器重启时,matrix分配的accessToken会更新

Image 确认容器重启会重新生成token、确认minio中token与实际生效的不一致 Image

Relevant Logs

Component

OpenClaw Worker

Version / Commit

No response


Bug Description

As long as the worker is restarted once (token update), subsequent workers will be 100% disconnected as long as they perform file synchronization (file-sync).

.

Steps to Reproduce

  1. When the worker only needs to be restarted once and then executes file-sync according to the task requirements, the openclaw.json in minio (including the initial accessToken, which is invalid at this time) will be synchronized to the local.
  2. After file synchronization is completed, Worker can still send at least 1 message normally (Matrix long connection session token cache is valid for 30~120 seconds, and there is no need to re-verify the token during this period)
  3. Wait for 30~120 seconds (to the default heartbeat period of the Matrix client). The Matrix connection is actively disconnected by the server and a 401/403 authentication error is returned.
  4. The Matrix plug-in automatically reconnects and always uses the invalid old token that has been overwritten. The reconnection fails permanently and the worker is completely disconnected and can only be restored by restarting the container.

AI Analysis

Root cause:

  1. Hiclaw Gateway has a built-in workspace state persistence mechanism: when the worker's local files are automatically synchronized to minio, the openclaw.json of the workspace is not included (no problem, to prevent the worker from accidentally changing it)
  2. In openclaw.json in minio, the channels.matrix.accessToken in the file is generated when it is initially created.
  3. When the worker container is restarted, the accessToken assigned by matrix will be updated.
Image Confirm that restarting the container will regenerate the token, and confirm that the token in minio is inconsistent with the actual one. Image

Relevant Logs

Component

OpenClaw Worker

Version/Commit

No response

Metadata

Metadata

Assignees

Labels

area:matrix-elementMatrix、Element/FluffyChat/Web UI、账号、密码、登录、成员、邀请、房间成员关系、DM/Team Room、消息通道与权限bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions