openimsdk / open-im-sdk-android

IM Android
https://openim.io
MIT License
225 stars 161 forks source link

The Android demo frequently encounters errors when creating groups, triggering the OnError callback.[BUG] #59

Open xiaoyvyv opened 4 months ago

xiaoyvyv commented 4 months ago

OpenIM Server Version

3.5.1

Operating System and CPU Architecture

Linux (AMD)

Deployment Method

Source Code Deployment

Bug Description and Steps to Reproduce

@OpenIM-sk 官方demo建群会报错 UNIQUE constraint failed: local_group_members.group_id, local_group_members.user_id"} 。 2024-06-20 11:15:02.339 1568-1694 GoLog io.openim.flutter.rtc I 2024-06-20 03:15:02.339 ERROR [PID:1568] [log/sql_logger.go:71] sql exec detail {"operationID": "1718853301170", "gorm": "github.com/openimsdk/openim-sdk-core/v3@v3.0.0-00010101000000-000000000000/pkg/db/group_member_model.go:194", "elapsed time": "0.495156(ms)", "rows": 0, "sql": "INSERT INTO local_group_members (group_id,user_id,nickname,user_group_face_url,role_level,join_time,join_source,inviter_user_id,mute_end_time,operator_user_id,ex,attached_info) VALUES (\"2628116515\",\"3179190302\",\"why\",\"\",100,1718853299761,2,\"3179190302\",0,\"3179190302\",\"\",\"\")", "error": "UNIQUE constraint failed: local_group_members.group_id, local_group_members.user_id"} 2024-06-20 11:15:02.346 1568-1694 GoLog io.openim.flutter.rtc I 2024-06-20 03:15:02.340 ERROR [PID:1568] [syncer/syncer.go:140] sync insert failed {"operationID": "1718853301170", "type": "model_struct.LocalGroupMember", "server": {"groupID":"2628116515","userID":"3179190302","nickname":"why","faceURL":"","roleLevel":100,"joinTime":1718853299761,"joinSource":2,"inviterUserID":"3179190302","muteEndTime":0,"operatorUserID":"3179190302","ex":"","attachedInfo":""}, "local": null, "error": "==> github.com/openimsdk/openim-sdk-core/v3/pkg/db.(DataBase).InsertGroupMember()@194: : UNIQUE constraint failed: local_group_members.group_id, local_group_members.user_id"} 2024-06-20 11:15:02.346 1568-1702 GoLog io.openim.flutter.rtc I 2024-06-20 03:15:02.346 ERROR [PID:1568] [syncer/syncer.go:115] sync failed {"operationID": "1718853301170", "type": "model_struct.LocalGroupMember", "error": "==> github.com/openimsdk/openim-sdk-core/v3/pkg/db.(DataBase).InsertGroupMember()@194: : UNIQUE constraint failed: local_group_members.group_id, local_group_members.user_id"} 2024-06-20 11:15:02.347 1568-1702 GoLog io.openim.flutter.rtc I 2024-06-20 03:15:02.346 ERROR [PID:1568] [open_im_sdk/caller.go:109] fn call error {"operationID": "1718853301170", "function name": "github.com/openimsdk/openim-sdk-core/v3/internal/group.(Group).CreateGroup-fm", "cost time": "1175 ms", "error": "==> github.com/openimsdk/openim-sdk-core/v3/pkg/db.(DataBase).InsertGroupMember()@194: : UNIQUE constraint failed: local_group_members.group_id, local_group_members.user_id"}

Screenshots Link

No response

JauneQ commented 2 weeks ago

We recommend you update to 3.8.1. The error is seems to occur from core-sdk. If you can't update, you perhaps try to clone the core-sdk's code and build an aar by yourself. The repository is here.