Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

官方安装脚本检查更新时比较版本的逻辑需要纠正 #2339

Closed
IceCodeNew opened this issue Mar 15, 2020 · 19 comments
Closed

官方安装脚本检查更新时比较版本的逻辑需要纠正 #2339

IceCodeNew opened this issue Mar 15, 2020 · 19 comments
Labels

Comments

@IceCodeNew
Copy link
Contributor

  1. What version of V2Ray are you using (If you deploy different version on server and client, please explicitly point out)?
    v4.22.1

  2. What's your scenario of using V2Ray? E.g., Watching YouTube videos in Chrome via Socks/VMess proxy.
    从源代码构建了最新的 v2ray 版本,考虑到服务器上有官方的安装脚本每周运行一次检查更新,就传递参数 --check 看是不是真的会出现官方发布的相对较旧版本覆盖编译安装的新版本的现象。

  3. What did you see? (Please describe in detail, such as timeout, fake TLS certificate etc)
    安装脚本确实判断从源代码构建的包比官方发布的版本旧。

  4. What's your expectation?
    安装脚本能正确判断版本大小,不要主动覆盖旧版本回来。


~/go/src/v2ray.com/core# release/install-release.sh --local /tmp/make_v2ray_release/v2ray-custom-amd64-linux-20200316-064218.zip

Installing V2Ray via local file. Please make sure the file is a valid V2Ray package, as we are not able to determine that.
Shutting down V2Ray service.
Archive:  /tmp/make_v2ray_release/v2ray-custom-amd64-linux-20200316-064218.zip
  inflating: /usr/bin/v2ray/geoip.dat
  inflating: /usr/bin/v2ray/v2ctl
  inflating: /usr/bin/v2ray/v2ray
  inflating: /usr/bin/v2ray/geosite.dat
Restarting V2Ray service.
V2Ray local is installed.

~/go/src/v2ray.com/core# bash <(curl -L -s https://install.direct/go.sh) --check

Checking for update.
Found new version v4.22.1 for V2Ray.(Current version:v4.22.2-48-g16288788)

值得注意的是,按照现在 GitHub 存储库上的 user-package.sh 代码,实际创建的版本号值是 v4.22.1-48-g16288788
我是已经考虑到小版本号相等可能会害脚本无法正确判断版本号大小,人为对 user-package.sh 构建脚本做过了调整,但是还是遇到了这个问题。

@IceCodeNew
Copy link
Contributor Author

简单来说,对现在的安装脚本来说,版本 v4.22.1 是大于 v4.22.2-48-g16288788 的。
这不合理,希望抽空纠正。

@IceCodeNew
Copy link
Contributor Author

IceCodeNew commented Mar 15, 2020

