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

Improve error reporting for failed .Net installer downloads #2074

Open
JasonYeMSFT opened this issue Dec 30, 2024 · 4 comments
Open

Improve error reporting for failed .Net installer downloads #2074

JasonYeMSFT opened this issue Dec 30, 2024 · 4 comments

Comments

@JasonYeMSFT
Copy link

Is your feature request related to a problem? Please describe.

We use the .Net install tool VS Code extension to acquire .Net runtime for our extension. We have accumulated quite a few user issues about failing to download the .Net installer and the log indicates the error they get is not 404. When the dotnet-install script failed to download the installer, the error message doesn't give useful information on what happened when the http error code is not 404. For example, in dotnet-install.sh

download "$download_link" "$zip_path" 2>&1 || download_failed=true

if [ "$download_failed" = true ]; then
    case $http_code in
    404)
        say "The resource at $link_type link '$download_link' is not available."
        ;;
    *)
        say "Failed to download $link_type link '$download_link': $download_error_msg"
        ;;
    esac
    rm -f "$zip_path" 2>&1 && say_verbose "Temporary archive file $zip_path was removed"
else
    download_completed=true
    break
fi

A clear and concise description of what you want to happen. Include any alternative solutions you've considered.

It would be great if the script can print the exact error code so we can further troubleshoot what caused the failure. It would also be nice if the .Net install tool extension can offer an easy way to run the script with verbose logging for troubleshooting scenarios.

Describe the solution you'd like

  • Just print the http_code and some message telling people that the download failed with that code.
  • Offer a setting that can be set to enable verbose logging for the download script and maybe something else from the extension. Or use the VS Code log level setting to determine whether to enable verbose logging.

Additional context

No response

@nagilson
Copy link
Member

nagilson commented Jan 6, 2025

Thank you @JasonYeMSFT for a thorough issue report. I assume you are looking at the install script log from within our log? I want to confirm that the 404 you're referring to is specifically from the install script and never from us, which I believe is the case based on what you wrote above.

@dotnet/install-scripts-maintainers, may you please take a look at this as well?
This is for an internal team, it seems important to assist them and hopefully this is a relatively light ask.

@JasonYeMSFT
Copy link
Author

I downloaded and quoted the script from "https://dot.net/v1/dotnet-install.sh". I understand that you are not the owner of the script since it's not hosted in your repo. It would be very appreciated if you can help us work with the owner and improve it.

@JanProvaznik
Copy link
Member

Makes sense, I made a PR, we'll deploy next week.

@nagilson
Copy link
Member

nagilson commented Jan 7, 2025

You're awesome, thank you!

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

3 participants