解决 Xray-core 报错 failed to detect inbound user 鉴权失败修复
排查 Xray-core 服务端提示 failed to detect inbound user / invalid user UUID 错误,排查客户端 ID 与 XTLS flow 参数配置。
问题现象
客户端连接基于 VLESS 协议的 Xray 服务端时握手失败,服务端日志输出警告:
[Warning] [12345678] proxy/vless/inbound: failed to detect inbound user
from 203.0.113.10:54123 > invalid user
触发根因
- 客户端传入的 UUID 与服务端配置的
id不匹配:UUID 字符串存在多余空格、大小写差异或配置失误; - XTLS 流控(Flow)参数不一致:服务端启用了最新的
xtls-rprx-vision,而客户端填写了旧版或留空,导致协议协商失败; - 客户端系统时间与服务端相差超过 90 秒(针对 VMess 协议)。
解决步骤
1. 核对并生成规范的 VLESS 客户端配置
在服务端使用 xray uuid 生成标准 UUID,并严格写入双方配置:
服务端 config.json:
{
"inbounds": [{
"port": 443,
"protocol": "vless",
"settings": {
"clients": [{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"flow": "xtls-rprx-vision"
}],
"decryption": "none"
},
"streamSettings": {
"network": "tcp",
"security": "reality"
}
}]
}
确保客户端将相同的 UUID 填入 id 字段,且 flow 同步设置为 xtls-rprx-vision。
验证确认
在客户端发起访问请求:
服务端成功打印 [Info] proxy/vless/inbound: accepted connection,鉴权顺利通过。


