【问题标题】:"Incorrect number of arguments" error while deploying using 'murder'使用“谋杀”部署时出现“参数数量不正确”错误
【发布时间】:2012-07-09 06:47:23
【问题描述】:

输入peer命令后,显示如下错误:

** [out :: 172.23.99.7] Incorrect number of arguments
** [out :: 172.23.99.7] 
** [out :: 172.23.99.7] Usage:
** [out :: 172.23.99.7] python murder_client.py peer/seed out.torrent OUT.OUT 127.0.0.1
** [out :: 172.23.99.7] 
** [out :: 172.23.99.7] The last parameter is the local ip address, normally 10.x.x.x
** [out :: 172.23.99.7] 
** [out :: 172.23.99.5] Incorrect number of arguments
** [out :: 172.23.99.5] 
** [out :: 172.23.99.5] Usage:
** [out :: 172.23.99.5] python murder_client.py peer/seed out.torrent OUT.OUT 127.0.0.1
** [out :: 172.23.99.5] 
** [out :: 172.23.99.5] The last parameter is the local ip address, normally 10.x.x.x
** [out :: 172.23.99.5] 
** [out :: 172.23.98.78] Incorrect number of arguments
** [out :: 172.23.98.78] 
** [out :: 172.23.98.78] Usage:
** [out :: 172.23.98.78] python murder_client.py peer/seed out.torrent OUT.OUT 127.0.0.1
** [out :: 172.23.98.78] 
** [out :: 172.23.98.78] The last parameter is the local ip address, normally 10.x.x.x
** [out :: 172.23.98.78] 
command finished

failed: "sh -c 'python /u/apps/example-app/shared/murder/murder_client.py peer       '\''/tmp/Test_2.tgz.torrent'\'' '\''/tmp/Test_2.tgz'\'' LC_ALL=C host 172.23.99.7 | awk '\\''/has address/ {print $4}'\\'' | head -n 1'" on 172.23.99.7; "sh -c 'python /u/apps/example-app/shared/murder/murder_client.py peer '\''/tmp/Test_2.tgz.torrent'\'' '\''/tmp/Test_2.tgz'\'' LC_ALL=C host 172.23.98.78 | awk '\\''/has address/ {print $4}'\\'' | head -n 1'" on 172.23.98.78; "sh -c 'python /u/apps/example-app/shared/murder/murder_client.py peer '\''/tmp/Test_2.tgz.torrent'\'' '\''/tmp/Test_2.tgz'\'' LC_ALL=C host 172.23.99.5 | awk '\\''/has address/ {print $4}'\\'' | head -n 1'" on 172.23.99.5

如您所见,它会在每个节点上引发“参数数量不正确”的错误。

在此之前的一切(创建种子和启动播种过程)都运行良好。

【问题讨论】:

    标签: capistrano bittorrent


    【解决方案1】:

    我认为谋杀与 IP 地址主机定义不兼容。它期待一个可以用“主机”解析的域名,因此您的日志输出中的这个小美:

    `LC_ALL=C host 172.23.99.5 | awk '\\''/has address/ {print $4}'\\'' | head -n 1'`
    

    您会注意到,在没有反引号的情况下运行该命令(即使在具有相应 DNS 条目的 IP 地址上)也会产生空输出。这就是“参数数量不正确”错误的来源。

    看起来github上有一个pull request可以使用ifconfig来计算IP地址而不是主机。如果你愿意,你可以使用那个人的补丁,但它不能处理具有多个接口的主机。最好的解决方案是为您的机器添加一些怪异的 DNS 条目 :)

    编辑:

    实际上,我认为这应该对 IP 地址主机和 DNS 服务器定义都有效。

    再次引用pull request,将主机行替换为:

    HOST = "LC_ALL=C host $CAPISTANO:HOST$ | awk '/has address/ { print $4 } // { print \"$CAPISTRANO:HOST$\" }' | head -n 1"
    

    如果主机名无法解析为 IP 地址,它只会打印出 capistrano 主机服务器名称,在您的情况下就是 IP 地址。

    【讨论】:

      猜你喜欢
      • 2015-09-23
      • 2012-04-18
      • 1970-01-01
      • 2022-01-09
      • 1970-01-01
      • 2021-04-10
      • 2018-07-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多