-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] get_sorted_conversation_list error:1004 mongo find one: mongo: no documents in result mongo #221
Comments
Hello! Thank you for filing an issue. If this is a bug report, please include relevant logs to help us debug the problem. Join slack 🤖 to connect and communicate with our developers. |
在同步消息时,会有部分报错:
|
同步下最新进展:我将数据删除了重新再刷,就好了。 这次刷的时候,改了一下迁移脚本,在调用 openim 接口之前增加了更多校验,例如创建群时,会校验群成员是否是一个有效的 user,给群发消息时,校验群是否已经解散了,解散了就不迁移。每迁移一个步骤,都校验一下 conversation 和 msg 数据是否一致。这样 send_msg 接口报 mongo find one: mongo: no documents in result mongo 的错误就少多了。 这次迁移和上次迁移还有一个步骤不一样,最开始迁移的时候多添加了一些好友,后面又人为删掉了一些好友(调用 delete_friend 接口),不清楚这会不会导致 msg 和 collection 数据不一致。 |
The latest progress in synchronization: I deleted the data and refreshed it again, and it was fine. When refreshing this time, I changed the migration script and added more verifications before calling the openim interface. For example, when creating a group, it will be verified whether the group member is a valid user, and when sending a message to the group, it will be verified whether the group is a valid user. It has been disbanded. Once disbanded, it will not be moved. At each migration step, check whether the conversation and msg data are consistent. In this way, the send_msg interface reports mongo find one: mongo: no documents in result mongo errors much less. There is another step that is different between this migration and the last migration. At the beginning of the migration, some more friends were added, and later some friends were manually deleted (the delete_friend interface was called). It is not clear whether this will cause msg and collection data to be lost. Inconsistent. |
update: 这个问题又出现了!! 我昨天迁移的数据,刚迁移时没有问题,也没做什么操作,部分用户 get_sorted_conversation_list 接口会报错。不清楚什么原因了。 |
update: This problem has appeared again! ! The data I migrated yesterday had no problems when it was first migrated, and no operations were performed. Some users will report an error in the get_sorted_conversation_list interface. Not sure why. |
Is it still caused by the inconsistency between the data in the msg table and the conversation data? |
We’ve reviewed your log, and it seems a bit complicated. |
OpenIM Server Version
3.8.2
Operating System and CPU Architecture
Linux (AMD)
Deployment Method
Docker Deployment
Bug Description and Steps to Reproduce
我是将 openim 2.3.3 版本迁移到 3.8.2 版本,通过 API 导入了用户(/user/user_register),好友关系(/friend/import_friend),群组(/group/create_group)、聊天记录(/msg/send_msg)。
对于部分用户,当我调用 http://im-server-ip:10002/conversation/get_sorted_conversation_list 接口会报错:
有些用户会成功,但是不少用户会失败。服务端报错:
我选取了部分详细日志在附件里。
test.log
对于报错的用户,调用 /conversation/get_owner_conversation 和 /conversation/get_all_conversations 接口是没有问题的。我自己看了下数据,可能原因是用户的有些会话,在 msg 集合没有对应记录。
我不清楚为什么在 msg 没有对应的记录,大部分会话在加好友或者建群时会自动发一条消息,这时会自动创建了 msg 文档。在迁移过程中,我都是调用的相关接口,并没有直接操作数据库。怀疑 openim 在处理建群时存在 bug,数据不一致,但是不一致的概率有点高。
Screenshots Link
No response
The text was updated successfully, but these errors were encountered: