open-im-server icon indicating copy to clipboard operation
open-im-server copied to clipboard

Bug: <Encountered 'errDlt': 'context canceled' when calling the 'user/user_registe' API.>

Open heminghaoa opened this issue 2 years ago β€’ 11 comments

What happened?

When I call the user/user_registe to register a user, it returns an error { "errCode": 500, "errMsg": "ServerInternalError", "errDlt": "context canceled" }. However, the first call after running start-all.sh each time succeeds normally.

What did you expect to happen?

{ "errCode": 0, "errMsg": "", "errDlt": "" }register success

How can we reproduce it (as minimally and precisely as possible)?

Used Source Code Deployment, pulling the latest code from the main branch. I use 'export MONGO_URI=mongodb+srv://name:[email protected]/?retryWrites=true' to connect to my DB.Everything else is the same as the steps described in the documentation.

Anything else we need to know?

This is log 2023-12-28 03:00:25.547 ERROR [PID:221640] user [mw/rpc_server_interceptor.go:115] rpc server resp {"operationID": "16464454645642", "funcName": "/OpenIMServer.user.user/UserRegister", "error": "context canceled"} 2023-12-28 03:00:25.547 ERROR [PID:221640] user [mw/rpc_server_interceptor.go:119] rpc InternalServer error {"operationID": "16464454645642", "req": "secret:\"openIM123\" users:{userID:\"11132212\" nickname:\"yourNi21ckname\" faceURL:\"yourFaceURL\"}", "error": "context canceled"} 2023-12-28 03:00:25.547 WARN [PID:221640] user [mw/rpc_server_interceptor.go:171] rpc server resp {"operationID": "16464454645642", "funcName": "/OpenIMServer.user.user/UserRegister"} 2023-12-28 03:00:25.548 ERROR [PID:221148] api [mw/rpc_client_interceptor.go:58] rpc resp error {"operationID": "16464454645642", "error": "rpc error: code = Code(500) desc = ServerInternalError"}

version

Go Version

Go Version: go1.19 OS: linux Architecture: amd64

Branch Type

main

Docker Version

Docker version 24.0.5, build 24.0.5-0ubuntu1~22.04.1

Docker Compose Version

docker-compose version 1.29.2, build unknown

Kubernetes Version

Kubernetes is not installed. Please install it to get the version.

Cloud provider

aws

OS version

PRETTY_NAME="Ubuntu 22.04.3 LTS" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04.3 LTS (Jammy Jellyfish)" VERSION_CODENAME=jammy ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=jammy

Install tools

heminghaoa avatar Dec 28 '23 03:12 heminghaoa

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.

kubbot avatar Dec 28 '23 03:12 kubbot

Hello, thank you for bringing the issue to our attention. I would like to inquire about the registration process. Did the first attempt to register succeed and the second one fail? Were different user IDs used for each attempt?

cubxxw avatar Dec 28 '23 15:12 cubxxw

The IDs used for the two registrations were different. If the same ID had been used, it would have triggered a RegisteredAlreadyError. The current issue is 'context canceled', and all other functions are operating normally.

heminghaoa avatar Dec 29 '23 02:12 heminghaoa

It is normal for the ID to be different if it is used twice, right?

cubxxw avatar Dec 29 '23 03:12 cubxxw

If the error returned when an ID is used repeatedly is normal, then using different IDs should have led to successful registration. However, we encountered a 'context canceled' error.

heminghaoa avatar Dec 29 '23 03:12 heminghaoa

ζ˜―δΈζ˜―η”¨ηš„mongoι›†ηΎ€ε•ŠοΌŒθ―•θ―•mongoεˆ†η‰‡οΌŒεˆ«η”¨ι›†ηΎ€ο½ž

soonio avatar Dec 30 '23 04:12 soonio

Bot detected the issue body's language is not English, translate it automatically. πŸ‘―πŸ‘­πŸ»πŸ§‘β€πŸ€β€πŸ§‘πŸ‘«πŸ§‘πŸΏβ€πŸ€β€πŸ§‘πŸ»πŸ‘©πŸΎβ€πŸ€β€πŸ‘¨πŸΏπŸ‘¬πŸΏ


Are you using a mongo cluster? Try mongo sharding instead of using a cluster~

kubbot avatar Dec 30 '23 04:12 kubbot

ζœ‰ι“η†οΌŒζˆ‘θ―•θ―•ζ”ΉδΈ€δΈ‹

heminghaoa avatar Dec 31 '23 04:12 heminghaoa

Bot detected the issue body's language is not English, translate it automatically. πŸ‘―πŸ‘­πŸ»πŸ§‘β€πŸ€β€πŸ§‘πŸ‘«πŸ§‘πŸΏβ€πŸ€β€πŸ§‘πŸ»πŸ‘©πŸΎβ€πŸ€β€πŸ‘¨πŸΏπŸ‘¬πŸΏ


That makes sense. I'll try changing it.

kubbot avatar Dec 31 '23 04:12 kubbot

I think it's better to support the solution in which MongoDB could be connected with the clustering. After all, it's suggested by official. Further, connecting with certification would be impossible if applying configuring sharded addresses.

wu0h961738 avatar Jan 10 '24 08:01 wu0h961738

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

kubbot avatar May 13 '24 08:05 kubbot