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

MSYS2 system update (optional) failed #295

Open
kapitanluffy opened this issue Jul 25, 2022 · 9 comments
Open

MSYS2 system update (optional) failed #295

kapitanluffy opened this issue Jul 25, 2022 · 9 comments

Comments

@kapitanluffy
Copy link

Cannot install seamlessly.

Steps to reproduce

  1. Run ridk install 1 2 3
MSYS2 seems to be unavailable
Download http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20190524.exe
  to C:\Users\xxx\AppData\Local\Temp/msys2-x86_64-20190524.exe
Downloading msys2-x86_64-20190524.exe (100%)
Verify integrity of msys2-x86_64-20190524.exe ... OK
Run the MSYS2 installer ...
> C:\Users\xxx\AppData\Local\Temp/msys2-x86_64-20190524.exe
> sh -lc true
 Success
Check msys2-keyring version:
 -> Update keyring according to https://www.msys2.org/news/#2020-06-29-new-packagers
> pacman -U --noconfirm --config C:/Users/xxx/AppData/Local/Temp/20220726-17588-4m5qqw D:/~/bin/ruby/3.0/packages/msys2-keyring-1~20211228-1-any.pkg.tar.zst
loading packages...
error: could not open file D:/~/bin/ruby/3.0/packages/msys2-keyring-1~20211228-1-any.pkg.tar.zst: Child process exited with status 127
error: 'D:/~/bin/ruby/3.0/packages/msys2-keyring-1~20211228-1-any.pkg.tar.zst': cannot open package file
Remove catgets to avoid conflicts while update  ...
> pacman -Rdd catgets libcatgets --noconfirm
error: target not found: catgets
error: target not found: libcatgets
MSYS2 system update (optional) part 1  ...
> pacman -Syu --needed --noconfirm
:: Synchronizing package databases...
 mingw32                                                                                              1640.7 KiB   274K/s 00:06 [############################################################################] 100%  mingw32.sig                                                                                           566.0   B   553K/s 00:00 [############################################################################] 100% error: mingw32: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" is unknown
error: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" could not be looked up remotely
error: failed to update mingw32 (invalid or corrupted database (PGP signature))
 mingw64                                                                                              1650.3 KiB   255K/s 00:06 [############################################################################] 100%  mingw64.sig                                                                                           566.0   B   553K/s 00:00 [############################################################################] 100% error: mingw64: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" is unknown
error: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" could not be looked up remotely
error: failed to update mingw64 (invalid or corrupted database (PGP signature))
 msys                                                                                                  395.8 KiB   255K/s 00:02 [############################################################################] 100%  msys.sig                                                                                              566.0   B   553K/s 00:00 [############################################################################] 100% error: msys: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" is unknown
error: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" could not be looked up remotely
error: failed to update msys (invalid or corrupted database (PGP signature))
error: failed to synchronize all databases
MSYS2 system update (optional) failed
D:/~/bin/ruby/3.0/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/components/02_pacman_update.rb:37:in `block in execute': pacman failed (RuntimeError)
        from D:/~/bin/ruby/3.0/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/msys2_installation.rb:236:in `with_msys_apps_enabled'
        from D:/~/bin/ruby/3.0/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/components/02_pacman_update.rb:16:in `execute'
        from D:/~/bin/ruby/3.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
        from D:/~/bin/ruby/3.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/task.rb:199:in `synchronize'
        from D:/~/bin/ruby/3.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/task.rb:199:in `invoke_with_call_chain'
        from D:/~/bin/ruby/3.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/task.rb:188:in `invoke'
        from D:/~/bin/ruby/3.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/application.rb:160:in `invoke_task'
        from D:/~/bin/ruby/3.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/application.rb:116:in `block (2 levels) in top_level'
        from D:/~/bin/ruby/3.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/application.rb:116:in `each'
        from D:/~/bin/ruby/3.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/application.rb:116:in `block in top_level'
        from D:/~/bin/ruby/3.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/application.rb:125:in `run_with_threads'
        from D:/~/bin/ruby/3.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/application.rb:110:in `top_level'
        from D:/~/bin/ruby/3.0/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/components_installer.rb:35:in `install'
        from D:/~/bin/ruby/3.0/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/ridk.rb:99:in `install'
        from D:/~/bin/ruby/3.0/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/ridk.rb:14:in `run!'
        from D:/~/bin/ruby/3.0/bin/ridk.cmd:39:in `<main>'
@larskanis
Copy link
Member

The file D:/~/bin/ruby/3.0/packages/msys2-keyring-1~20211228-1-any.pkg.tar.zst is missing, so that the key database isn't updated and hence the MSYS2 system update fails. Could you please check why this file isn't available?

@kapitanluffy
Copy link
Author

The file D:/~/bin/ruby/3.0/packages/msys2-keyring-1~20211228-1-any.pkg.tar.zst is missing, so that the key database isn't updated and hence the MSYS2 system update fails. Could you please check why this file isn't available?

Oh. I forgot to mention. It does exist.

image

@hochleitner
Copy link

I'm running into the same issue here, except it's Ruby 3.1.0 with the latest installer (from Chocolatey). I did a fresh install where ridk install 1 works and installs MSYS2. But options 2 and 3 fail with the above errors. The keyring file is there as well, but the keys don't get recognized. I tried the steps from back here https://www.msys2.org/news/#2020-06-29-new-packagers (which shouldn't be an issue anymore, right?) but without success. Any help is appreciated.

@kapitanluffy
Copy link
Author

@hochleitner yeah, for some reason it cannot find the archive. The newer version seem to work properly though. Here's my pull request for a fix. #296

@hochleitner
Copy link

It seems to be an issue with the included MSYS2 2019 that's very specific to resolve. I gave up, installed MSYS2 2022 before Ruby separately and everything works.
I just wish I hadn't spent hours for this. 🙈

@kapitanluffy
Copy link
Author

Yeah. That's why I forked and made it use the latest version (for windows at least) since I need to automate it.

Happy that you solved your issue 😆

@magynhard
Copy link
Contributor

On Windows 11 the current msys2 installation/updates with ridk install 1 2 3 only succed from ruby 2.6.x and above, but 2.5.x and 2.4.x fail, so I'm not able to install native gems on a fresh install of 2.4.x / 2.5.x anymore out of the box. Guess because the prepackaged MSYS2 configuration is outdated and databases and packages can not be found anymore.

Tried with 2.4.10 and 2.5.9.

@MSP-Greg
Copy link
Contributor

MSP-Greg commented May 10, 2024

Since Ruby 2.4 was in development I've used a shared MSYS2 install for all Rubies. So, I rarely use the RIDK MSYS2 functionality.
Not sure about this.

Try setting this (PS) before you run the ridk command:

$env:MSYS2_VERSION = '20220503'
  or
$env:MSYS2_VERSION = '20240507'

Proceed at your own risk, some recent packages (re OpenSSL) may not be compatible with older Rubies. Some extension gems still run CI on older Rubies, so some c source does compile with the current MSYS2 tools.

EDIT:
Note that Ruby 2.4 was compiled with gcc 9.3.0, but current MSYS2 is using gcc 14.1.0.

@magynhard
Copy link
Contributor

When trying it with setting the env variable, it expects to find the installer inside the users TEMP directory at

Run the MSYS2 installer ...
> C:\Users\User\AppData\Local\Temp/msys2-x86_64-20240507.exe
 Failed

that does not exist.

But by understanding the problem, i managed setting it up manually, so thank you!

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

No branches or pull requests

5 participants