Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bug(install.sh): Installcoder does not honor--version flag #12867

Closed
Labels
cliArea: CLI
@michaelbrewer

Description

@michaelbrewer

When doing a standard installcurl -L https://coder.com/install.sh | sh of coder, the api calls to get the latest version is often rate limited by github. This results in a[403](curl: (22) The requested URL returned error: 403), which should should prompt the script to fail, but instead returns a blank version. As the version can not be determinedInstalling v of the amd64 rpm package from GitHub. is printed andcurl -#fL -o ~/.cache/coder/coder__linux_amd64.rpm.incomplete -C - https://github.com/coder/coder/releases/download/v/coder__linux_amd64.rpm is downloaded

See output:

curl -L https://coder.com/install.sh | sh  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                 Dload  Upload   Total   Spent    Left  Speed  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0100 20209  100 20209    0     0  19137      0  0:00:01  0:00:01 --:--:--  101kcurl: (22) The requested URL returned error: 403Red Hat Enterprise Linux 9.3 (Plow)Installing v of the amd64 rpm package from GitHub.+ mkdir -p ~/.cache/coder+ curl -#fL -o ~/.cache/coder/coder__linux_amd64.rpm.incomplete -C - https://github.com/coder/coder/releases/download/v/coder__linux_amd64.rpmcurl: (22) The requested URL returned error: 404

A workaround would have been to pass in the version you want

curl -L https://coder.com/install.sh| sh -s -- --version 2.10.0

But this is not honored and the api call is still made.

Expected outcome

  1. When passing in the version number, we should honor it and ignore getting the latest version
  2. Not to rely on the github api to get the latest version of coder (or to check for being rate limited)

Possible Fix

Initial change to useVERSION when set

if [-z"${VERSION}" ];thenif ["${MAINLINE}"= 0 ];then  VERSION=${STABLE_VERSION}elseVERSION=$(echo_latest_mainline_version)fifi

also adding a check toecho_latest_mainline_version would help debugging this issue in the future

echo_latest_mainline_version() {# Fetch the releases from the GitHub API, sort by version number,# and take the first result. Note that we're sorting by space-# separated numbers and without utilizing the sort -V flag for the# best compatibility.version=$(curl -fsSL https://api.github.com/repos/coder/coder/releases|awk -F'"''/"tag_name"/ {print $4}'|tr -d v|tr.''|sort -k1,1nr -k2,2nr -k3,3nr|head -n1|tr'' .)if [-z"$version" ];thenecho"Failed to fetch the latest version from GitHub."exit 1fiecho"$version"}

In general using the GitHub api comes with severe limits when anonymous and via a share NAT ("The primary rate limit for unauthenticated requests is 60 requests per hour."). Maybe an alternative could be used to get the latest stable and mainline releases (like a static file updated on release)


Workaround for stable

Stable installs won't be effected as it is using Github site and not the api.

curl -L https://coder.com/install.sh| sh -s -- --stable

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliArea: CLI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp