Alexpux / MSYS2-pacman

MSYS2 port of Arch Linux packman package manager.
GNU General Public License v2.0
164 stars 34 forks source link

Upgrade completely breaks msys2 #38

Closed jeroen closed 6 years ago

jeroen commented 8 years ago

Each time I run pacman -Syu the upgrade fails and after that msys2 is broken beyond repair.

As suggested I checked for conflicting cygwin1.dll files but there are no such files on my path.

:: Processing package changes...
(1/4) upgrading msys2-runtime                      [#####################] 100%
(2/4) upgrading bash                               [#####################] 100%
(3/4) upgrading filesystem                         [#####################] 100%
      2 [main] pacman (4100) C:\msys2-x64\usr\bin\pacman.exe: *** fatal error -                       cygheap base mismatch detected - 0x180326400/0x18033A408.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version.  The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution.  Rebooting is also suggested if you
are unable to find another cygwin DLL.
      0 [main] pacman 3332 fork: child -1 - forked process 4100 died unexpectedl                      y, retry 0, exit code 0xC0000005, errno 11
error: could not fork a new process (Resource temporarily unavailable)
(4/4) upgrading mintty                             [#####################] 100%
warning: terminate MSYS2 without returning to shell and check for updates again
warning: for example close your terminal window instead of calling exit
jeroen commented 8 years ago

So I was able to resolve the problem by first upgrading

pacman -Sy msys2-runtime

After this upgrade the shell no longer works, so we need to exit. Once we restart we can upgrade mintty and bash. Safest is upgrading filesystem at the very end because it gives an important warning having to manually change shortcuts.

Maybe it's time for a new version of the installer?

jeroen commented 8 years ago

Just to emphasize, the problem is that after upgrading msys2-runtime the current shell must be restarted.


Total Download Size:    2.24 MiB
Total Installed Size:   8.32 MiB
Net Upgrade Size:      -0.16 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
 msys2-runtime-2.5.2...     2.2 MiB  1165K/s 00:02 [#####################] 100%
(1/1) checking keys in keyring                     [#####################] 100%
(1/1) checking package integrity                   [#####################] 100%
(1/1) loading package files                        [#####################] 100%
(1/1) checking for file conflicts                  [#####################] 100%
(1/1) checking available disk space                [#####################] 100%
:: Processing package changes...
(1/1) upgrading msys2-runtime                      [#####################] 100%

Jeroen@Windows7 MSYS ~
$ ls
      7 [main] bash (344) C:\msys2-i686\usr\bin\bash.exe: *** fatal error - cygh                                 eap base mismatch detected - 0x180326400/0x18033A408.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version.  The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution.  Rebooting is also suggested if you
are unable to find another cygwin DLL.
      0 [main] bash 4120 fork: child -1 - forked process 344 died unexpectedly,                                  retry 0, exit code 0xC0000005, errno 11
bash: fork: retry: No child processes
elieux commented 8 years ago

This is a long-standing issue with the runtime. It's unlikely to be fixed soon, but there are alerts and warnings everywhere, so that people don't end up with their installation "broken beyond repair". Every guide for installing/upgrading MSYS2 (homepage, wiki) mentions the correct steps to get a working up-to-date installation. Even pacman in your original post says this:

warning: terminate MSYS2 without returning to shell and check for updates again warning: for example close your terminal window instead of calling exit

New installers are on our todo list, but that will just fix the filesystem issues, not the need to restart MSYS2 after a runtime upgrade.

jeroen commented 8 years ago

Actually I followed the steps from the homepage and ended up like this. The problem is that the homepage recommends pacman -Syu. This breaks the installation, because it starts with upgrading msys2-runtime and then automatically continues with upgrading other packages. The upgrade of these subsequent packages fails due to the DLL errors, leaving stuff in an ambiguous state.

I think the correct instructions would be to first upgrade msys2-runtime, then restart msys2, and then upgrade the other packages.

elieux commented 8 years ago

ended up like this

I actually don't know what you mean. Is the failure after filesystem the only thing bothering you?

If yes, please know that the failure is not critical and only prevents you from seeing the deprecation message about the .bat files. New installers (when released) will fix this, at least for some time.

If not, and your installation is really "broken beyond repair", I still believe you didn't restart MSYS2 at the right time (pacman -Syu instructs you to restart if a critical component was updated) or didn't follow the guide (it says to upgrade pacman first by pacman -Sy pacman).

Please tell me which of the mentioned things (or something else) is actually bothering you, so I can address it better.

tnt commented 8 years ago

I also followed exactly the steps described on https://msys2.github.io/ (and closed the window after each single pacman call) and ended up the same way.

@elieux This is not just bothering - at least for me on my system. That "broken beyond repair" state was for me - as I installed it the first time - that those install instruction lead just to the error message and the message which explains how to update the links in the Startmenu was not shown. So the *.bat files were deleted and I was left completly alone with the new MSYS2_ROOT\msys2_shell.cmd without knowing how to use it. (The *.exe files were also not there.)

Maybe it is relevant to reproduce the errors: I have a Windows 10 pro x64 and used the x64 Msys-installer. And I have the git for windows and had tried before mingw and MSYS...


Now it works fine and I'm very pleased to have pacman now and don't need to use cygwin for being a little bit comforted for having to use Windows by having the familar unix tools. Very nice!

sskras commented 8 years ago

@elieux:

New installers (when released) will fix this

Thanks, I am interested! Is their source code available, public? It seems I cannot find it.

elieux commented 8 years ago

@s4kr4s, see https://github.com/Alexpux/MSYS2-packages/tree/master/msys2-installer

elieux commented 8 years ago

@alexpux, @renatosilva, I think we should just put the .bat files back (calling msys2_shell.cmd inside) and remove the post-install from filesystem. Otherwise the post-install failure will haunt us forever.

jonwwilkes commented 7 years ago

I ran into this exact issue today.

I read and followed the instructions. Proof of comprehension: step number 6 has a redundant redundancy: "Update the rest with: Update the package database and core system packages with:" :)

jeroen commented 6 years ago

This has now been solved by providing up to date installers.

sz332 commented 5 years ago

I ran into the same problem today. Followed the instructions on the webpage, got it broken. Now i will try what others recommend.

okamsn commented 5 years ago

I too also ran into trouble by following the instructions on the website. After updating with pacman -Syu, I couldn't close Mintty without error.

To get things working, I followed these steps

  1. Launch Msys2 from installer.
  2. Update only msys2-runtime, as previously noted.
  3. Close and reopen msys2.
  4. Update other packages with pacman -Syu. This instructed me to close Mintty without returning to the shell, which I was finally able to do successfully.
  5. Re-open Msys2, and update further with pacman -Su.

All seems to be working now.