Skip to content

[BUG] Agent v1.2.0 在纯 IPv6 环境下启动后无网络请求 无上报 已设置github等网站的host配置ipv6地址 #526

@zhangjiabo522

Description

@zhangjiabo522

============================================

Komari Agent 安装问题 - 纯 IPv6 环境连接失败

============================================

1. 系统环境

#被控系统 Debian 11
#主控系统 Debian 12

被控端:纯 IPv6 环境

主控端:仅 IPv4,通过 Cloudflare Tunnel 暴露服务

2. 安装命令(使用 HTTP)

wget -qO- https://raw.githubusercontent.com/komari-monitor/komari-agent/refs/heads/main/install.sh | sudo bash -s -- -e http://w.fwq.jx.fyi -t xxxxx --disable-auto-update --memory-include-cache

3. 安装输出

===========================================
Komari Agent Installation Script

[CONFIG] Installation configuration:
[CONFIG] Service name: komari-agent
[CONFIG] Install directory: /opt/komari
[CONFIG] GitHub proxy: (direct)
[CONFIG] Binary arguments: -e http://w.fwq.jx.fyi -t xxxxx --disable-auto-update --memory-include-cache
[CONFIG] Agent version: Latest

Checking for previous installation...
Checking and installing dependencies...
Dependencies already satisfied
Detected OS: linux, Architecture: amd64
No version specified, installing the latest version.
Creating installation directory: /opt/komari
Downloading komari-agent-linux-amd64 directly...
URL: https://github.com/komari-monitor/komari-agent/releases/latest/download/komari-agent-linux-amd64
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 10.9M 100 10.9M 0 0 15.6M 0 --:--:-- --:--:-- --:--:-- 15.6M
Komari-agent installed to /opt/komari/agent
Configuring system service...
Detected init system: systemd
Using systemd for service management
Created symlink /etc/systemd/system/multi-user.target.wants/komari-agent.service → /etc/systemd/system/komari-agent.service.
Systemd service configured and started

===========================================
Komari-agent installation completed!
[CONFIG] Service: komari-agent
[CONFIG] Arguments: -e http://w.fwq.jx.fyi -t xxxxx --disable-auto-update --memory-include-cache

4. 查看服务状态(无后续日志输出)

sudo journalctl -u komari-agent -n 50 --no-pager

-- Journal begins at Sat 2026-05-09 23:58:58 CST, ends at Sun 2026-05-10 00:02:29 CST. --
May 10 00:01:52 u4836-t8gyif06 systemd[1]: Started Komari Agent Service.
May 10 00:01:52 u4836-t8gyif06 agent[2810]: 2026/05/10 00:01:52 Komari Agent 1.2.0
May 10 00:01:52 u4836-t8gyif06 agent[2810]: 2026/05/10 00:01:52 Github Repo: komari-monitor/komari-agent
May 10 00:01:52 u4836-t8gyif06 agent[2810]: 2026/05/10 00:01:52 Using system default DNS resolver
May 10 00:01:52 u4836-t8gyif06 agent[2810]: 2026/05/10 00:01:52 Monitoring Mountpoints: [/ (zfs)]
May 10 00:01:52 u4836-t8gyif06 agent[2810]: 2026/05/10 00:01:52 Monitoring Interfaces: [sit0 eth0 eth1]

注意:启动后没有任何网络请求日志(没有 "Uploading basic info" 或 "Connecting to WebSocket")

5. 手动运行 Agent(前台模式)

sudo systemctl stop komari-agent
sudo /opt/komari/agent -e http://w.fwq.jx.fyi -t xxxxx --disable-auto-update --memory-include-cache

2026/05/10 00:04:57 Komari Agent 1.2.0
2026/05/10 00:04:57 Github Repo: komari-monitor/komari-agent
2026/05/10 00:04:57 Using system default DNS resolver
2026/05/10 00:04:57 Monitoring Mountpoints: [/ (zfs)]
2026/05/10 00:04:57 Monitoring Interfaces: [sit0 eth0 eth1]

手动运行同样没有网络请求,卡在初始化阶段

6. 测试 HTTP 连接(成功)

curl -v http://w.fwq.jx.fyi/api/version

  • Trying 2606:4700:3035::ac43:b91f:80...
  • Connected to w.fwq.jx.fyi (2606:4700:3035::ac43:b91f) port 80 (#0)

GET /api/version HTTP/1.1
Host: w.fwq.jx.fyi
User-Agent: curl/7.74.0
Accept: /

  • Mark bundle as not supporting multiuse
    < HTTP/1.1 200 OK
    < Date: Sat, 09 May 2026 16:03:50 GMT
    < Content-Type: application/json; charset=utf-8
    < Content-Length: 110
    < Connection: keep-alive
    < Cache-Control: no-store
    < cf-cache-status: DYNAMIC
    < Server: cloudflare
    <
    {"status":"success","message":"","data":{"hash":"567d2b66fb5d05545abd89a2843f1c7c94e8fff4","version":"1.2.0"}}

HTTP 连接正常,API 响应成功

7. 测试 HTTPS 连接(失败 - TLS 握手失败)

curl -v https://w.fwq.jx.fyi/api/version

  • Trying 2606:4700:3031::6815:4883:443...
  • Connected to w.fwq.jx.fyi (2606:4700:3031::6815:4883) port 443 (#0)
  • ALPN, offering h2
  • ALPN, offering http/1.1
  • successfully set certificate verify locations:
  • CAfile: /etc/ssl/certs/ca-certificates.crt
  • CApath: /etc/ssl/certs
  • TLSv1.3 (OUT), TLS handshake, Client hello (1):
  • TLSv1.3 (IN), TLS alert, handshake failure (552):
  • error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure
  • Closing connection 0
    curl: (35) error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure

HTTPS 连接失败,TLS 握手失败

8. 查看 Agent 进程参数

ps aux | grep agent

root 2810 0.0 1.7 1231412 4404 ? Ssl 00:01 0:00 /opt/komari/agent -e http://w.fwq.jx.fyi -t xxxxx --disable-auto-update --memory-include-cache

9. 查看服务文件

cat /etc/systemd/system/komari-agent.service

[Unit]
Description=Komari Agent Service
After=network.target

[Service]
Type=simple
ExecStart=/opt/komari/agent -e http://w.fwq.jx.fyi -t xxxxx --disable-auto-update --memory-include-cache
WorkingDirectory=/opt/komari
Restart=always
User=root

[Install]
WantedBy=multi-user.target

10. DNS 解析结果

getent ahosts w.fwq.jx.fyi

2606:4700:3035::ac43:b91f STREAM w.fwq.jx.fyi
2606:4700:3035::ac43:b91f DGRAM
2606:4700:3035::ac43:b91f RAW
2606:4700:3031::6815:4883 STREAM
2606:4700:3031::6815:4883 DGRAM
2606:4700:3031::6815:4883 RAW
172.67.185.31 STREAM
172.67.185.31 DGRAM
172.67.185.31 RAW
104.21.72.131 STREAM
104.21.72.131 DGRAM
104.21.72.131 RAW

============================================

问题总结

============================================

1. Agent 安装成功,服务启动正常

2. Agent 启动后没有网络请求日志,卡在初始化阶段

3. HTTP 手动测试成功(主控 API 正常响应)

4. HTTPS 手动测试失败(TLS 握手失败)

5. 其他有 IPv4 和IPv6 的被控服务器使用相同配置(HTTPS + 主域名)正常工作

6. 问题仅出现在纯 IPv6 环境 + Cloudflare 代理的场景(有些机器就可以正常上报有些接不可以)

============================================

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