1: new V2Ray. 0: no. 2: not installed. 3: check failed. 4: don't check.
getVersion(){
    if [[ -n "$VERSION" ]]; then
        NEW_VER="$(normalizeVersion "$VERSION")"
        return 4
    else
        VER="$(/usr/bin/v2ray/v2ray -version 2>/dev/null)"
        RETVAL=$?
        CUR_VER="$(normalizeVersion "$(echo "$VER" | head -n 1 | cut -d " " -f2)")"
        TAG_URL="https://api.github.com/repos/v2ray/v2ray-core/releases/latest"
        NEW_VER="$(normalizeVersion "$(curl ${PROXY} -s "${TAG_URL}" --connect-timeout 10| grep 'tag_name' | cut -d\" -f4)")"

        if [[ $? -ne 0 ]] || [[ $NEW_VER == "" ]]; then
            colorEcho ${RED} "Failed to fetch release information. Please check your network or try again."
            return 3
        elif [[ $RETVAL -ne 0 ]];then
            return 2
        elif [[ $NEW_VER != $CUR_VER ]];then
            return 1
        fi

elif [[ $NEW_VER != $CUR_VER ]];then return 1

……我没话讲了

@ghost
Copy link

ghost commented Mar 16, 2020

將目前腳本的 266 行修改為:

IF_VER="$(echo "$NEW_VER $CUR_VER" | awk '{ if ( $1 > $2 ) print $1; else print $2 }')"
if [[ $IF_VER == $NEW_VER ]]; then
    return 1
fi

如何?

@IceCodeNew
Copy link
Contributor Author

將目前腳本的 266 行修改為:

IF_VER="$(echo "$NEW_VER $CUR_VER" | awk '{ if ( $1 > $2 ) print $1; else print $2 }')"
if [[ $IF_VER == $NEW_VER ]]; then
    return 1
fi

如何?

這個解決思路不是很直觀,但確實應該可以 work,而且不至於在其他沒有想到的地方引起破壞,我覺得很好!
這是你的 idea,請提交你的 PR。我不該搶你的貢獻 XDD

@ghost
Copy link

ghost commented Mar 17, 2020

將目前腳本的 266 行修改為:

IF_VER="$(echo "$NEW_VER $CUR_VER" | awk '{ if ( $1 > $2 ) print $1; else print $2 }')"
if [[ $IF_VER == $NEW_VER ]]; then
    return 1
fi

如何?

這個解決思路不是很直觀,但確實應該可以 work,而且不至於在其他沒有想到的地方引起破壞,我覺得很好!
這是你的 idea,請提交你的 PR。我不該搶你的貢獻 XDD

今天再次測試了一下,發現並不精確,所以又重寫了一段,順便把 NEW_VER 修改為 NEW_VERSIONCUR_VER 修改為 CURRENT_VERSION

NEW_VERSIONSION_NUMBER="${NEW_VERSION#v}"
NEW_MAJOR_VERSION_NUMBER="${NEW_VERSIONSION_NUMBER%%.*}"
NEW_MINOR_VERSION_NUMBER="$(echo $NEW_VERSIONSION_NUMBER | awk -F '.' '{print $2}')"
NEW_MINIMUM_VERSION_NUMBER="${NEW_VERSIONSION_NUMBER##*.}"
CURRENT_VERSIONSION_NUMBER="$(echo ${CURRENT_VERSION#v} | sed 's/-.*//')"
CURRENT_MAJOR_VERSION_NUMBER="${CURRENT_VERSIONSION_NUMBER%%.*}"
CURRENT_MINOR_VERSION_NUMBER="$(echo $CURRENT_VERSIONSION_NUMBER | awk -F '.' '{print $2}')"
CURRENT_MINIMUM_VERSION_NUMBER="${CURRENT_VERSIONSION_NUMBER##*.}"
if [[ "$NEW_MAJOR_VERSION_NUMBER" -gt "$CURRENT_MAJOR_VERSION_NUMBER" ]]; then
    return 1
elif [[ "$NEW_MAJOR_VERSION_NUMBER" -eq "$CURRENT_MAJOR_VERSION_NUMBER" ]]; then
    if [[ "$NEW_MINOR_VERSION_NUMBER" -gt "$CURRENT_MINOR_VERSION_NUMBER" ]]; then
        return 1
    elif [[ "$NEW_MINOR_VERSION_NUMBER" -eq "$CURRENT_MINOR_VERSION_NUMBER" ]]; then
        if [[ "$NEW_MINIMUM_VERSION_NUMBER" -gt "$CURRENT_MINIMUM_VERSION_NUMBER" ]]; then
            return 1
        else
            return 0
        fi
    else
        return 0
    fi
else
    return 0
fi

至於 PR 就不著急了,最近正在嘗試大改官方腳本。

@IceCodeNew
Copy link
Contributor Author

IceCodeNew commented Mar 18, 2020

這上面用了兩個非常有意思的 SHELL 語法,學習了。
看了你説的,我重新設計了一個刁鑽一點的場景(NEW_VER=4.9.25;CUR_VER=4.10.1),發現果然最初的脚本返回結果是不正確的!

@dctxmei
這裏我有一個建議,不要用 NEW_***_VERSION 這樣的變量名。因爲這個變量名可能會引起誤會——實際上它是遠端 GitHub releases 頁發佈出來的版本,不一定比本地拿來做比較的程式版本「新」,所以不妨用 github 或是 remote 這樣的前綴。
另外個人的看法是 SHELL 裏面變量名不要用大寫,因爲要是起的變量名太簡短,是真的可能會和作業系統裏的環境變量重名的哦。這樣執行完脚本后會修改作業系統内的環境變量,是非常危險的行爲。
建議變量名就用小寫就好。

@ghost
Copy link

ghost commented Mar 18, 2020

這上面用了兩個非常有意思的 SHELL 語法,學習了。
看了你説的,我重新設計了一個刁鑽一點的場景(NEW_VER=4.9.25;CUR_VER=4.10.1),發現果然最初的脚本返回結果是不正確的!

@dctxmei
這裏我有一個建議,不要用 NEW_***_VERSION 這樣的變量名。因爲這個變量名可能會引起誤會——實際上它是遠端 GitHub releases 頁發佈出來的版本,不一定比本地拿來做比較的程式版本「新」,所以不妨用 github 或是 remote 這樣的前綴。
另外個人的看法是 SHELL 裏面變量名不要用大寫,因爲要是起的變量名太簡短,是真的可能會和作業系統裏的環境變量重名的哦。這樣執行完脚本后會修改作業系統内的環境變量,是非常危險的行爲。
建議變量名就用小寫就好。

多謝提供建議,已修正。

不過,像是 VERSION= 這樣的寫法,僅僅屬於「Global variable」,也就是「全局變量」,這種變量僅僅是應用於當前 Shell 進程的內部,在結束當前進程後就會被丟掉,而不會影響到作業系統內的環境變量。

另外,如果對 OpenBSD 和腳本感興趣的話,可以來嘗試一下:
https://github.com/v2fly/openbsd-install-v2ray

:)

