v2ray / v2ray-core

A platform for building proxies to bypass network restrictions.
https://www.v2ray.com/
MIT License
45.28k stars 8.94k forks source link

[resolved] #1103

Closed KazamaSion closed 6 years ago

KazamaSion commented 6 years ago

1) 服务端版本:V2Ray v3.21(无需客户端版本)
3) 报错: Main: failed to read config file: /etc/v2ray/config.json > proto: can't skip unknown wire type 6 for core.Config

KazamaSion commented 6 years ago

resolve

longercui commented 6 years ago

这个问题怎么解决的?

RoyLi-Pvt commented 6 years ago

同问 archlinux的3.21-1 (CLI显示3.22) 还在报这个错误

sunliang711 commented 6 years ago

我在mac上使用v2ray也报这个错啊,配置文件里加了routing就报这个,去掉就不会。同样的配置在linux上可以使用,这是为啥呢?

279632990 commented 6 years ago

@TMily 删除routing就可以了

RoyLi-Pvt commented 6 years ago

@279632990 然而我配置了多个互相隔离的传入连接 是必须使用routing的啊~~

longercui commented 6 years ago

我解决了,都是config文件的语法和层级错误导致。几个数组文件块里面如果有内容,要用[ ],用花括号同样报错。大家可以留意下。

RoyLi-Pvt commented 6 years ago

@longercui 同样的配置文件,使用V2Ray的官方docker是可以运行的但是直接用本机的包就会报错,同时删除中文注释后用在线Json校验工具检验也都没有发现错误.这个情况看起来并不像是Json格式错误,而且配置文件在旧版本都是可以使用且未改动过的

RoyLi-Pvt commented 6 years ago

@longercui @sunliang711 @279632990 ~~我又测试了下似乎是这样的: routing配置节中如果包含 { "type": "chinasites", "outboundTag": "direct" } { "type": "chinaip", "outboundTag": "direct" } 这样的配置就会报错. 即使按照最新的文档将这些配置更新成: { "type": "field", "domain": [ "geosite:cn" ], "outboundTag": "direct" } { "type": "field", "ip": [ "geoip:cn", "geoip:private" ], "outboundTag": "direct" } 依然提示错误,只能暂时注释之.这样的话,除了能提供多个线路的分流外,routing配置节就没啥功能了.😓 不过类似 { "type": "field", "ip": [ "10.0.0.0/8", "100.64.0.0/10", "127.0.0.0/8" ], "outboundTag": "direct" } 这样的IP列表配置则不受影响还可以继续使用,域名列表没有测试,不过即使能用也得自己整理IP段和域名列表了.😓~~ 以上全是废话 最终的原因是 Arch Linux 中geoip.dat和geosite.dat两个文件在/etc/v2ray 而可执行文件在/usr/bin 在没有有效设置v2ray.location.asset或者V2RAY_LOCATION_ASSET之前 执行测试命令就会报错 😓

sunliang711 commented 6 years ago

@longercui 啥意思啊,能不能把你的配置文件贴出来看看

sunliang711 commented 6 years ago
...
    "outboundDetour":[
        {
            "protocol":"freedom",
            "settings":{},
            "tag":"direct"
        },
        {
            "protocol":"blackhole",
            "settings":{},
            "tag":"adblock"
        }
    ],
    "routing":{
        "strategy":"rules",
        "settings":{
            "domainStrategy":"IPIfNonMatch",
            "rules":[
                {
                    "domain":[
                        "ad.com",
                        "baidu.com"
                    ],
                    "type":"field",
                    "outboundTag":"adblock"
                },
                {
                    "domain":[
                        "qq.com"
                    ],
                    "type":"field",
                    "outboundTag":"direct"
                },
                {
                    "type":"chinasites",
                    "outboundTag":"direct"
                },
                {
                    "type":"chinaip",
                    "outboundTag":"direct"
                }
            ]
        }
    }

我这个有啥问题吗