Skip to content

[BUG] 大面积掉线 Failed to POST v2 report: invalid character '<' looking for beginning of value #553

@cxyax

Description

@cxyax

描述BUG/Describe the Bug

续接issue #545 ,按照佬的回复看了一下,有些版本就已经是1.2.13了,有些升级了(重新执行安装命令)之后还是无法连接,请问后续还有需要什么操作的命令什么的吗?还是自动就连接了

截图/Screenshots

Image Image

环境/Environment

  • OS: Centos 7
  • 浏览器/Browser: *
  • 版本/Version:
    - 服务端版本:1.1.3 (b62fb1f)
    - 客户端版本:1.2.13
  • 其他/Other relevant details:*

其他信息/Additional Context

日志信息:
[root@rcpuyqxfwgteqni ~]# sudo systemctl status komari-agent.service
● komari-agent.service - Komari Agent Service
Loaded: loaded (/etc/systemd/system/komari-agent.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2026-06-12 14:56:32 CST; 2min 20s ago
Main PID: 283309 (agent)
Tasks: 23
Memory: 8.6M
CGroup: /system.slice/komari-agent.service
└─283309 /opt/komari/agent -e https://ko--------------------

Jun 12 14:56:32 rcpuyqxfwgteqni agent[283309]: 2026/06/12 14:56:32 Komari Agent 1.2.13
Jun 12 14:56:32 rcpuyqxfwgteqni agent[283309]: 2026/06/12 14:56:32 Github Repo: komari-monitor/komari-agent
Jun 12 14:56:32 rcpuyqxfwgteqni agent[283309]: 2026/06/12 14:56:32 Using system default DNS resolver
Jun 12 14:56:32 rcpuyqxfwgteqni agent[283309]: 2026/06/12 14:56:32 Monitoring Mountpoints: [/boot (xfs) / (xfs)]
Jun 12 14:56:32 rcpuyqxfwgteqni agent[283309]: 2026/06/12 14:56:32 Monitoring Interfaces: [eth0 eth1]
Jun 12 14:56:32 rcpuyqxfwgteqni agent[283309]: 2026/06/12 14:56:32 Checking update...
Jun 12 14:56:33 rcpuyqxfwgteqni agent[283309]: 2026/06/12 14:56:33 Current version is the latest: 1.2.13
Jun 12 14:58:32 rcpuyqxfwgteqni agent[283309]: 2026/06/12 14:58:32 Error uploading basic info: invalid v2 JSON-RPC response: invalid character '<' looking for beginning of value, body: "<!D...vicon.ico" "
Jun 12 14:58:33 rcpuyqxfwgteqni agent[283309]: 2026/06/12 14:58:33 Attempting to connect to WebSocket...
Jun 12 14:58:33 rcpuyqxfwgteqni agent[283309]: 2026/06/12 14:58:33 v2 WebSocket endpoint failed (200 OK), falling back to v1 until this connection is lost
Jun 12 14:58:33 rcpuyqxfwgteqni agent[283309]: 2026/06/12 14:58:33 Failed to connect to WebSocket: 400 Bad Request
Jun 12 14:58:38 rcpuyqxfwgteqni agent[283309]: 2026/06/12 14:58:38 Retrying websocket connection, attempt: 1
Jun 12 14:58:38 rcpuyqxfwgteqni agent[283309]: 2026/06/12 14:58:38 Failed to connect to WebSocket: 400 Bad Request
Jun 12 14:58:43 rcpuyqxfwgteqni agent[283309]: 2026/06/12 14:58:43 Retrying websocket connection, attempt: 2
Jun 12 14:58:43 rcpuyqxfwgteqni agent[283309]: 2026/06/12 14:58:43 Failed to connect to WebSocket: 400 Bad Request
Jun 12 14:58:48 rcpuyqxfwgteqni agent[283309]: 2026/06/12 14:58:48 Retrying websocket connection, attempt: 3
Jun 12 14:58:48 rcpuyqxfwgteqni agent[283309]: 2026/06/12 14:58:48 Failed to connect to WebSocket: 400 Bad Request
Hint: Some lines were ellipsized, use -l to show in full.

nginx配置

1. 专门处理 WebSocket 请求

location /ws/ {
    proxy_pass http://127.0.0.1:25774;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;
    proxy_set_header Host $host;
}

# 2. 专门处理 Agent 的 API 请求
# 注意:如果你的后端程序接口就是 /api 开头,这样转发即可
location /api/ {
    proxy_pass http://127.0.0.1:25774;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
}

# 3. 专门处理前端网页/静态文件
location / {
    # 如果 /api 和 /ws 以外的请求全是网页,则转发到这里
    proxy_pass http://127.0.0.1:25774;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions