提交 Issue 之前请先阅读 Issue 指引,然后回答下面的问题,谢谢。
Please read the instruction and answer the following questions before submitting your issue. Thank you.
1) 你正在使用哪个版本的 V2Ray?(如果服务器和客户端使用了不同版本,请注明)
What version of V2Ray are you using (If you deploy different version on server and client, please explicitly point out)?
服务器端版本:v2ray for FreeBSD 11 (x64), version: 2.33.1
客户端版本:V2RayX for Mac, 0.7.8(1). MacOS X version: 10.12.6
2) 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。
What's your scenario of using V2Ray? E.g., Watching YouTube videos in Chrome via Socks/VMess proxy.
使用Chrome通过VMess代理使用Google搜索引擎,浏览facebook,twitter等。
3) 你看到的不正常的现象是什么?
What did you see?
Chrome 无法像往常一样通过代理打开网页,在server端查看socket发现无连接,在/var/log/v2ray/access.log 中发现如下记录:
2017/08/08 11:21:28 47.90.83.115:49451 rejected Proxy|VMess|Encoding: invalid user。
奇怪的地方有几点:
更新:
2018-08-10:经过对比,发现提示invalid user所对应的IP地址,仅有一个记录是我的公网IP,其他的应该是有人在扫描或尝试连接我的VPS,如此说来,我的很多连接请求就根本没有到达VPS,是不是GFW又升级了?或是我的客户端配置不正确?请告知。
家庭网络为电信,尝试过联通4G,同样的结果。
4) 你期待看到的正确表现是怎样的?
What's your expectation?
-a) 如果确实被reject,那应该每一次reject要对应一条记录
-b) 如果UUID一致,而是因为其他原因导致的reject,这里不应该出现invalid user报错(个人理解)。
5) 请附上你的配置文件(提交 Issue 前请隐藏服务器端IP地址)。
Please attach your configuration file (Mask IP addresses before submit this issue).
Server Configuration File(服务器端配置文件):
{
"log" : {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"inbound": {
"port": 4433,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "ad1de01c-1165-4f7f-8838-d373a0bb8000",
"level": 1,
"alterId": 64
}
]
}
},
"outbound": {
"protocol": "freedom",
"settings": {}
},
"outboundDetour": [
{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}
],
"routing": {
"strategy": "rules",
"settings": {
"rules": [
{
"type": "field",
"ip": [
"0.0.0.0/8",
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
],
"outboundTag": "blocked"
}
]
}
}
}
Client Configuration File(客户端配置文件):
{
"dns" : {
"servers" : [
"localhost"
]
},
"outboundDetour" : [
{
"protocol" : "freedom",
"tag" : "direct",
"settings" : {
}
}
],
"inbound" : {
"listen" : "127.0.0.1",
"port" : 1080,
"protocol" : "socks",
"settings" : {
"ip" : "127.0.0.1",
"auth" : "noauth"
},
"allowPassive" : false
},
"inboundDetour" : [
{
"listen" : "127.0.0.1",
"allocate" : {
"strategy" : "always",
"refresh" : 5,
"concurrency" : 3
},
"port" : 8001,
"protocol" : "http",
"tag" : "httpDetour",
"domainOverride" : [
"http",
"tls"
],
"streamSettings" : {
},
"settings" : {
"timeout" : 0
}
}
],
"log" : {
"loglevel" : "warning"
},
"routing" : {
"strategy" : "rules",
"settings" : {
"domainStrategy" : "IPIfNonMatch",
"rules" : [
{
"port" : "1-52",
"type" : "field",
"outboundTag" : "direct"
},
{
"port" : "54-79",
"type" : "field",
"outboundTag" : "direct"
},
{
"port" : "81-442",
"type" : "field",
"outboundTag" : "direct"
},
{
"port" : "444-65535",
"type" : "field",
"outboundTag" : "direct"
},
{
"type" : "chinasites",
"outboundTag" : "direct"
},
{
"type" : "field",
"ip" : [
"0.0.0.0\/8",
"10.0.0.0\/8",
"100.64.0.0\/10",
"127.0.0.0\/8",
"169.254.0.0\/16",
"172.16.0.0\/12",
"192.0.0.0\/24",
"192.0.2.0\/24",
"192.168.0.0\/16",
"198.18.0.0\/15",
"198.51.100.0\/24",
"203.0.113.0\/24",
"::1\/128",
"fc00::\/7",
"fe80::\/10"
],
"outboundTag" : "direct"
},
{
"type" : "chinaip",
"outboundTag" : "direct"
}
]
}
},
"outbound" : {
"protocol" : "vmess",
"mux" : {
"enabled" : false
},
"streamSettings" : {
"network" : "tcp",
"tcpSettings" : {
"connectionReuse" : true,
"header" : {
"type" : "none"
}
},
"kcpSettings" : {
"header" : {
"type" : "none"
},
"mtu" : 1350,
"congestion" : false,
"tti" : 50,
"uplinkCapacity" : 5,
"writeBufferSize" : 1,
"readBufferSize" : 2,
"downlinkCapacity" : 20
},
"security" : "none",
"tlsSettings" : {
"allowInsecure" : false
},
"wsSettings" : {
"path" : "",
"connectionReuse" : true
}
},
"settings" : {
"vnext" : [
{
"address" : "x.x.x.x",
"port" : 4433,
"users" : [
{
"id" : "ad1de01c-1165-4f7f-8838-d373a0bb8000",
"alterId" : 64,
"security" : "aes-128-cfb"
}
]
}
]
}
}
}
6) 请附上出错时软件输出的日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。
Please attach the log file, especially the bottom lines if the file is large. Log file is usually /var/log/v2ray/error.log on Linux.
Server Log File(服务器端日志):
[*********]#more /var/log/v2ray/error.log
2017/07/24 00:05:47 [Warning]Core: V2Ray started
2017/07/24 00:13:44 [Warning]Core: V2Ray started
2017/07/24 00:21:19 [Warning]Core: V2Ray started
2017/07/26 15:57:31 [Warning]Core: V2Ray started
2017/07/26 16:01:26 [Warning]Core: V2Ray started
2017/07/26 17:07:11 [Warning]Core: V2Ray started
2017/08/03 11:25:23 [Warning]Core: V2Ray started
2017/08/07 09:09:12 [Warning]Core: V2Ray started
2017/08/07 10:50:08 [Warning]Core: V2Ray started
2017/08/08 13:20:13 [Warning]Core: V2Ray started
2017/08/08 13:25:43 [Warning]Core: V2Ray started
Client Log File(客户端日志):
请告知如何导出Mac客户端日志?
alterId 是不是不一样
@ToutyRater alterId 是一致的。
@joostshao 时区一致,都是GMT+08:00 (CST)
客户端如果用的是V2RayX,生成的配置文件是没有 log 这个模块的
配置文件一般在 ~/Library/Application Support/V2RayX 这个路径 你可以自己看下
而且每次操作客户端 都会重新生成一遍配置文件
如果想要开启客户端日志 还是直接起后台客户端进程吧
@wqqdhero 谢谢你,已经把客户端config贴上去了,请看一下。
你客户端配置的 kcp 但是服务端没有配啊
https://toutyrater.github.io/advanced/mkcp.html
仔细看看这个 服务端也要有 streamSettings.kcpSettings 这块配置的
@steveyoung81 你客户端的传输设置 别用 kcp 了 直接 tcp 吧 简单
用 kcp 有时还被运营商限流 会有断流现象的
@wqqdhero 我用的是TCP呀,没有用KCP。
你说的是这段配置吧?
"streamSettings" : {
"network" : "tcp",
"tcpSettings" : {
"connectionReuse" : true,
"header" : {
"type" : "none"
}
@steveyoung81 不好意思 前面看错了
暂时看不出来问题
等等看有没有大佬出现吧
我遇到了相似的问题。具体表现为以下几点:
1.服务端access.log文件记录了大量 “rejected Proxy|VMess|Encoding: invalid user” 类型的错误。并且有些IP为陌生IP。
2.服务端error.log文件记录了大量“2017/08/31 20:59:34 [Warning]Transport|Internet|TCP: failed to accepted raw connections > Retry: [accept tcp [::]:16460: use of closed network connection] > Retry: all retry attempts failed”类型错误。该记录时间为每5分钟2次。与动态端口每5分钟刷新一次,每次开通两个端口的设置相吻合。
通过对比日志问题产生的时间,确实在那个时间点在服务端配置了动态端口的设置。回滚到之前的配置版本。也就是取消了动态端口的配置,上面两种错误即不再出现。所以我的问题基本可以定位到动态端口的配置问题。但是你的配置文件中并没有配置动态端口,我们的日志又显示相似的错误,所以感觉很奇怪。
目前仍然对这个问题感到困惑,希望@steveyoung81发现原因后能够进一步说明。
@Sense82 请问你是回滚的server端还是client端?谢谢!
@steveyoung81
回滚服务端配置,也就是去掉了动态端口的配置,其他的没有变化。
动态端口并不需要在客户端配置,所以客户端配置并无变化。
@Sense82 谢谢你,请问你回滚到哪个版本?我刚试了最新的2.36版,依然不行,可能需要换成比较低的版本。请告知一下,谢谢!
@steveyoung81
服务器和客户端均为2.34版本。2.36版本只是预览版本。
我之前的主要问题是动态端口的问题,更改配置文件,删除动态端口的配置就好了。
另外,我看到你的客户端有以下配置:
"inboundDetour" : [
{
"listen" : "127.0.0.1",
"allocate" : {
"strategy" : "always",
"refresh" : 5,
"concurrency" : 3
},
"port" : 8001,
"protocol" : "http",
"tag" : "httpDetour",
"domainOverride" : [
"http",
"tls"
],
"streamSettings" : {
},
"settings" : {
"timeout" : 0
}
}
感觉很奇怪,为什么要在客户端配置动态端口?动态端口的配置应该在服务端才能生效。建议重新配置客户端文件。
或者你的客户端和服务端文件贴反了。你的服务端应该没有开启kcp,客户端加上也没用呀。
建议你重新阅读v2ray的配置说明,重新捋一下服务端和客户端的配置,区分哪些东西应该在服务端配置,哪些东西应该在客户端配置。
@Sense82 谢谢你,我用的是Mac端的客户端,这个配置文件不是我写的,是程序自动生成的。我删除掉了那个文件,打开客户端App了之后,配置居然还在,我得研究一下这个到底是什么问题。
PS:我在server端开启tcpdump抓包,根本看不到有TCP SYN进来,我怀疑是不是方校长的问题。。。(╯‵□′)╯︵┻━┻
我也遇到了 rejected Proxy|VMess|Encoding: invalid user
解决方案很简单,确认配置都没问题的情况下,客户端和服务端都成功同步一次时间就好。
我也碰到这个问题,同步下时间就好了.ntpdate -u time.nist.gov
我的也出现了这个问题,照着上面各位的方式试了一遍,发现还是不可以,谁能帮我看一下这个问题呢?
4.17.0 (Po);
[root@ss-us ~]# date -R
Mon, 25 Feb 2019 13:48:11 +0800
{
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"inbounds": [
{
"port": 14875,
"protocol": "vmess",
"listen": "127.0.0.1",
"settings": {
"clients": [
{
"id": "e2edb465-a814-4124-bb33-1eb4991194df",
"level": 1,
"alterId": 64
}
],
"streamSettings": {
"network": "ws",
"wsSettings": {
"path": "/"
}
}
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
}
]
}
{
"inbound": [
{
"localPort": 1080,
"protocol": "socks",
"udpEnabled": true,
"sniffingEnabled": true
}
],
"logEnabled": false,
"loglevel": "warning",
"index": 0,
"vmess": [
{
"configVersion": 2,
"address": "hi.4spaces.org",
"port": 443,
"id": "e2edb465-a814-4124-bb33-1eb4991194df",
"alterId": 64,
"security": "auto",
"network": "ws",
"remarks": "v2ray-us",
"headerType": "none",
"requestHost": "",
"path": "/",
"streamSecurity": "tls",
"allowInsecure": "true",
"configType": 1,
"testResult": "",
"subid": ""
}
],
"muxEnabled": true,
"domainStrategy": "IPIfNonMatch",
"routingMode": "0",
"useragent": [],
"userdirect": [],
"userblock": [],
"kcpItem": {
"mtu": 1350,
"tti": 50,
"uplinkCapacity": 12,
"downlinkCapacity": 100,
"congestion": false,
"readBufferSize": 2,
"writeBufferSize": 2
},
"sysAgentEnabled": false,
"listenerType": 0,
"urlGFWList": null,
"allowLANConn": false,
"remoteDNS": null,
"subItem": null,
"uiItem": {
"mainQRCodeWidth": 600
}
}
2019/02/25 13:53:54 127.0.0.1:30572 rejected v2ray.com/core/proxy/vmess/encoding: invalid user
2019/02/25 13:53:55 127.0.0.1:30574 rejected v2ray.com/core/proxy/vmess/encoding: invalid user
2019/02/25 13:53:57 127.0.0.1:30576 rejected v2ray.com/core/proxy/vmess/encoding: invalid user
2019/02/25 13:53:58 127.0.0.1:30578 rejected v2ray.com/core/proxy/vmess/encoding: invalid user
请问谁能帮我看看问题出在哪里?
本机时间不正确,也会出现这个问题,微软时间同步服务器有时候会出现时间同步不正确的情况。
我也是这个问题,看了下时间正确以为不是时间的问题,结果校准后就能用了
root@vultr:~# ntpdate -u time.nist.gov
27 Apr 09:09:29 ntpdate[3100]: adjust time server 2610:20:6f97:97::4 offset -0.012956 sec
没想到只差了0.013秒居然也会影响v2ray
我也是这个问题,我以为id和时间都一致,但是时间有误差-0.088882 sec
tpdate -u time.nist.gov 出现no server suitable for synchronization found
解决方法
timedatectl set-ntp true 即可
我也碰到这个问题,同步下时间就好了.ntpdate -u time.nist.gov
Thanks 我的也是时间问题,服务端比客户端晚了三分钟,错误提示不太友好啊.
Most helpful comment
我也碰到这个问题,同步下时间就好了.ntpdate -u time.nist.gov