@IceCodeNew
Copy link
Contributor Author

不過,像是 VERSION= 這樣的寫法,僅僅屬於「Global variable」,也就是「全局變量」,這種變量僅僅是應用於當前 Shell 進程的內部,在結束當前進程後就會被丟掉,而不會影響到作業系統內的環境變量。

你説的對,我有點多慮了。

@ghost
Copy link

ghost commented Mar 24, 2020

最新的脚本 bash <(curl -L -s https://install.direct/go.sh) 在debian 7 32位安装出错:

root@urpised:~# bash <(curl -L -s https://install.direct/go.sh)
Installing V2Ray vhttps://api.github.com/repos/v2ray/v2ray-core/releases/22545481 on i686
Downloading V2Ray: https://github.com/v2ray/v2ray-core/releases/download/vhttps://api.github.com/repos/v2ray/v2ray-core/releases/22545481/v2ray-linux-32.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     9  100     9    0     0     28      0 --:--:-- --:--:-- --:--:--    33
/dev/fd/63: line 144: unzip: command not found
awk: not an option: -e
Updating software repo
Installing unzip
Selecting previously unselected package unzip.
(Reading database ... 20652 files and directories currently installed.)
Unpacking unzip (from .../unzip_6.0-8+deb7u5_i386.deb) ...
Processing triggers for man-db ...
Setting up unzip (6.0-8+deb7u5) ...
Archive:  /tmp/v2ray/v2ray.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /tmp/v2ray/v2ray.zip or
        /tmp/v2ray/v2ray.zip.zip, and cannot find /tmp/v2ray/v2ray.zip.ZIP, period.
Failed to copy V2Ray binary and resources.

使用https://raw.githubusercontent.com/v2ray/v2ray-core/572abd73a057697e597ea8ddfcf62028bc75585c/release/install-release.sh 版本成功安装...

請盡量不要使用已經被發行版官方停止支援的版本,目前最新的 Debian Stable 是 10(Buster):
https://wiki.debian.org/DebianStable

腳本則可以嘗試使用新版的參考項目,參見 #2328

@Asgore0
Copy link

Asgore0 commented Mar 24, 2020

最新的脚本 bash <(curl -L -s https://install.direct/go.sh) 在debian 7 32位安装出错:

root@urpised:~# bash <(curl -L -s https://install.direct/go.sh)
Installing V2Ray vhttps://api.github.com/repos/v2ray/v2ray-core/releases/22545481 on i686
Downloading V2Ray: https://github.com/v2ray/v2ray-core/releases/download/vhttps://api.github.com/repos/v2ray/v2ray-core/releases/22545481/v2ray-linux-32.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     9  100     9    0     0     28      0 --:--:-- --:--:-- --:--:--    33
/dev/fd/63: line 144: unzip: command not found
awk: not an option: -e
Updating software repo
Installing unzip
Selecting previously unselected package unzip.
(Reading database ... 20652 files and directories currently installed.)
Unpacking unzip (from .../unzip_6.0-8+deb7u5_i386.deb) ...
Processing triggers for man-db ...
Setting up unzip (6.0-8+deb7u5) ...
Archive:  /tmp/v2ray/v2ray.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /tmp/v2ray/v2ray.zip or
        /tmp/v2ray/v2ray.zip.zip, and cannot find /tmp/v2ray/v2ray.zip.ZIP, period.
Failed to copy V2Ray binary and resources.

使用https://raw.githubusercontent.com/v2ray/v2ray-core/572abd73a057697e597ea8ddfcf62028bc75585c/release/install-release.sh 版本成功安装...

請盡量不要使用已經被發行版官方停止支援的版本,目前最新的 Debian Stable 是 10(Buster):
https://wiki.debian.org/DebianStable

腳本則可以嘗試使用新版的參考項目,參見 #2328

此问题我在Debian9 Debian10 Debian bullseye 都有遇到,而且是概率发生,连续执行脚本更新命令,有时可以正确判断是否更新,有时出现此错误。

@kslr
Copy link
Contributor

kslr commented Mar 25, 2020

试试最新的

@kslr
Copy link
Contributor

kslr commented Mar 25, 2020

重试了几次?你把logs贴出来

@Asgore0
Copy link

Asgore0 commented Mar 25, 2020

重试了几次?你把logs贴出来

root@PR888D:# bash <(curl -L -s https://install.direct/go.sh)
Installing V2Ray vhttps://api.github.com/repos/v2ray/v2ray-core/releases/24822244 on x86_64
Downloading V2Ray: https://github.com/v2ray/v2ray-core/releases/download/vhttps://api.github.com/repos/v2ray/v2ray-core/releases/24822244/v2ray-linux-64.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9 100 9 0 0 37 0 --:--:-- --:--:-- --:--:-- 37
awk: not an option: -e
[/tmp/v2ray/v2ray.zip]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/v2ray/v2ray.zip or
/tmp/v2ray/v2ray.zip.zip, and cannot find /tmp/v2ray/v2ray.zip.ZIP, period.
Archive: /tmp/v2ray/v2ray.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/v2ray/v2ray.zip or
/tmp/v2ray/v2ray.zip.zip, and cannot find /tmp/v2ray/v2ray.zip.ZIP, period.
Failed to copy V2Ray binary and resources.
root@PR888D:
# bash <(curl -L -s https://install.direct/go.sh)
Installing V2Ray vhttps://api.github.com/repos/v2ray/v2ray-core/releases/24822244 on x86_64
Downloading V2Ray: https://github.com/v2ray/v2ray-core/releases/download/vhttps://api.github.com/repos/v2ray/v2ray-core/releases/24822244/v2ray-linux-64.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9 100 9 0 0 81 0 --:--:-- --:--:-- --:--:-- 82
awk: not an option: -e
[/tmp/v2ray/v2ray.zip]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/v2ray/v2ray.zip or
/tmp/v2ray/v2ray.zip.zip, and cannot find /tmp/v2ray/v2ray.zip.ZIP, period.
Archive: /tmp/v2ray/v2ray.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/v2ray/v2ray.zip or
/tmp/v2ray/v2ray.zip.zip, and cannot find /tmp/v2ray/v2ray.zip.ZIP, period.
Failed to copy V2Ray binary and resources.
root@PR888D:# bash <(curl -L -s https://install.direct/go.sh)
Latest version v4.23.1 is already installed.
root@PR888D:
# bash <(curl -L -s https://install.direct/go.sh)
Installing V2Ray vhttps://api.github.com/repos/v2ray/v2ray-core/releases/24822244 on x86_64
Downloading V2Ray: https://github.com/v2ray/v2ray-core/releases/download/vhttps://api.github.com/repos/v2ray/v2ray-core/releases/24822244/v2ray-linux-64.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9 100 9 0 0 79 0 --:--:-- --:--:-- --:--:-- 78
awk: [/tmp/v2ray/v2ray.zip]
not an option: -e
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/v2ray/v2ray.zip or
/tmp/v2ray/v2ray.zip.zip, and cannot find /tmp/v2ray/v2ray.zip.ZIP, period.
Archive: /tmp/v2ray/v2ray.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/v2ray/v2ray.zip or
/tmp/v2ray/v2ray.zip.zip, and cannot find /tmp/v2ray/v2ray.zip.ZIP, period.
Failed to copy V2Ray binary and resources.
root@PR888D:# bash <(curl -L -s https://install.direct/go.sh)
Installing V2Ray vhttps://api.github.com/repos/v2ray/v2ray-core/releases/24822244 on x86_64
Downloading V2Ray: https://github.com/v2ray/v2ray-core/releases/download/vhttps://api.github.com/repos/v2ray/v2ray-core/releases/24822244/v2ray-linux-64.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9 100 9 0 0 73 0 --:--:-- --:--:-- --:--:-- 73
awk: not an option: -e
[/tmp/v2ray/v2ray.zip]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/v2ray/v2ray.zip or
/tmp/v2ray/v2ray.zip.zip, and cannot find /tmp/v2ray/v2ray.zip.ZIP, period.
Archive: /tmp/v2ray/v2ray.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/v2ray/v2ray.zip or
/tmp/v2ray/v2ray.zip.zip, and cannot find /tmp/v2ray/v2ray.zip.ZIP, period.
Failed to copy V2Ray binary and resources.
root@PR888D:
# bash <(curl -L -s https://install.direct/go.sh)
Installing V2Ray vhttps://api.github.com/repos/v2ray/v2ray-core/releases/24822244 on x86_64
Downloading V2Ray: https://github.com/v2ray/v2ray-core/releases/download/vhttps://api.github.com/repos/v2ray/v2ray-core/releases/24822244/v2ray-linux-64.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9 100 9 0 0 83 0 --:--:-- --:--:-- --:--:-- 83
[/tmp/v2ray/v2ray.zip]
awk: not an option: -e
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/v2ray/v2ray.zip or
/tmp/v2ray/v2ray.zip.zip, and cannot find /tmp/v2ray/v2ray.zip.ZIP, period.
Archive: /tmp/v2ray/v2ray.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/v2ray/v2ray.zip or
/tmp/v2ray/v2ray.zip.zip, and cannot find /tmp/v2ray/v2ray.zip.ZIP, period.
Failed to copy V2Ray binary and resources.
root@PR888D:# bash <(curl -L -s https://install.direct/go.sh)
Latest version v4.23.1 is already installed.
root@PR888D:
# bash <(curl -L -s https://install.direct/go.sh)
Installing V2Ray vhttps://api.github.com/repos/v2ray/v2ray-core/releases/24822244 on x86_64
Downloading V2Ray: https://github.com/v2ray/v2ray-core/releases/download/vhttps://api.github.com/repos/v2ray/v2ray-core/releases/24822244/v2ray-linux-64.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9 100 9 0 0 78 0 --:--:-- --:--:-- --:--:-- 78
awk: not an option: -e
[/tmp/v2ray/v2ray.zip]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/v2ray/v2ray.zip or
/tmp/v2ray/v2ray.zip.zip, and cannot find /tmp/v2ray/v2ray.zip.ZIP, period.
Archive: /tmp/v2ray/v2ray.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/v2ray/v2ray.zip or
/tmp/v2ray/v2ray.zip.zip, and cannot find /tmp/v2ray/v2ray.zip.ZIP, period.
Failed to copy V2Ray binary and resources.
root@PR888D:# bash <(curl -L -s https://install.direct/go.sh)
Latest version v4.23.1 is already installed.
root@PR888D:
# bash <(curl -L -s https://install.direct/go.sh)
Installing V2Ray vhttps://api.github.com/repos/v2ray/v2ray-core/releases/24822244 on x86_64
Downloading V2Ray: https://github.com/v2ray/v2ray-core/releases/download/vhttps://api.github.com/repos/v2ray/v2ray-core/releases/24822244/v2ray-linux-64.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9 100 9 0 0 69 0 --:--:-- --:--:-- --:--:-- 68
awk: not an option: -e
[/tmp/v2ray/v2ray.zip]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/v2ray/v2ray.zip or
/tmp/v2ray/v2ray.zip.zip, and cannot find /tmp/v2ray/v2ray.zip.ZIP, period.
Archive: /tmp/v2ray/v2ray.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/v2ray/v2ray.zip or
/tmp/v2ray/v2ray.zip.zip, and cannot find /tmp/v2ray/v2ray.zip.ZIP, period.
Failed to copy V2Ray binary and resources.
root@PR888D:# bash <(curl -L -s https://install.direct/go.sh)
Latest version v4.23.1 is already installed.
root@PR888D:
# bash <(curl -L -s https://install.direct/go.sh)
Latest version v4.23.1 is already installed.
root@PR888D:# bash <(curl -L -s https://install.direct/go.sh)
Installing V2Ray vhttps://api.github.com/repos/v2ray/v2ray-core/releases/24822244 on x86_64
Downloading V2Ray: https://github.com/v2ray/v2ray-core/releases/download/vhttps://api.github.com/repos/v2ray/v2ray-core/releases/24822244/v2ray-linux-64.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9 100 9 0 0 81 0 --:--:-- --:--:-- --:--:-- 81
awk: not an option: -e
[/tmp/v2ray/v2ray.zip]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/v2ray/v2ray.zip or
/tmp/v2ray/v2ray.zip.zip, and cannot find /tmp/v2ray/v2ray.zip.ZIP, period.
Archive: /tmp/v2ray/v2ray.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/v2ray/v2ray.zip or
/tmp/v2ray/v2ray.zip.zip, and cannot find /tmp/v2ray/v2ray.zip.ZIP, period.
Failed to copy V2Ray binary and resources.
root@PR888D:
# bash <(curl -L -s https://install.direct/go.sh)
Installing V2Ray vhttps://api.github.com/repos/v2ray/v2ray-core/releases/24822244 on x86_64
Downloading V2Ray: https://github.com/v2ray/v2ray-core/releases/download/vhttps://api.github.com/repos/v2ray/v2ray-core/releases/24822244/v2ray-linux-64.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9 100 9 0 0 90 0 --:--:-- --:--:-- --:--:-- 90
awk: [/tmp/v2ray/v2ray.zip]
not an option: -e
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/v2ray/v2ray.zip or
/tmp/v2ray/v2ray.zip.zip, and cannot find /tmp/v2ray/v2ray.zip.ZIP, period.
Archive: /tmp/v2ray/v2ray.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/v2ray/v2ray.zip or
/tmp/v2ray/v2ray.zip.zip, and cannot find /tmp/v2ray/v2ray.zip.ZIP, period.
Failed to copy V2Ray binary and resources.
root@PR888D:# bash <(curl -L -s https://install.direct/go.sh)
Installing V2Ray vhttps://api.github.com/repos/v2ray/v2ray-core/releases/24822244 on x86_64
Downloading V2Ray: https://github.com/v2ray/v2ray-core/releases/download/vhttps://api.github.com/repos/v2ray/v2ray-core/releases/24822244/v2ray-linux-64.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9 100 9 0 0 87 0 --:--:-- --:--:-- --:--:-- 87
[/tmp/v2ray/v2ray.zip]
awk: not an option: -e
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/v2ray/v2ray.zip or
/tmp/v2ray/v2ray.zip.zip, and cannot find /tmp/v2ray/v2ray.zip.ZIP, period.
Archive: /tmp/v2ray/v2ray.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/v2ray/v2ray.zip or
/tmp/v2ray/v2ray.zip.zip, and cannot find /tmp/v2ray/v2ray.zip.ZIP, period.
Failed to copy V2Ray binary and resources.
root@PR888D:
#

这是刚刚试的15次,10次出现这个错误,5次成功。Debian10。

@sunshineplan
Copy link
Contributor

似乎是curl -s "https://api.github.com/repos/v2ray/v2ray-core/releases/latest" --connect-timeout 10| grep 'tag_name'出的问题,有时能准确找到的tag_name,有时返回的是所有内容,所以才会最后截取了第一行的https://api.github.com/repos/v2ray/v2ray-core/releases/24822244作为了新版本的值。

@Asgore0
Copy link

Asgore0 commented Mar 25, 2020

新的已经有人提出具体原因了#2373,你说得对。

似乎是curl -s "https://api.github.com/repos/v2ray/v2ray-core/releases/latest" --connect-timeout 10| grep 'tag_name'出的问题,有时能准确找到的tag_name,有时返回的是所有内容,所以才会最后截取了第一行的https://api.github.com/repos/v2ray/v2ray-core/releases/24822244作为了新版本的值。

@kslr
Copy link
Contributor

kslr commented Mar 25, 2020

fix #2374

@github-actions
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants
@kslr @sunshineplan @IceCodeNew @Asgore0 and others