Skip to content

Script unable to find installed curl / wget on Alpine #206

Closed

Description

@kaashyapan
bash-5.1# chmod +x dotnet-install.sh
bash-5.1# ./dotnet-install.sh -c Current --os linux-musl
dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.

dotnet_install: Error: curl (recommended) or wget are required to download dotnet. Install missing prerequisite to proceed.
bash-5.1# which curl
/usr/bin/curl
bash-5.1# which wget
/usr/bin/wget
bash-5.1# cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.14.0
PRETTY_NAME="Alpine Linux v3.14"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"
bash-5.1# 

Activity

  1. strainovic commented on Aug 30, 2021

    @strainovic

    Same issue here. It fails randomly.

    --2021-08-30 13:53:06--  https://dot.net/v1/dotnet-install.sh
    Resolving dot.net (dot.net)... 40.76.4.15, 40.112.72.205, 104.215.148.63, ...
    Connecting to dot.net (dot.net)|40.76.4.15|:443... connected.
    HTTP request sent, awaiting response... 301 Moved Permanently
    Location: https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh [following]
    --2021-08-30 13:53:07--  https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh
    Resolving dotnet.microsoft.com (dotnet.microsoft.com)... 13.107.213.60, 13.107.246.60, 2620:1ec:46::60, ...
    Connecting to dotnet.microsoft.com (dotnet.microsoft.com)|13.107.213.60|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 54538 (53K) [application/x-sh]
    Saving to: 'dotnet-install.sh'
    
         0K .......... .......... .......... .......... .......... 93% 4.80M 0s
        50K ...                                                   100% 6.07T=0.01s
    
    2021-08-30 13:53:07 (5.11 MB/s) - 'dotnet-install.sh' saved [54538/54538]
    
    Removing intermediate container e38f994e5018
     ---> 2e4e611acfdb
    Step 6/11 : RUN ./dotnet-install.sh -c 3.1 -i ${DOTNET_ROOT} --runtime aspnetcore &&     rm -rf dotnet-install.sh
     ---> Running in 69f496cb22ae
    dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
    dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
    dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
    dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.
    
    dotnet_install: Error: curl (recommended) or wget are required to download dotnet. Install missing prerequisite to proceed.
    
  2. bekir-ozturk commented on Aug 30, 2021

    @bekir-ozturk
    Contributor

    Hi @kaashyapan & @strainovic,
    Thanks for the issue.

    @kaashyapan Are you seeing this randomly as well, or is it consistent?
    @strainovic Are you also on Alpine?

    I suspect that the issue is not related to curl or wget, but somehow this message is printed.
    Could you use verbose switch ( -v ) and share the detailed logs?

    Thank you very much.

  3. self-assigned this
    on Aug 30, 2021
  4. strainovic commented on Aug 30, 2021

    @strainovic

    Hi @bekir-ozturk,

    Yes, it is Alpine also.

    During my last try, I got only one successful build, out of 5 tries. I Will try with ( -v ) also.

    --verbose argument, not -v

    Thanks

  5. kaashyapan commented on Aug 30, 2021

    @kaashyapan
    Author

    I get it consistently though.
    Below is the verbose output.

    bash-5.1# chmod +x dotnet-install.sh
    bash-5.1# ./dotnet-install.sh -c Current --os linux-musl --verbose
    dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
    dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
    dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
    dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.
    
    dotnet-install: Calling: machine_has curl
    dotnet-install: Calling: machine_has wget
    dotnet_install: Error: curl (recommended) or wget are required to download dotnet. Install missing prerequisite to proceed.
    bash-5.1#
    
    
  6. strainovic commented on Aug 31, 2021

    @strainovic

    Here is my verbose output too:

    --2021-08-31 06:51:10--  https://dot.net/v1/dotnet-install.sh
    Resolving dot.net (dot.net)... 40.76.4.15, 40.112.72.205, 104.215.148.63, ...
    Connecting to dot.net (dot.net)|40.76.4.15|:443... connected.
    HTTP request sent, awaiting response... 301 Moved Permanently
    Location: https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh [following]
    --2021-08-31 06:51:10--  https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh
    Resolving dotnet.microsoft.com (dotnet.microsoft.com)... 13.107.246.60, 13.107.213.60, 2620:1ec:bdf::60, ...
    Connecting to dotnet.microsoft.com (dotnet.microsoft.com)|13.107.246.60|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 54538 (53K) [application/x-sh]
    Saving to: 'dotnet-install.sh'
    
         0K .......... .......... .......... .......... .......... 93% 4.34M 0s
        50K ...                                                   100% 6.07T=0.01s
    
    2021-08-31 06:51:11 (4.62 MB/s) - 'dotnet-install.sh' saved [54538/54538]
    
    Removing intermediate container a72e31416416
     ---> 61704e47758c
    Step 6/11 : RUN ./dotnet-install.sh -c 3.1 -i ${DOTNET_ROOT} --runtime aspnetcore --verbose &&     rm -rf dotnet-install.sh
     ---> Running in 0c80af29613c
    dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
    dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
    dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
    dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.
    
    dotnet-install: Calling: machine_has curl
    dotnet-install: Calling: machine_has wget
    dotnet_install: Error: curl (recommended) or wget are required to download dotnet. Install missing prerequisite to proceed.
    The command '/bin/sh -c ./dotnet-install.sh -c 3.1 -i ${DOTNET_ROOT} --runtime aspnetcore --verbose &&     rm -rf dotnet-install.sh' returned a non-zero code: 1
    
  7. danmoseley commented on Sep 8, 2021

    @danmoseley

    Installing on Alpine 3.13.4 I get this (after first failing due to not having bash, and installing bash)

    danmose3:~/git# /root/git/performance/tools/dotnet/x64/dotnet-install.sh -InstallDir /root/git/performance/tools/dotnet/x64 -Architecture x64 -Channel 6.0
    dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
    dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
    dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
    dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.
    
    wget: unrecognized option: waitretry
    BusyBox v1.32.1 () multi-call binary.
    

    On this Alpine (the one from the Windows Store for WSL2) there is no curl out of the box, and wget offered by BusyBox does not support a flag that dotnet-install.sh is trying to use.

    Installing curl fixes this.

    Can you avoid the waitretry flag and any others that don't work on Alpine? Or if that's not possible, as second best, detect this problem and recommend that the user install curl (apk add curl)

    As it is this just won't install on a fresh Alpine.

  8. bekir-ozturk commented on Sep 10, 2021

    @bekir-ozturk
    Contributor

    Thanks @danmoseley.
    I'm working on something to detect the unsupported flags. I will link the PR to this issue once ready.

  9. sammym1982 commented on Sep 15, 2021

    @sammym1982

    @bekir-ozturk we are still seeing the original issue in our CI builds on AzureDevOps. We do install curl as part of it but somehow the script fails the prereq check. This was working fine till afternoon 9/14 pst .

    apk add curl && curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin -c Current && /root/.dotnet/dotnet tool install -g dotnet-dump && /root/.dotnet/dotnet tool install -g dotnet-gcdump && /root/.dotnet/dotnet tool install -g dotnet-trace && /root/.dotnet/dotnet tool install -g dotnet-counters && /root/.dotnet/dotnet tool install -g dotnet-stack

  10. bekir-ozturk commented on Sep 15, 2021

    @bekir-ozturk
    Contributor

    Hi @sammym1982,
    The fix is still waiting to be deployed to dot.net website. Please track here: https://github.com/dotnet/website/pull/3225
    I will update this thread once it goes through.

  11. sammym1982 commented on Sep 20, 2021

    @sammym1982

    Hi I am not able to access this link but what is the latest on fix. BTW we also started seeing same error with https://aka.ms/getvsdbgsh . with the timing of the same error across both seems like other scripts are also impacted. I don't exactly know where this script is localted in github though. Can you confirm if the changes are related with this issue?

  12. bekir-ozturk commented on Sep 20, 2021

    @bekir-ozturk
    Contributor

    Hi @sammym1982,
    The changes at commit 1c54a3f went live on 16th of September, which should mitigate this issue with detecting curl on the machine.
    What error are you getting? If it is missing curl/wget, it should be fixed now. However, if you only have wget installed, then you will get a different error which will be fixed here #213.

  13. bekir-ozturk commented on Sep 20, 2021

    @bekir-ozturk
    Contributor

    @sammym1982 has confirmed offline that the latest fix has resolved the issue. Closing.

    For the issue regarding unrecognized options being used with wget, please track #216.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions