Skip to content
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

[Other]: Login error code 14 (last connection error: connection error: desc = "error reading server preface: read tcp ) #480

Closed
keidbye opened this issue Jul 8, 2023 · 13 comments
Labels
other Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@keidbye
Copy link

keidbye commented Jul 8, 2023

What would you like to share?

An error occurred when logging in via web-demo
{
"errCode": 14,
"errMsg": "last connection error: connection error: desc = "transport: Error while dialing: dial tcp 169.254.100.204:30300: connectex: A socket operation was attempted to an unreachable network."",
"errDlt": ": last connection error: connection error: desc = "transport: Error while dialing: dial tcp 169.254.100.204:30300: connectex: A socket operation was attempted to an unreachable network.""
}

Additional information

No response

@keidbye keidbye added the other Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jul 8, 2023
@kubbot kubbot changed the title [Other]: 登录错误码14 [Other]: Login error code 14 Jul 8, 2023
@skiffer-git
Copy link
Member

It seems that the connection to port 30300 is failing. Is it being deployed on a single machine?

@keidbye
Copy link
Author

keidbye commented Jul 10, 2023

yes

It seems that the connection to port 30300 is failing. Is it being deployed on a single machine?

@skiffer-git
Copy link
Member

use netstat check port

@kubbot
Copy link
Contributor

kubbot commented Jul 10, 2023

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


use netstat check port

@kubbot
Copy link
Contributor

kubbot commented Sep 9, 2023

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
Copy link
Contributor

kubbot commented Sep 16, 2023

This issue was closed because it has been stalled for 7 days with no activity.

@kubbot kubbot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 16, 2023
@cubxxw
Copy link
Contributor

cubxxw commented Mar 13, 2024

Has the issue been resolved?

@cubxxw cubxxw changed the title [Other]: Login error code 14 [Other]: Login error code 14 (last connection error: connection error: desc = "error reading server preface: read tcp ) Mar 13, 2024
@cubxxw
Copy link
Contributor

cubxxw commented Mar 13, 2024

所有的 openim-server 和 openim-chat 服务都正常启动起来了,但是登录却报错了:
openim-chat 启动状态:

smile@smile:/data/workspaces/chat$ make check 
===========> Checking the service
# Start Chat check-all.sh 16:43:05, For local deployments, use ./check-all.sh --print-screen
================> Architecture: x86_64
================> BIN_DIR: /data/workspaces/chat/scripts/..//data/workspaces/chat/scripts/../_output/bin/platforms/linux/amd64
Service  running: /data/workspaces/chat/scripts/../_output/bin/platforms/linux/amd64/chat-api
Service  running: /data/workspaces/chat/scripts/../_output/bin/platforms/linux/amd64/admin-api
Service  running: /data/workspaces/chat/scripts/../_output/bin/platforms/linux/amd64/chat-rpc
Service  running: /data/workspaces/chat/scripts/../_output/bin/platforms/linux/amd64/admin-rpc
All chat services startup successful

openim-server 的启动状态:

smile@smile:/data/workspaces/open-im-server$ make check 
===========> Checking openim

# Begin to check all openim service
[2024-03-13 16:44:56 CST] Check all dependent service ports
+-------------------------+----------+
| Service Name            | Port     |
+-------------------------+----------+
| openim-user             | 10110    |
| openim-friend           | 10120    |
| openim-msg              | 10130    |
| openim-msg-gateway      | 10140    |
| openim-group            | 10150    |
| openim-auth             | 10160    |
| openim-push             | 10170    |
| openim-conversation     | 10180    |
| openim-third            | 10190    |
| openim-api              | 10002    |
| openim-ws               | 10001    |
+-------------------------+----------+
+-------------------------+----------+
| Service Name            | Port     |
+-------------------------+----------+
| redis                   | 16379    |
| zookeeper               | 12181    |
| kafka                   | 19094    |
| mongodb                 | 37017    |
| minio                   | 10005    |
+-------------------------+----------+
++ The port being checked: 10110 10120 10130 10140 10150 10160 10170 10180 10190 10002 10001

## Check all dependent service ports
++ The port being checked: 16379 12181 19094 37017 10005
 2024-03-13 16:44:56  The environment is outside the container 
Checking ports: 16379 12181 19094 37017 10005
### Started ports:
Port 16379 - Command: , PID: , FD: , Started: N/A
Port 12181 - Command: , PID: , FD: , Started: N/A
Port 19094 - Command: , PID: , FD: , Started: N/A
Port 37017 - Command: , PID: , FD: , Started: N/A
Port 10005 - Command: , PID: , FD: , Started: N/A
[success 0313 16:44:56]==> All components depended on by openim are running normally! 

## Check openim service name:
/data/workspaces/open-im-server/_output/bin/platforms/linux/amd64/openim-msgtransfer
Check openim service name:
/data/workspaces/open-im-server/_output/bin/platforms/linux/amd64/openim-api
/data/workspaces/open-im-server/_output/bin/platforms/linux/amd64/openim-crontask
/data/workspaces/open-im-server/_output/bin/platforms/linux/amd64/openim-msggateway
/data/workspaces/open-im-server/_output/bin/platforms/linux/amd64/openim-push
/data/workspaces/open-im-server/_output/bin/platforms/linux/amd64/openim-rpc-auth
/data/workspaces/open-im-server/_output/bin/platforms/linux/amd64/openim-rpc-conversation
/data/workspaces/open-im-server/_output/bin/platforms/linux/amd64/openim-rpc-friend
/data/workspaces/open-im-server/_output/bin/platforms/linux/amd64/openim-rpc-group
/data/workspaces/open-im-server/_output/bin/platforms/linux/amd64/openim-rpc-msg
/data/workspaces/open-im-server/_output/bin/platforms/linux/amd64/openim-rpc-third
/data/workspaces/open-im-server/_output/bin/platforms/linux/amd64/openim-rpc-user
[success 0313 16:44:57]==> All openim services are running normally! 

web 上的报错信息:

last connection error: connection error: desc = "error reading server preface: read tcp 127.0.0.1:59054->127.0.0.1:7890: read: connection reset by peer"

请求和状态:

Request URL:
http://localhost:10009/account/login
Request Method:
POST
Status Code:
200 OK
Remote Address:
[::1]:10009
Referrer Policy:
strict-origin-when-cross-origin

errCode
: 
14
errDlt
: 
": 14 last connection error: connection error: desc = \"error reading server preface: read tcp 127.0.0.1:59054->127.0.0.1:7890: read: connection reset by peer\""
errMsg
: 
"last connection error: connection error: desc = \"error reading server preface: read tcp 127.0.0.1:59054->127.0.0.1:7890: read: connection reset by peer\""
{
    "errCode": 14,
    "errMsg": "last connection error: connection error: desc = \"error reading server preface: read tcp 127.0.0.1:59054-\u003e127.0.0.1:7890: read: connection reset by peer\"",
    "errDlt": ": 14 last connection error: connection error: desc = \"error reading server preface: read tcp 127.0.0.1:59054-\u003e127.0.0.1:7890: read: connection reset by peer\""
}

@cubxxw cubxxw reopened this Mar 13, 2024
@cubxxw
Copy link
Contributor

cubxxw commented Mar 13, 2024

chat logs:

2024-03-13 16:53:19.570 ERROR   [PID:3729333]   chat-api        [mw/rpc_client_interceptor.go:58]       rpc resp error  {"operationID": "243149db-795e-46dd-a9e1-8ab00566a351", "funcName": "/OpenIMChat.admin.admin/ParseToken", "error": "rpc error: code = Unavailable desc = last connection error: connection error: desc = \"error reading server preface: read tcp 127.0.0.1:52240->127.0.0.1:7890: read: connection reset by peer\""}
2024-03-13 16:53:19.570 DEBUG   [PID:3729333]   chat-api        [mw/gin_log.go:55]      gin response    {"operationID": "243149db-795e-46dd-a9e1-8ab00566a351", "time": 0.006325762, "status": 200, "resp": "{\"errCode\":14,\"errMsg\":\"last connection error: connection error: desc = \\\"error reading server preface: read tcp 127.0.0.1:52240-\\u003e127.0.0.1:7890: read: connection reset by peer\\\"\",\"errDlt\":\": 14 last connection error: connection error: desc = \\\"error reading server preface: read tcp 127.0.0.1:52240-\\u003e127.0.0.1:7890: read: connection reset by peer\\\"\"}"}
2024-03-13 16:53:23.934 DEBUG   [PID:3729348]   admin-api       [mw/gin_log.go:46]      gin request     {"operationID": "06cc3885-619f-4abc-8f9d-4b7d6dae0bf5", "method": "POST", "uri": "/block/search", "req": "{\"current\":1,\"pageSize\":10,\"pagination\":{\"pageNumber\":1,\"showNumber\":10}}"}
2024-03-13 16:53:23.934 DEBUG   [PID:3729348]   admin-api       [mw/rpc_client_interceptor.go:52]       get rpc ctx success     {"operationID": "06cc3885-619f-4abc-8f9d-4b7d6dae0bf5", "funcName": "/OpenIMChat.admin.admin/ParseToken", "req": "token:\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySUQiOiJpbUFkbWluIiwiVXNlclR5cGUiOjIsIlBsYXRmb3JtSUQiOjAsImV4cCI6OTE3NTI3NjE4OSwibmJmIjoxNzEwMzE1ODg5LCJpYXQiOjE3MTAzMTYxODl9.JINHEyR_hsGl8yM1hi2oC1UHOh1xi5t8FH8tsa45f5E\"", "conn target": "openim:///admin"}
2024-03-13 16:53:23.935 ERROR   [PID:3729348]   admin-api       [mw/rpc_client_interceptor.go:58]       rpc resp error  {"operationID": "06cc3885-619f-4abc-8f9d-4b7d6dae0bf5", "funcName": "/OpenIMChat.admin.admin/ParseToken", "error": "rpc error: code = Unavailable desc = last connection error: connection error: desc = \"error reading server preface: read tcp 127.0.0.1:35038->127.0.0.1:7890: read: connection reset by peer\""}
2024-03-13 16:53:23.935 DEBUG   [PID:3729348]   admin-api       [mw/gin_log.go:55]      gin response    {"operationID": "06cc3885-619f-4abc-8f9d-4b7d6dae0bf5", "time": 0.001244233, "status": 200, "resp": "{\"errCode\":14,\"errMsg\":\"last connection error: connection error: desc = \\\"error reading server preface: read tcp 127.0.0.1:35038-\\u003e127.0.0.1:7890: read: connection reset by peer\\\"\",\"errDlt\":\": 14 last connection error: connection error: desc = \\\"error reading server preface: read tcp 127.0.0.1:35038-\\u003e127.0.0.1:7890: read: connection reset by peer\\\"\"}"}
2024-03-13 16:53:27.396 DEBUG   [PID:3729333]   chat-api        [mw/gin_log.go:46]      gin request     {"operationID": "4411baf2-bbb8-459c-97fe-698fcc6686e2", "method": "POST", "uri": "/user/search/full", "req": "{\"pagination\":{\"pageNumber\":1,\"showNumber\":10},\"normal\":1}"}
2024-03-13 16:53:27.396 DEBUG   [PID:3729333]   chat-api        [mw/rpc_client_interceptor.go:52]       get rpc ctx success     {"operationID": "4411baf2-bbb8-459c-97fe-698fcc6686e2", "funcName": "/OpenIMChat.admin.admin/ParseToken", "req": "token:\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySUQiOiJpbUFkbWluIiwiVXNlclR5cGUiOjIsIlBsYXRmb3JtSUQiOjAsImV4cCI6OTE3NTI3NjE4OSwibmJmIjoxNzEwMzE1ODg5LCJpYXQiOjE3MTAzMTYxODl9.JINHEyR_hsGl8yM1hi2oC1UHOh1xi5t8FH8tsa45f5E\"", "conn target": "openim:///admin"}
2024-03-13 16:53:27.396 ERROR   [PID:3729333]   chat-api        [mw/rpc_client_interceptor.go:58]       rpc resp error  {"operationID": "4411baf2-bbb8-459c-97fe-698fcc6686e2", "funcName": "/OpenIMChat.admin.admin/ParseToken", "error": "rpc error: code = Unavailable desc = last connection error: connection error: desc = \"error reading server preface: read tcp 127.0.0.1:52240->127.0.0.1:7890: read: connection reset by peer\""}
2024-03-13 16:53:27.396 DEBUG   [PID:3729333]   chat-api        [mw/gin_log.go:55]      gin response    {"operationID": "4411baf2-bbb8-459c-97fe-698fcc6686e2", "time": 0.000360085, "status": 200, "resp": "{\"errCode\":14,\"errMsg\":\"last connection error: connection error: desc = \\\"error reading server preface: read tcp 127.0.0.1:52240-\\u003e127.0.0.1:7890: read: connection reset by peer\\\"\",\"errDlt\":\": 14 last connection error: connection error: desc = \\\"error reading server preface: read tcp 127.0.0.1:52240-\\u003e127.0.0.1:7890: read: connection reset by peer\\\"\"}"}
2024-03-13 16:56:37.146 DEBUG   [PID:3729333]   chat-api        [mw/gin_log.go:46]      gin request     {"operationID": "e65557e8-53da-46cd-b381-32d6103c3d6c", "method": "POST", "uri": "/user/search/full", "req": "{\"pagination\":{\"pageNumber\":1,\"showNumber\":10},\"normal\":1}"}
2024-03-13 16:56:37.146 DEBUG   [PID:3729333]   chat-api        [mw/rpc_client_interceptor.go:52]       get rpc ctx success     {"operationID": "e65557e8-53da-46cd-b381-32d6103c3d6c", "funcName": "/OpenIMChat.admin.admin/ParseToken", "req": "token:\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySUQiOiJpbUFkbWluIiwiVXNlclR5cGUiOjIsIlBsYXRmb3JtSUQiOjAsImV4cCI6OTE3NTI3NjE4OSwibmJmIjoxNzEwMzE1ODg5LCJpYXQiOjE3MTAzMTYxODl9.JINHEyR_hsGl8yM1hi2oC1UHOh1xi5t8FH8tsa45f5E\"", "conn target": "openim:///admin"}
2024-03-13 16:56:37.146 ERROR   [PID:3729333]   chat-api        [mw/rpc_client_interceptor.go:58]       rpc resp error  {"operationID": "e65557e8-53da-46cd-b381-32d6103c3d6c", "funcName": "/OpenIMChat.admin.admin/ParseToken", "error": "rpc error: code = Unavailable desc = last connection error: connection error: desc = \"error reading server preface: read tcp 127.0.0.1:39048->127.0.0.1:7890: read: connection reset by peer\""}
2024-03-13 16:56:37.146 DEBUG   [PID:3729333]   chat-api        [mw/gin_log.go:55]      gin response    {"operationID": "e65557e8-53da-46cd-b381-32d6103c3d6c", "time": 0.000335137, "status": 200, "resp": "{\"errCode\":14,\"errMsg\":\"last connection error: connection error: desc = \\\"error reading server preface: read tcp 127.0.0.1:39048-\\u003e127.0.0.1:7890: read: connection reset by peer\\\"\",\"errDlt\":\": 14 last connection error: connection error: desc = \\\"error reading server preface: read tcp 127.0.0.1:39048-\\u003e127.0.0.1:7890: read: connection reset by peer\\\"\"}"}
2024-03-13 16:56:38.477 DEBUG   [PID:3729348]   admin-api       [mw/gin_log.go:46]      gin request     {"operationID": "08fc52bf-ad1b-4c4a-81bb-9b697b7b871b", "method": "POST", "uri": "/block/search", "req": "{\"current\":1,\"pageSize\":10,\"pagination\":{\"pageNumber\":1,\"showNumber\":10}}"}
2024-03-13 16:56:38.477 DEBUG   [PID:3729348]   admin-api       [mw/rpc_client_interceptor.go:52]       get rpc ctx success     {"operationID": "08fc52bf-ad1b-4c4a-81bb-9b697b7b871b", "funcName": "/OpenIMChat.admin.admin/ParseToken", "req": "token:\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySUQiOiJpbUFkbWluIiwiVXNlclR5cGUiOjIsIlBsYXRmb3JtSUQiOjAsImV4cCI6OTE3NTI3NjE4OSwibmJmIjoxNzEwMzE1ODg5LCJpYXQiOjE3MTAzMTYxODl9.JINHEyR_hsGl8yM1hi2oC1UHOh1xi5t8FH8tsa45f5E\"", "conn target": "openim:///admin"}
2024-03-13 16:56:38.477 ERROR   [PID:3729348]   admin-api       [mw/rpc_client_interceptor.go:58]       rpc resp error  {"operationID": "08fc52bf-ad1b-4c4a-81bb-9b697b7b871b", "funcName": "/OpenIMChat.admin.admin/ParseToken", "error": "rpc error: code = Unavailable desc = last connection error: connection error: desc = \"error reading server preface: read tcp 127.0.0.1:55444->127.0.0.1:7890: read: connection reset by peer\""}
2024-03-13 16:56:38.477 DEBUG   [PID:3729348]   admin-api       [mw/gin_log.go:55]      gin response    {"operationID": "08fc52bf-ad1b-4c4a-81bb-9b697b7b871b", "time": 0.000381773, "status": 200, "resp": "{\"errCode\":14,\"errMsg\":\"last connection error: connection error: desc = \\\"error reading server preface: read tcp 127.0.0.1:55444-\\u003e127.0.0.1:7890: read: connection reset by peer\\\"\",\"errDlt\":\": 14 last connection error: connection error: desc = \\\"error reading server preface: read tcp 127.0.0.1:55444-\\u003e127.0.0.1:7890: read: connection reset by peer\\\"\"}"}
2024-03-13 16:56:40.422 DEBUG   [PID:3729333]   chat-api        [mw/gin_log.go:46]      gin request     {"operationID": "6c1fe031-c08f-4698-933a-6c4b3715349f", "method": "POST", "uri": "/user/search/full", "req": "{\"pagination\":{\"pageNumber\":1,\"showNumber\":10},\"normal\":1}"}
2024-03-13 16:56:40.423 DEBUG   [PID:3729333]   chat-api        [mw/rpc_client_interceptor.go:52]       get rpc ctx success     {"operationID": "6c1fe031-c08f-4698-933a-6c4b3715349f", "funcName": "/OpenIMChat.admin.admin/ParseToken", "req": "token:\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySUQiOiJpbUFkbWluIiwiVXNlclR5cGUiOjIsIlBsYXRmb3JtSUQiOjAsImV4cCI6OTE3NTI3NjE4OSwibmJmIjoxNzEwMzE1ODg5LCJpYXQiOjE3MTAzMTYxODl9.JINHEyR_hsGl8yM1hi2oC1UHOh1xi5t8FH8tsa45f5E\"", "conn target": "openim:///admin"}
2024-03-13 16:56:40.423 ERROR   [PID:3729333]   chat-api        [mw/rpc_client_interceptor.go:58]       rpc resp error  {"operationID": "6c1fe031-c08f-4698-933a-6c4b3715349f", "funcName": "/OpenIMChat.admin.admin/ParseToken", "error": "rpc error: code = Unavailable desc = last connection error: connection error: desc = \"error reading server preface: read tcp 127.0.0.1:39048->127.0.0.1:7890: read: connection reset by peer\""}
2024-03-13 16:56:40.423 DEBUG   [PID:3729333]   chat-api        [mw/gin_log.go:55]      gin response    {"operationID": "6c1fe031-c08f-4698-933a-6c4b3715349f", "time": 0.000357078, "status": 200, "resp": "{\"errCode\":14,\"errMsg\":\"last connection error: connection error: desc = \\\"error reading server preface: read tcp 127.0.0.1:39048-\\u003e127.0.0.1:7890: read: connection reset by peer\\\"\",\"errDlt\":\": 14 last connection error: connection error: desc = \\\"error reading server preface: read tcp 127.0.0.1:39048-\\u003e127.0.0.1:7890: read: connection reset by peer\\\"\"}"}
2024-03-13 16:56:40.831 DEBUG   [PID:3729348]   admin-api       [mw/gin_log.go:46]      gin request     {"operationID": "812000ee-6c2d-43ad-8c08-1db25f43501f", "method": "POST", "uri": "/block/search", "req": "{\"current\":1,\"pageSize\":10,\"pagination\":{\"pageNumber\":1,\"showNumber\":10}}"}
2024-03-13 16:56:40.831 DEBUG   [PID:3729348]   admin-api       [mw/rpc_client_interceptor.go:52]       get rpc ctx success     {"operationID": "812000ee-6c2d-43ad-8c08-1db25f43501f", "funcName": "/OpenIMChat.admin.admin/ParseToken", "req": "token:\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySUQiOiJpbUFkbWluIiwiVXNlclR5cGUiOjIsIlBsYXRmb3JtSUQiOjAsImV4cCI6OTE3NTI3NjE4OSwibmJmIjoxNzEwMzE1ODg5LCJpYXQiOjE3MTAzMTYxODl9.JINHEyR_hsGl8yM1hi2oC1UHOh1xi5t8FH8tsa45f5E\"", "conn target": "openim:///admin"}
2024-03-13 16:56:40.831 ERROR   [PID:3729348]   admin-api       [mw/rpc_client_interceptor.go:58]       rpc resp error  {"operationID": "812000ee-6c2d-43ad-8c08-1db25f43501f", "funcName": "/OpenIMChat.admin.admin/ParseToken", "error": "rpc error: code = Unavailable desc = last connection error: connection error: desc = \"error reading server preface: read tcp 127.0.0.1:55444->127.0.0.1:7890: read: connection reset by peer\""}
2024-03-13 16:56:40.831 DEBUG   [PID:3729348]   admin-api       [mw/gin_log.go:55]      gin response    {"operationID": "812000ee-6c2d-43ad-8c08-1db25f43501f", "time": 0.000314759, "status": 200, "resp": "{\"errCode\":14,\"errMsg\":\"last connection error: connection error: desc = \\\"error reading server preface: read tcp 127.0.0.1:55444-\\u003e127.0.0.1:7890: read: connection reset by peer\\\"\",\"errDlt\":\": 14 last connection error: connection error: desc = \\\"error reading server preface: read tcp 127.0.0.1:55444-\\u003e127.0.0.1:7890: read: connection reset by peer\\\"\"}"}

@cubxxw
Copy link
Contributor

cubxxw commented Mar 13, 2024

form chatgpt ask:

这个日志报错涉及到了多个错误消息,主要集中在 RPC 调用失败上,具体分析如下:

错误分析

RPC 连接错误

错误消息 "rpc error: code = Unavailable desc = last connection error: connection error: desc = \"error reading server preface: read tcp 127.0.0.1:52240->127.0.0.1:7890: read: connection reset by peer\"" 指出了一个 RPC 连接问题。这个问题的根本原因是在尝试读取服务器的前言信息时,连接被对端重置。这种情况通常发生于以下几种情况:

  • 服务器未准备好接受连接:服务器可能在重启中或者还未完全启动,导致尚未准备好接受连接。
  • 网络问题:虽然这里的地址是本地回环地址(127.0.0.1),表明客户端和服务器在同一台机器上,但TCP连接仍然可能因为系统网络配置错误或资源限制而被重置。
  • 服务器拒绝连接:服务器可能由于配置错误、资源限制(如文件描述符限制)或安全策略拒绝了连接。

错误代码和消息

日志中的错误代码为 14,这对应于 gRPC 的 UNAVAILABLE 状态,表明服务不可用。这通常是因为服务器无法正确处理来自客户端的请求。同时,错误详情包含了具体的连接错误描述,帮助开发者诊断问题。

解决方案建议

针对此类问题,可以尝试以下几种解决方案:

  • 检查服务器状态:确保服务完全启动并且处于监听状态。可以使用工具如 netstatss 检查端口(如 7890)是否被正确监听。
  • 检查服务日志:服务端的日志可能提供了为何连接被重置的更多信息。可能是由于启动失败、配置错误或其他内部错误导致服务不稳定或无法启动。
  • 网络配置和资源限制:确认系统的网络配置正确无误,并检查是否有资源限制(如打开文件的最大数量)导致服务无法接受新的连接。
  • 客户端和服务端版本兼容性:确保客户端和服务端使用的 gRPC 版本兼容,以及任何相关的中间件或代理兼容性。

如果问题持续存在,可能需要深入分析服务端的实现和配置,以及客户端的连接逻辑,从而找到根本原因并解决。在某些复杂的情况下,可能还需要利用网络抓包工具(如 Wireshark)来观察和分析 TCP 层面的通信细节。

@kubbot
Copy link
Contributor

kubbot commented Mar 13, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


form chatgpt ask:

This log error report involves multiple error messages, mainly focusing on RPC call failure. The specific analysis is as follows:

Error analysis

RPC connection error

Error message "rpc error: code = Unavailable desc = last connection error: connection error: desc = \"error reading server preface: read tcp 127.0.0.1:52240->127.0.0.1:7890: read: connection reset by peer\ "" indicates an RPC connection problem. The root cause of this issue is that the connection was reset by the peer while trying to read the server's preamble information. This situation usually occurs in the following situations:

  • Server is not ready to accept connections: The server may be restarting or has not fully started, causing it to not be ready to accept connections.
  • Network Issue: Although the address here is the local loopback address (127.0.0.1), indicating that the client and server are on the same machine, the TCP connection may still be reset due to system network configuration errors or resource limitations .
  • Server Rejected Connection: The server may have rejected the connection due to misconfiguration, resource constraints (such as file descriptor limits), or security policy.

Error codes and messages

The error code in the log is 14, which corresponds to gRPC's UNAVAILABLE status, indicating that the service is unavailable. This is usually because the server is unable to properly handle the request from the client. At the same time, the error details include specific connection error descriptions to help developers diagnose problems.

Solution suggestions

For this kind of problem, you can try the following solutions:

  • Check Server Status: Make sure the service is fully started and in listening state. You can use tools such as netstat or ss to check whether the port (such as 7890) is being listened to correctly.
  • Check service logs: Server-side logs may provide more information as to why the connection was reset. The service may be unstable or unable to start due to a startup failure, misconfiguration, or other internal error.
  • Network Configuration and Resource Limits: Verify that the system's network configuration is correct and check to see if there are any resource limits (such as the maximum number of open files) that prevent the service from accepting new connections.
  • Client and Server Version Compatibility: Ensure that the gRPC versions used by the client and server are compatible, as well as any related middleware or proxy compatibility.

If the problem persists, you may need to deeply analyze the implementation and configuration of the server and the connection logic of the client to find the root cause and solve it. In some complex cases, it may be necessary to use network packet capture tools (such as Wireshark) to observe and analyze the communication details at the TCP level.

@kubbot
Copy link
Contributor

kubbot commented May 20, 2024

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.

@skiffer-git
Copy link
Member

deploying OpenIM is smoothy in release-v3.8 version, I recommend you update to this version, if you encounter new issue, please reopen this issue or open new issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
other Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

4 participants