A download failed [GHCup-05841]

GHCup was asked to install a given version of a tool, but the download via curl or wget failed.

As an example, trying to install a GHC version via a non-existent URL will result in:

$ ghcup install ghc -u https://nothing/ghc.tar.gz 9.4.3
[ Info  ] downloading: https://nothing/ghc.tar.gz as file /home/hasufell/.ghcup/cache/ghc.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: nothing
[ Error ] [GHCup-05841] Download failed: Process "curl" with arguments ["-fL", "-o",
[ ...   ]                                                 "/home/hasufell/.ghcup/cache/ghc.tar.gz.tmp",
[ ...   ]                                                 "https://nothing/ghc.tar.gz"] failed with exit code 6.
[ Error ] Also check the logs in /home/hasufell/.ghcup/logs

This error is a combination of GHCup-00841 and GHCup-05000. Sometimes you may encounter GHCup-00160 instead, depending on how you invoked ghcup.

Reasons for this error:

The best way to debug this is trying to download the URL manually:

If you’re using a proxy, make sure your shell is configured to use the correct configuration via the https_proxy/http_proxy environment variables.

If you believe GHCup is providing faulty URLs, open an issue here.