v2ray / v2ray-core

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

listen tcp 127.0.0.1:12054: bind: cannot assign requested address #2708

Closed kilolumen closed 3 years ago

kilolumen commented 4 years ago

除非特殊情况,请完整填写所有问题。不按模板发的 issue 将直接被关闭。 如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用Discussion进行讨论。

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

3) 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等)

root@hwsrv:~# systemctl status v2ray
● v2ray.service - V2Ray Service
   Loaded: loaded (/etc/systemd/system/v2ray.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2020-08-28 08:32:13 UTC; 2min 25s ago
     Docs: https://www.v2ray.com/
           https://www.v2fly.org/
  Process: 19411 ExecStart=/usr/bin/v2ray/v2ray -config /etc/v2ray/config.json (code=exited, status=255/EXCEPTION)
 Main PID: 19411 (code=exited, status=255/EXCEPTION)

Aug 28 08:32:13 hwsrv-533124.hostwindsdns.com systemd[1]: v2ray.service: Service RestartSec=100ms expired, scheduling restart.
Aug 28 08:32:13 hwsrv-533124.hostwindsdns.com systemd[1]: v2ray.service: Scheduled restart job, restart counter is at 5.
Aug 28 08:32:13 hwsrv-533124.hostwindsdns.com systemd[1]: Stopped V2Ray Service.
Aug 28 08:32:13 hwsrv-533124.hostwindsdns.com systemd[1]: v2ray.service: Start request repeated too quickly.
Aug 28 08:32:13 hwsrv-533124.hostwindsdns.com systemd[1]: v2ray.service: Failed with result 'exit-code'.
Aug 28 08:32:13 hwsrv-533124.hostwindsdns.com systemd[1]: Failed to start V2Ray Service.

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

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

服务器端配置:

    {
  "log": {
    "access": "/var/log/v2ray/access.log",
    "error": "/var/log/v2ray/error.log",
    "loglevel": "warning"
  },
  "inbounds": [
    {
      "port": 12914,
      "listen": "127.0.0.1",
      "tag": "VLESS-in",
      "protocol": "VLESS",
      "settings": {
        "clients": [
          {
            "id": "xxxxxxxxxxxxxxxxxxx",
            "alterId": 0
          }
        ],
        "decryption": "none"
      },
      "streamSettings": {
        "network": "ws",
        "wsSettings": {
          "path": "/xxxxxxx/"
        }
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {},
      "tag": "direct"
    },
    {
      "protocol": "blackhole",
      "settings": {},
      "tag": "blocked"
    }
  ],
  "dns": {
    "servers": [
      "https+local://1.1.1.1/dns-query",
      "1.1.1.1",
      "1.0.0.1",
      "8.8.8.8",
      "8.8.4.4",
      "localhost"
    ]
  },
  "routing": {
    "domainStrategy": "AsIs",
    "rules": [
      {
        "type": "field",
        "inboundTag": [
          "VLESS-in"
        ],
        "outboundTag": "direct"
      }
    ]
  }
}

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

服务器端错误日志:

    // 在这里附上服务器端日志
root@hwsrv:~# /usr/bin/v2ray/v2ray -config /etc/v2ray/config.json
V2Ray 4.27.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.14.6 linux/amd64)
A unified platform for anti-censorship.
Failed to start v2ray.com/core/app/proxyman/inbound: failed to listen TCP on 12054 > v2ray.com/core/transport/internet: failed to listen on address: 127.0.0.1:12054 > v2ray.com/core/transport/internet/websocket: failed to listen TCP on127.0.0.1:12054 > listen tcp 127.0.0.1:12054: bind: cannot assign requested address

lsof -i 看过端口,没有被占用

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days