v2ray / v2ray-core

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

CentOS 7 x64 下全新安装后无法启动 #1047

Closed shension closed 6 years ago

shension commented 6 years ago

1) 你正在使用哪个版本的 V2Ray?(如果服务器和客户端使用了不同版本,请注明) v3.17

2) 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。 安装后启动失败

3) 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等) Linux版本 CentOS 7 x64 内核版本:4.16.2-1.el7.elrepo.x86_64 通过命令行:bash <(curl -L -s https://install.direct/go.sh) ,安装后启动失败:

[root@cross ~]# systemctl status v2ray.service ● v2ray.service - V2Ray Service Loaded: loaded (/etc/systemd/system/v2ray.service; enabled; vendor preset: disabled) Active: failed (Result: start-limit) since Fri 2018-04-13 07:01:54 UTC; 3min 31s ago Process: 1561 ExecStart=/usr/bin/v2ray/v2ray -config /etc/v2ray/config.json (code=exited, status=255) Main PID: 1561 (code=exited, status=255)

Apr 13 07:01:53 cross systemd[1]: v2ray.service: main process exited, code=exited, status=255/n/a Apr 13 07:01:53 cross systemd[1]: Unit v2ray.service entered failed state. Apr 13 07:01:53 cross systemd[1]: v2ray.service failed. Apr 13 07:01:54 cross systemd[1]: v2ray.service holdoff time over, scheduling restart. Apr 13 07:01:54 cross systemd[1]: start request repeated too quickly for v2ray.service Apr 13 07:01:54 cross systemd[1]: Failed to start V2Ray Service. Apr 13 07:01:54 cross systemd[1]: Unit v2ray.service entered failed state. Apr 13 07:01:54 cross systemd[1]: v2ray.service failed.

4) 你期待看到的正确表现是怎样的? 正常启动

5) 请附上你的配置(提交 Issue 前请隐藏服务器端IP地址)。

服务器端配置:
{
  "log" : {
    "access": "/var/log/v2ray/access.log",
    "error": "/var/log/v2ray/error.log",
    "loglevel": "warning"
  },
  "inbound": {
    "port": 9001,
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "286c55c2-1243-4ab3-80f7-d9ee00830fff",
          "level": 1,
          "alterId": 64,
          "security": "aes-128-gcm"
        }
      ]
    }
  },

  "inboundDetour": [
    {
      "protocol": "shadowsocks",
      "port": 9002, 
      "settings": {
        "method": "aes-256-cfb", 
        "password": "cross",  
        "udp": false
      }
    }
  ],

  "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"
        }
      ]
    }
  }
}
客户端配置:
{
  "log" : {
    "access": "/var/log/v2ray/access.log",
    "error": "/var/log/v2ray/error.log",
    "loglevel": "warning"
  },
  "inbound": {
    "port": 9001,
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "286c55c2-1243-4ab3-80f7-d9ee00830fff",
          "level": 1,
          "alterId": 64,
          "security": "aes-128-gcm"
        }
      ]
    }
  },

  "inboundDetour": [
    {
      "protocol": "shadowsocks",
      "port": 9002, 
      "settings": {
        "method": "aes-256-cfb", 
        "password": "cross",  
        "udp": false
      }
    }
  ],

  "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"
        }
      ]
    }
  }
}

6) 请附上出错时软件输出的错误日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。

服务器端错误日志:
    // 在这里附上服务器端日志

/var/log/v2ray/ 目录下无文件

客户端错误日志:
    // 在这里附上客户端日志

7) 请附上访问日志。在 Linux 中,日志通常在 /var/log/v2ray/access.log 文件中。

    // 在这里附上服务器端日志

/var/log/v2ray/ 目录下无文件

8) 其它相关的配置文件(如 Nginx)和相关日志。

请预览一下你填的内容再提交。

如果你已经填完上面的问卷,请把下面的英文部份删除,再提交 Issue。

DarienRaymond commented 6 years ago

运行一下 /usr/bin/v2ray/v2ray -config /etc/v2ray/config.json -test 看一下输出

shension commented 6 years ago

[root@cross ~]# /usr/bin/v2ray/v2ray -config /etc/v2ray/config.json -test V2Ray v3.17 (die Commanderin) 20180412 A unified platform for anti-censorship. Main: failed to read config file: /etc/v2ray/config.json > Main|Json: failed to execute v2ctl to convert config file. > read |0: file already closed

HumphreyZhou commented 6 years ago

与楼主出现相同问题

huijiewei commented 6 years ago

一样的问题

DarienRaymond commented 6 years ago

请试一下 3.17.2

huijiewei commented 6 years ago

3.17.2 也有问题,提示错误变成了 failed to read config file: /etc/v2ray/config.json > unexpected EOF

DarienRaymond commented 6 years ago

@huijiewei 你也是 CentOS 吗?

huijiewei commented 6 years ago

@DarienRaymond 对的

Operating system: | Centos 7 x86_64 bbr

DarienRaymond commented 6 years ago

@huijiewei 能贴一下配置文件吗

shension commented 6 years ago

@DarienRaymond 和配置文件应该无关,我在 Vultr 部署了一台 Ubuntu 17.10 x64 ,同样的配置文件,完全正常。

DarienRaymond commented 6 years ago

试一下 3.17.3

shension commented 6 years ago

@DarienRaymond 在 Vultr 重装了系统,版本CentOS 7 x64,然后先使用秋水逸冰的一键脚本安装BBR:wget --no-check-certificate https://github.com/teddysun/across/raw/master/bbr.sh && chmod +x bbr.sh && ./bbr.sh ,确认成功后,使用官方一键脚本安装v2ray:bash <(curl -L -s https://install.direct/go.sh) ,和上面 Ubuntu 同样的配置文件,还是无法启动: [root@cross ~]# service v2ray status Redirecting to /bin/systemctl status v2ray.service ● v2ray.service - V2Ray Service Loaded: loaded (/etc/systemd/system/v2ray.service; enabled; vendor preset: disabled) Active: failed (Result: start-limit) since Fri 2018-04-13 12:57:08 UTC; 13s ago Process: 1160 ExecStart=/usr/bin/v2ray/v2ray -config /etc/v2ray/config.json (code=exited, status=255) Main PID: 1160 (code=exited, status=255)

Apr 13 12:57:08 cross systemd[1]: v2ray.service: main process exited, code=exited, status=255/n/a Apr 13 12:57:08 cross systemd[1]: Unit v2ray.service entered failed state. Apr 13 12:57:08 cross systemd[1]: v2ray.service failed. Apr 13 12:57:08 cross systemd[1]: v2ray.service holdoff time over, scheduling restart. Apr 13 12:57:08 cross systemd[1]: start request repeated too quickly for v2ray.service Apr 13 12:57:08 cross systemd[1]: Failed to start V2Ray Service. Apr 13 12:57:08 cross systemd[1]: Unit v2ray.service entered failed state. Apr 13 12:57:08 cross systemd[1]: v2ray.service failed.

DarienRaymond commented 6 years ago

测试版需要手动安装的

Doublemine commented 6 years ago

我在两台centos上Docker中测试复现了此问题,最新的v3.17镜像v2ray/officialv2ray/dev皆有问题。

docker pull v2ray/official
docker run --rm v2ray/official 

错误信息:

V2Ray v3.17 (die Commanderin) 20180412
A unified platform for anti-censorship.
Main: failed to read config file: /etc/v2ray/config.json > Main|Json: failed to execute v2ctl to convert config file. > read |0: file already closed

贴一下两台测试环境信息:


  Virtualization: kvm
  Operating System: CentOS Linux 7 (Core)
  CPE OS Name: cpe:/o:centos:centos:7
  Kernel: Linux 3.10.0-693.11.6.el7.x86_64
  Architecture: x86-64
Server Version: 18.03.0-ce
Storage Driver: overlay
 Backing Filesystem: extfs
 Supports d_type: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: error
 NodeID:
 Is Manager: false
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: cfd04396dc68220d1cecbe686a6cc3aa5ce3667c
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 3.10.0-693.11.6.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 1
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
 provider=generic
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: bridge-nf-call-ip6tables is disabled

Virtualization: kvm
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-693.21.1.el7.x86_64
Architecture: x86-64

Server Version: 18.03.0-ce
Storage Driver: overlay2
 Backing Filesystem: xfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: cfd04396dc68220d1cecbe686a6cc3aa5ce3667c
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 3.10.0-693.21.1.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 1
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

与之对应的,在另一台Ubuntu机器上无此问题:

Virtualization: kvm
Operating System: Ubuntu 17.10
Kernel: Linux 4.9.76.etherflap.kvm-xeon.9
Architecture: x86-64
Server Version: 18.03.0-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: cfd04396dc68220d1cecbe686a6cc3aa5ce3667c
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.76.etherflap.kvm-xeon.9
Operating System: Ubuntu 17.10
OSType: linux
Architecture: x86_64
CPUs: 1
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
huijiewei commented 6 years ago

@DarienRaymond 3.17.3 没有问题

shension commented 6 years ago

@DarienRaymond 3.17.3 没问题

HumphreyZhou commented 6 years ago

一台vps(centos 7)没有问题。另外一台相同系统,提示rejected Proxy|Socks: insufficient header > read tcp 127.0.0.1:1080->127.0.0.1:5345: i/o timeout。都是全新安装

HumphreyZhou commented 6 years ago

经过排查,系客户端软件问题,已经修复。3.17.3 的确修复了centos系统的问题