ghcup-hs icon indicating copy to clipboard operation
ghcup-hs copied to clipboard

Unable to install on Windows - curl mysys2 error

Open grab-a-byte opened this issue 2 years ago • 43 comments

Using the command from https://www.haskell.org/ghcup/# for windows, I consistently without fail get the error of the following.

...Msys2 doesn't exist, installing into C:\\ghcup\msys64
Starting installation in 5 seconds, this may take a while...
Downloading Msys2 archive 20221216...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.
Exception: Exec: Error executing command curl.exe with arguments '-o C:\Users\mrpar\AppData\Local\Temp\\msys2-base-x86_64-20221216.sfx.exe https://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20221216.sfx.exe'

I found the following on Stack overflow however this doesnt seem to do the trick. https://stackoverflow.com/questions/75018725/cant-update-ghc-on-windows

Really unsure what to do next. I have installed previously on other machines with the Haskell Platform when it was the main way to install with no issues so having to swap to this new experience and having things break is not the greatest

grab-a-byte avatar Jun 10 '23 11:06 grab-a-byte

Does https://www.haskell.org/ghcup/guide/#certificate-authority-errors-curl look like it might be relevant?

chreekat avatar Jun 10 '23 13:06 chreekat

Try: https://www.haskell.org/ghcup/guide/#certificate-authority-errors-curl

hasufell avatar Jun 10 '23 14:06 hasufell

New error now Which states the following

Get-FileWCSynchronous 57.09 MB  00:00:06
Exception: Exec: Error executing command C:\WINDOWS\system32\taskkill.exe with arguments '/F /FI "MODULES eq msys-2.0.dll"'

Happens even when running as Admin

Also curious why this isnt the default command if it's known to cause issues.

grab-a-byte avatar Jun 11 '23 11:06 grab-a-byte

Seems like something is wrong on your machine and e.g. antivirus or windows defender is killing processes (msys2 installation) before it can finish.

hasufell avatar Jun 11 '23 11:06 hasufell

I've disable antivirus and I'm still getting the same error.

grab-a-byte avatar Jun 11 '23 14:06 grab-a-byte

image

See the above screenshot for the error

grab-a-byte avatar Jun 11 '23 15:06 grab-a-byte

image

See the above screenshot for the error

I don't see the error here

hasufell avatar Jun 12 '23 08:06 hasufell

All the parts that say error at the start. It does this over and over for about 30 seconds then bombs out failing.

grab-a-byte avatar Jun 14 '23 20:06 grab-a-byte

Those particular messages are red herrings coming from gpg. Don't you love programs that say "error" when there's no error?

chreekat avatar Jun 15 '23 03:06 chreekat

Those seem to be network issues, managed company network, proxy configuration or other stuff.

I'm not sure you'll be able to make stack worl either. What's failing here is pacman installing stuff (part of msys2), which is needed by GHC toolchain.

hasufell avatar Jun 15 '23 06:06 hasufell

I ran into the same problem and fixed by using Powershell 5 instead of 7.

ingun37 avatar Jun 15 '23 23:06 ingun37

Is there any way to use the old Haskell Platform to install instead? It seemed a lot more stable than this.

grab-a-byte avatar Jun 16 '23 16:06 grab-a-byte

@parkeradam it sucks that things didn't just work perfectly for you. GHCup is the only decent modern tool for getting set up with a Haskell toolchain. I don't even use it or maintain it, I just know nearly everybody else has great experiences (e.g. this post) so I'm a big fan.

The particular kind of problem you are having has to do with the way your Windows is configured. It will cause a problem no matter what tool you try to use. I would recommend showing your problems to an Windows administrator and asking them for advice. If you figure it out, it would be great to let us know what the problem is, so we can document this particular case and save the next person some frustration. GHCup is optimized for the usual use case, but the goal is to support everybody, no matter their circumstance. Good luck.

chreekat avatar Jun 16 '23 17:06 chreekat

I honestly have no idea what would be causing it. I use Windows 11 Pro with a personal account and I don't have anything changed. I'm not under a policy for anything and I have tried to run as admin also so i'm at an absolute loss as to what could be causing it. It is a shame, hopefully it'll be fixed soon but I also dont understand why there isnt a native toolchain like most other languages i've used (node js, golang, rust, zig, etc etc)

grab-a-byte avatar Jun 16 '23 18:06 grab-a-byte

Is there any way to use the old Haskell Platform to install instead? It seemed a lot more stable than this.

No, the Haskell Platform is discontinued.

You can try following the manual step by step installation guide and then precisely track down which step fails: https://www.haskell.org/ghcup/install/#windows_1

It appears to be pacman... which is part of msys2. This is outside of GHCup's responsibilities. We do not maintain pacman or msys2. We just use it. And so will all other tools that want to use GHC.

