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

./images/linux/scripts/installers/git.sh failed at line 42 #7722

Closed
3 of 10 tasks
xfc opened this issue Jun 14, 2023 · 7 comments
Closed
3 of 10 tasks

./images/linux/scripts/installers/git.sh failed at line 42 #7722

xfc opened this issue Jun 14, 2023 · 7 comments

Comments

@xfc
Copy link

xfc commented Jun 14, 2023

Description

git.sh failed at

downloadUrl=$(get_github_package_download_url "github/hub" "contains(\"hub-linux-amd64\")")

with error:
" jq: error (at :1): Cannot index string with string "prerelease"
jq: error (at :1): Cannot index string with string "tag_name"
".

The root cause is at this line:

json=$(curl -s "https://api.github.com/repos/${REPO_ORG}/releases?per_page=${SEARCH_IN_COUNT}")

A very simple way to reproduce this bug is to run this line (

json=$(curl -s "https://api.github.com/repos/${REPO_ORG}/releases?per_page=${SEARCH_IN_COUNT}")
) manually : "curl -s https://api.github.com/repos/github/hub/releases?per_page=100" and the return is:
{
"message": "Moved Permanently",
"url": "https://api.github.com/repositories/401025/releases?per_page=100",
"documentation_url": "https://docs.github.com/v3/#http-redirects"
}.

Two potential solutions:

  1. replace "curl -s" with "curl -sL" at
    json=$(curl -s "https://api.github.com/repos/${REPO_ORG}/releases?per_page=${SEARCH_IN_COUNT}")
    .
  2. replace "github/hub" with "GrantBirki/hub" at
    downloadUrl=$(get_github_package_download_url "github/hub" "contains(\"hub-linux-amd64\")")
    .

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 20.04
  • Ubuntu 22.04
  • macOS 11
  • macOS 12
  • macOS 13
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

Any.

Is it regression?

No.

Expected behavior

./images/linux/scripts/installers/git.sh ran successfully.

Actual behavior

./images/linux/scripts/installers/git.sh failed.

Repro steps

A one-liner to reproduce the bug is provided in the description section.

@vpolikarpov-akvelon
Copy link
Contributor

Hey @xfc. Could you elaborate a bit what you are trying to do?

@cmpl-giedriusk
Copy link

We are experiencing the same behavior, while generating ubuntu 22.04 image.

@Alexey-Ayupov
Copy link
Contributor

@xfc, we are aware of this issue and already working on it.

@mikhailkoliada
Copy link
Contributor

looks like this curl call is missing at least the -sL call, or better the -sSL one, which prevents https traffic from being redirected correctly.

@MonaMoravej
Copy link

I have seen the exact same issue, starting today, I am using the "releases/ubuntu22/20230611" tag to re-build a custom image (subset of toolset needed to be installed in our image and we do share the generated image in azure image gallery)

@ejike-nnodi
Copy link

Yes I noticed the same issue as well... I was actually just investigating it.

I can confirm that @mikhailkoliada solution works
adding "-sL" to curl command.

@mikhailkoliada
Copy link
Contributor

Should be fixed now, please pull updates from main!

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

No branches or pull requests

7 participants