收藏
回答

云数据库watch出现大量rebuild watch fail错误?

最近项目上使用了云数据库的watch功能,上线后大量报错 -402002:

realtime listener rebuild watch fail | errMsg: Error: Watch Error {"code":"QUERYID_INVALID_ERROR","message":"queryID not exist, need retry initWatch"}

realtime listener init watch fail | errMsg: init watch fail Error: invalid state: ws connection not exists, can not send message

另外,小程序运维中心的错误查询种监控到大量的错误:

current state (CLOSED) does not accept "initWatchFail"

current state (REBUILD_WATCH_SUCCESS) does not accept "rebuildWatchFail"

current state (CONNECTED) does not accept "connectionSuccess"

current state (DISCONNECTED) does not accept "connectionSuccess"

[realtime] onMessage parse res.data error: SyntaxError: Unexpected token u in JSON at position 0;at socketTask.onmessage callback function

我选取几个示例报错:

我使用到的代码如图:(代码中涉及到websocket的仅仅只有云数据的watch,并没有用到其他websocket功能和代码)

在我本人手机上和IDE上面都没有报过这样的错误,不知道是为什么?

请教一下,是什么原因导致的这种错误?有什么办法能解决?


回答关注问题邀请回答
收藏

3 个回答

  • Jiang Jiang
    Jiang Jiang
    10-18

    2025年了,还是相同的问题

    监听器错误 <Error: errCode: -402004 realtime listener rebuild watch fail | errMsg: Error: Watch Error {"code":"QUERYID_INVALID_ERROR","message":"queryID not exist, need retry initWatch"} (requestid: 1760756230247_0.04456018294314312) (rebuildWatch requestId 1760756230247_0.04456018294314312)
    history states: UNINIT-(loginStart)->INIT_LOGGING_IN-(loginSuccess)->INIT_LOGGED_IN-(initWatchStart)->INIT_WATCH_PENDING-(initWatchSuccess)->INIT_WATCH_SUCCESS-(wsDisconnected)->PAUSED-(loginStart)->REBUILD_LOGGING_IN-(loginSuccess)->REBUILD_LOGGED_IN-(rebuildWatchStart)->REBUILD_WATCH_PENDING-(close)->CLOSED>
    C@https://lib/WACloud.js:1:256083
    i@https://lib/WACloud.js:1:386080
    @https://lib/WACloud.js:1:389363
    @https://lib/WACloud.js:1:386655
    t@https://lib/WACloud.js:1:375
    s@https://lib/WACloud.js:1:587
    @https://lib/WACloud.js:1:646
    M@https://lib/WASubContext.js:1:59358
    @https://lib/WACloud.js:1:537
    @https://lib/WACloud.js:1:385813
    t@https://lib/WACloud.js:1:375
    u@https://lib/WACloud.js:1:623
    q@https://lib/WASubContext.js:1:58068
    @https://lib/WASubContext.js:1:58294
    C@https://lib/WASubContext.js:1:36140
    
    10-18
    有用
    回复
  • 卢索
    卢索
    2021-04-13

    似乎不是移动端的报错~是PC端的,PC端的watch目前应该是不支持

    2021-04-13
    有用
    回复
  • 哄哄
    哄哄
    发表于小程序端
    2020-09-25
    我们看一下哈
    2020-09-25
    有用
    回复 12
    • kit
      kit
      2020-09-25
      麻烦你们了
      2020-09-25
      回复
    • 刘拓飞
      刘拓飞
      2020-11-12回复kit
      问题解决了没,我这边也遇到相同的问题了......
      2020-11-12
      回复
    • leonlu
      leonlu
      2020-12-11
      请问有进展吗? 我也遇到这个问题
      2020-12-11
      回复
    • 云淡风清 hello world
      云淡风清 hello world
      2021-02-17
      我也出现这样的问题,怎样解决啊?
      2021-02-17
      回复
    • 斯文
      斯文
      2021-02-24
      同样问题
      2021-02-24
      回复
    查看更多(7)
登录 后发表内容
问题标签