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

(testing ci, please disregard) #3940

Closed
wants to merge 4 commits into from

Conversation

2501babe
Copy link
Member

the download failure is annoying me

@2501babe
Copy link
Member Author

alright turning on set -x breaks everything but here is an extract of breakage we care about:

++++ release=v1.14.10
++++ download_url=https://release.solana.com/v1.14.10/solana-install-init-x86_64-unknown-linux-gnu
++++ solana_install_init=/tmp/tmp.AubTiB3D90/solana-install-init
++++ printf 'downloading %s installer\n' v1.14.10
downloading v1.14.10 installer
++++ ensure mkdir -p /tmp/tmp.AubTiB3D90
++++ mkdir -p /tmp/tmp.AubTiB3D90
++++ ensure downloader https://release.solana.com/v1.14.10/solana-install-init-x86_64-unknown-linux-gnu /tmp/tmp.AubTiB3D90/solana-install-init
++++ downloader https://release.solana.com/v1.14.10/solana-install-init-x86_64-unknown-linux-gnu /tmp/tmp.AubTiB3D90/solana-install-init
++++ check_cmd curl
++++ command -v curl
++++ program=curl
++++ '[' https://release.solana.com/v1.14.10/solana-install-init-x86_64-unknown-linux-gnu = --check ']'
++++ '[' curl = curl ']'
++++ curl -sSfL https://release.solana.com/v1.14.10/solana-install-init-x86_64-unknown-linux-gnu -o /tmp/tmp.AubTiB3D90/solana-install-init
++++ ensure chmod u+x /tmp/tmp.AubTiB3D90/solana-install-init
++++ chmod u+x /tmp/tmp.AubTiB3D90/solana-install-init
++++ '[' '!' -x /tmp/tmp.AubTiB3D90/solana-install-init ']'
++++ '[' -z '' ']'
++++ ignore /tmp/tmp.AubTiB3D90/solana-install-init v1.14.10
++++ /tmp/tmp.AubTiB3D90/solana-install-init v1.14.10
++ sh -c 'Error: error decoding response body: invalid type: map, expected a sequence at line 1 column 0'
sh: 1: Error:: not found
Error: Process completed with exit code 127.

@2501babe
Copy link
Member Author

++++ file /tmp/tmp.kk8ygPCCVj/solana-install-init
++++ ignore /tmp/tmp.kk8ygPCCVj/solana-install-init v1.14.10
++++ /tmp/tmp.kk8ygPCCVj/solana-install-init v1.14.10
++ sh -c '/tmp/tmp.kk8ygPCCVj/solana-install-init: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=53da268f626f1134ee217c86eea02a7dfb688bc8, with debug_info, not stripped
Error: error decoding response body: invalid type: map, expected a sequence at line 1 column 0'

coooooool so it downloads solana-install-init fine, i thought this was a curl error at first, but the "map not sequence" thing is coming from inside this rust program whiiiich 30 seconds of investigation tells me is monorepo/install/src/bin/solana-install-init.rs

refraining from removing ignore from the script since the progress bar output may jusy mess up the logs, its either in download_to_temp from:

    let progress_bar = new_spinner_progress_bar();
    progress_bar.set_message(format!("{}Downloading...", TRUCK));

    let response = client.get(url.as_str()).send()?;
    let download_size = {
        response
            .headers()
            .get(reqwest::header::CONTENT_LENGTH)
            .and_then(|content_length| content_length.to_str().ok())
            .and_then(|content_length| content_length.parse().ok())
            .unwrap_or(0)
    };

or in check_for_newer_github_release from:

        let url = reqwest::Url::parse_with_params(
            "https://api.github.com/repos/solana-labs/solana/releases",
            &[  
                ("per_page", &format!("{}", PER_PAGE)),
                ("page", &format!("{}", page)),
            ],
        )
        .unwrap();
        let request = client.get(url).build()?;
        let response = client.execute(request)?;

        releases = response
            .json::<GithubReleases>()?
            .0
            .into_iter()
[and so on]

its almost definitely the latter. its trying to parse the response as a json array (sequence?) but getting some kind of error (hence map). are we getting fucked by github on github?

trying to think of a way to print the error. its weird because its curling this from an official release, and the code is in the monorepo, so what i want is to... commit this code in this branch and call it somehow from ci? my best guess tho is we are getting rate-limited for running this too much in parallel... i dont understand github actions at all tho, to know if theres a way we could download the release once, and use that in all the jobs. it seems like its downloading it 20+ times for every run?

@2501babe
Copy link
Member Author

when all else fails, be stupid:

hana@laptop:lol$ for i in {1..100}; do curl -o "rel$i" https://api.github.com/repos/solana-labs/solana/releases &> "err$i" & done
hana@laptop:lol$ head -1 rel*
==> rel1 <==
[

==> rel10 <==
[

==> rel100 <==
{"message":"API rate limit exceeded for [XXX]. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}

@joncinque
Copy link
Contributor

joncinque commented Dec 20, 2022

my best guess tho is we are getting rate-limited for running this too much in parallel...

This might actually be the issue. Awhile back, I fixed the installer because it wasn't able to find a release, but in doing so, it might be that we're fetching too many releases: solana-labs/solana#21417

Maybe by default we just get the first page or two and call it quits after that? And we can pass a flag to force fetching all releases. https://api.github.com/repos/solana-labs/solana/releases?per_page=100 gets us to 1.8.6, which seems pretty darn good.

Edit: this goes out to 5 pages, so getting that down to 1 is good https://api.github.com/repos/solana-labs/solana/releases?per_page=100&page=5

@2501babe
Copy link
Member Author

for my convenience...

   2: solana_install::command::check_for_newer_github_release
             at ./src/command.rs:901:5
   3: solana_install::command::init_or_update
             at ./src/command.rs:965:38
   4: solana_install::command::init
             at ./src/command.rs:557:5
   5: solana_install::handle_init
             at ./src/lib.rs:74:9
   6: solana_install::main_init
             at ./src/lib.rs:345:5
   7: solana_install_init::main
             at ./src/bin/solana-install-init.rs:19:5

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

Successfully merging this pull request may close these issues.

2 participants