hasufell avatar Jun 16 '23 18:06 hasufell

I think i'll leave this then as it's not been as pleasant of a experience as the last time I tried with the Haskell Platform. I appreciate you all trying to help however.

grab-a-byte avatar Jun 18 '23 15:06 grab-a-byte

Just to add another data point to this issue, we've just had someone on #haskell on IRC who was running into the same issue. They said they were on Windows 10 Home. They haven't resolved their issue either, but it seems like installations on windows might be somewhat broken because windows doesn't like the haskell.org certificate.

axman6 avatar Jun 22 '23 05:06 axman6

I've literally reinstalled windows 11 from fresh since I filed this and it seems to have been resolved but I did have to run the install command about 3 times before it actually installed so I do believe there is likely an issue somewhere in the install process.

grab-a-byte avatar Jun 22 '23 20:06 grab-a-byte

I got this issue as well. It's complaining about not being able to check the certificate. Since this problem still hasn't been solved, I guess this program is hopeless.

The website was also terrible in explaining how to install it. If I didn't have some background in similar installations, then I wouldn't have even been able to make even an attempt at installing. It really sucks when explanations are crappy.

ghost avatar Jul 17 '23 15:07 ghost

I got this issue as well. It's complaining about not being able to check the certificate.

I'm not maintaining those website certificate. There has been recurring issues with it. So the people in power will have to be contacted.

There are ways to ignore faulty certificates. We could have a switch for that.

However, I think I've explained multiple times in this thread that you can disable curl: https://www.haskell.org/ghcup/guide/#certificate-authority-errors-curl

This is documented clearly in the troubleshooting guide.

Since this problem still hasn't been solved, I guess this program is hopeless.

You can use chocolatey instead.

The website was also terrible in explaining how to install it.

This is too vague to have any user report value for me. It's literally a single command. The troubleshooting guide shows you alternative commands.

And finally, there's a very verbose step by step manual installation guide where you can get to the bottom of the issue: https://www.haskell.org/ghcup/install/#manual-installation

So, if you expect me to invest time in this, you should give better info.

I'm an unpaid volunteer.

hasufell avatar Jul 17 '23 16:07 hasufell

Yeah, I executed what you wrote and guess what the response was?? The files are infected. There is good a reason why antivirus blocks dowloading this program!!!!!! Thanks a lot for the virusses!!!!

Installing is also not a single command! You've really lost touch with the basics if you can't even understand this fact. It even indicates that you don't really understand what you're actually doing. I had to get help on google as this site was super unclear. Actually write down the steps that you need to do to install the program instead of "claiming" it is a single command.

If you wanna be an unpaid volunteer, then that's your choice. I have nothing to do with it.

ghost avatar Jul 17 '23 16:07 ghost

@SarahSchrijvers This is an incredibly disrespectful way to interact with anyone, let alone people who want to help you. The root cause of this problem appears to be something Microsoft have done, which can't be worked around easily. I'm sorry that you've run into this issue, you're getting angry at the wrong people. If you have any concrete evidence there is a security problem with what you have downloaded, please share it - antivirus software often has false positives but if somehow something has happened to the artefacts provided by the project I'm sure they would like to inspect them.

If you can provide any more details about what errors you're running into, then maybe we can help. But keep in mind that the developers have no control over how curl operates, and absolutely no control over how Microsoft manage their certificates, and if they have misconfigured them it's outside the developer's control. As you've see above, some people have had success running the command several times - something that indicates this is a very tricky problem to track down and resolve, particularly if they can't replicate if themselves.

Whatever you do, please reconsider your tone, you're talking to human beings who have worked hard to provide you with tools for free, who have friends and family just like you, and don't need some disrespectful person ruining their day by blaming them for problems outside their control.

axman6 avatar Jul 18 '23 00:07 axman6

The files are infected

Please report that to the msys2 developers: https://www.msys2.org/contact/

It happens very frequently that windows antivirus flags programs incorrectly. This has happened before in other cases and it was usually resolved by reporting it to Microsoft.

Thanks a lot for the virusses!!!!

GHCup is affiliated with the Haskell Foundation and as such also collaborates with the Haskell Security Response team.

I can ask @frasertweedale from that team to look into this, but I'm pretty certain this is either an issue with msys2 or antivirus flagging files incorrectly. GHCup is used in thousands of CIs, including github actions and their virtual images. If it would install viruses, this wouldn't have gone unnoticed.

One way forward could be to host msys2 tarballs on our own servers and verify the hashes properly (which we unfortunately don't do for msys2, since it used to point to a mutable tarball). I'll do that shortly.

Installing is also not a single command! You've really lost touch with the basics if you can't even understand this fact.

You are right, it's technically two, in one line. Does that bother you? Why does it matter? What did you actually do?

If you wanna be an unpaid volunteer, then that's your choice. I have nothing to do with it.

No, I think I don't want, so if you need further assistance, please donate first.

hasufell avatar Jul 18 '23 01:07 hasufell

One way forward could be to host msys2 tarballs on our own servers and verify the hashes properly (which we unfortunately don't do for msys2, since it used to point to a mutable tarball). I'll do that shortly.

Done:

  • https://github.com/haskell/ghcup-hs/pull/857
  • script updated: https://haskell.org/ghcup/sh/bootstrap-haskell.ps1
  • https://downloads.haskell.org/~ghcup/msys2/

hasufell avatar Jul 18 '23 02:07 hasufell

I also opened an audit request for GHCup download practices: https://github.com/haskell/ghcup-hs/issues/858

hasufell avatar Jul 18 '23 02:07 hasufell

@axmant6 Nothing what I said was disrespectful. I didn't even insult anyone. I'm completely justified to react in this way. I will not be bullied by people, even online.

The way that this program needs to be downloaded isn't normal for windows and it is even less normal that you should have to turn your antivirus off to download it.

You also haven't had to experience the consequences of trying to download your program. My laptop has started constantly freezing up or even crashing, which it never did before I downloaded your program. You know full well that I won't be able to prove this program caused it, besides knowing the issues started once I downloaded the program (maybe a computer expert could prove it, but I have no idea).

I also wouldn't even make such of an issue of it if I didn't need the program for a class at college. I've tried many alternatives, but it always comes down to the same fact: I need the file that I can't download and that my antivirus blocked due to being infected. It's a really sucky prospect that I'm gonna fail a class at college due to not being able to download the computer program needed to complete the course.

ghost avatar Jul 22 '23 15:07 ghost

Yeah nah, you were quite disrespectful @Anubisnien. You seem to be facing a high pressure and stressful situation, but that does not excuse your attitude.

If you did not already try, perhaps set up a Linux virtual machine in which to do your Haskell work. Then your antivirus would (I guess) not have cause to complain.

frasertweedale avatar Jul 22 '23 15:07 frasertweedale

@axmant6 Nothing what I said was disrespectful. I didn't even insult anyone. I'm completely justified to react in this way. I will not be bullied by people, even online.

The way that this program needs to be downloaded isn't normal for windows and it is even less normal that you should have to turn your antivirus off to download it.

You also haven't had to experience the consequences of trying to download your program. My laptop has started constantly freezing up or even crashing, which it never did before I downloaded your program. You know full well that I won't be able to prove this program caused it, besides knowing the issues started once I downloaded the program (maybe a computer expert could prove it, but I have no idea).

I also wouldn't even make such of an issue of it if I didn't need the program for a class at college. I've tried many alternatives, but it always comes down to the same fact: I need the file that I can't download and that my antivirus blocked due to being infected. It's a really sucky prospect that I'm gonna fail a class at college due to not being able to download the computer program needed to complete the course.

I'm not going to address all this other than to say: it's not my program, I'm literally only here to help you and others. Also, the community of people teaching Haskell is very small, and we likely know who your lecturer is. There's a pretty good chance they might see this interaction you're having with people in their community. Perhaps rather than making baseless accusations, you could actually share some details, or talk to your lecturer and ask them for help. Fraser's suggestion of using a Linux virtual machine is a good one, if you need references for how to do that, just ask.

Lastly, if you don't think that your behaviour here has been disrespectful, you need to sit down and reevaluate how you interact with other people. I understand you're frustrated, we are here to help you if you show the respect we deserve - you wouldn't behave this way in person, so don't do it online, or you'll find the internet a very lonely place, and no will want to help you.

axman6 avatar Jul 23 '23 00:07 axman6

Thanks for the support, but as an end-user facing tool maintainer, I'm quite used to negative irrational feedback.

There's one thing that's probably true here, though:

The way that this program needs to be downloaded isn't normal for windows

Ultimately, we really want an .msi installer or something like that. But that's not something I'm going to work on without getting paid or serious boredom.

hasufell avatar Jul 23 '23 14:07 hasufell

It seems clear that (a) msys and/or sloppy intermediate certificate authorities make installing ghcup fail for some people, some of the time (b) a nicer Windows-native install mechanism would be ideal (c) such a thing must wait for some kind of patronage to provide the necessary support.

I am not sure this particular issue needs to stay open to reflect this situation, given the flamey messages sent by now-deleted users that litter the comments. Alternatively, a maintainer/mod should delete them as off topic.

chreekat avatar Jul 31 '23 14:07 chreekat