V2ray-core: v2ctl.exe GetStats报错:line 1.0: unmatched quote,但linux下v2ctl访问同一个服务正常

Created on 28 Apr 2019  ·  4Comments  ·  Source: v2ray/v2ray-core

1) 你正在使用哪个版本的 V2Ray?(如果服务器和客户端使用了不同版本,请注明)
都是v4.8.0
2) 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。
使用v2ctl获取流量统计数据
3) 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等)
windows下v2ctl.exe:

v2ctl.exe api --server=127.0.0.1:10085 StatsService.GetStats 'name: "inbound>>>agentin>>>traffic>>>uplink" reset: false'
v2ray.com/core/infra/control: failed to call service StatsService.GetStats > line 1.0: unmatched quote

但在windows 10 的linux子系统下安装linux版v2ray 4.8.0,访问宿主机的v2ray服务,可以正确得到结果:

 ./v2ctl api --server=127.0.0.1:10085 StatsService.GetStats 'name: "inbound>>>agentin>>>traffic>>>uplink" reset: false'
stat: <
  name: "inbound>>>agentin>>>traffic>>>uplink"
  value: 19868
>

4) 你期待看到的正确表现是怎样的?
应当有相同的效果
5) 请附上你的配置(提交 Issue 前请隐藏服务器端IP地址)。

服务器端配置:

    {
  "log": {
    "loglevel": "debug"
  },
  "inbounds": [
    {
      "port": 1080,
      "listen": "127.0.0.1",
      "protocol": "socks",
      "settings": {
        "auth": "noauth",
        "udp": false,
        "ip": "127.0.0.1"
      }
    },
    {
      "listen": "127.0.0.1",
      "port": 10085,
      "protocol": "dokodemo-door",
      "settings": {
        "address": "127.0.0.1"
      },
      "tag": "api"
    }
  ],
  "outbound": {
    "protocol": "vmess",
    "settings": {
      "vnext": [
        {
          "address": "sample.my.com",
          "port": 10902,
          "users": [
            {
              "id": "sample-aaaa-aaaa-aaaa-sample",
              "alterId": 64,
              "security": "auto"
            }
          ]
        }
      ]
    },
    "tag": "agentout",
    "streamSettings": {}
  },
  "routing": {
    "settings": {
      "rules": [
        {
          "inboundTag": [
            "api"
          ],
          "outboundTag": "api",
          "type": "field"
        }
      ]
    },
    "strategy": "rules"
  },
  "policy": {
    "levels": {
      "0": {
        "statsUserUplink": true,
        "statsUserDownlink": true
      }
    },
    "system": {
      "statsInboundUplink": true,
      "statsInboundDownlink": true
    }
  },
  "stats": {},
  "api": {
    "services": [
      "HandlerService",
      "StatsService"
    ],
    "tag": "api"
  }
}

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

2019/04/28 19:47:46 [Debug] [710622107] v2ray.com/core/proxy/dokodemo: processing connection from: 127.0.0.1:64617
2019/04/28 19:47:46 [Info] [710622107] v2ray.com/core/app/dispatcher: taking detour [api] for [tcp:127.0.0.1:0]
2019/04/28 19:52:36 [Debug] [3116905246] v2ray.com/core/proxy/dokodemo: processing connection from: 127.0.0.1:64990
2019/04/28 19:52:36 [Info] [3116905246] v2ray.com/core/app/dispatcher: taking detour [api] for [tcp:127.0.0.1:0]
Bug Next Stale

Most helpful comment

windows的cmd对引号处理得很谜。
传送门 https://github.com/v2ray/discussion/issues/17#issuecomment-412248981

All 4 comments

windows的cmd对引号处理得很谜。
传送门 https://github.com/v2ray/discussion/issues/17#issuecomment-412248981

应该确定一下这个问题是不是cmd的锅。如果是的话,那就需要用户自己根据cmd的语法来使用cmd了。

+1

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

Was this page helpful?
0 / 5 - 0 ratings