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

Banished: Wine extraction failed #605

Open
tastytea opened this issue Jul 5, 2024 · 21 comments
Open

Banished: Wine extraction failed #605

tastytea opened this issue Jul 5, 2024 · 21 comments

Comments

@tastytea
Copy link

tastytea commented Jul 5, 2024

i'm using the minigalaxy flatpak, version 1.3.0.

% MG_DEBUG=1 flatpak run io.github.sharkwouter.Minigalaxy
[…]
2024-07-05 12:58:52,443 - minigalaxy.download_manager.DownloadManager - DEBUG - Returning result from _download_operation: True
2024-07-05 12:58:52,446 - minigalaxy.download_manager.DownloadManager - DEBUG - Download finished, thread 140233517553344
2024-07-05 12:58:52,448 - minigalaxy - INFO - Installing Banished
2024-07-05 12:58:52,450 - minigalaxy.download_manager.DownloadManager - DEBUG - Removing download from active downloads list
2024-07-05 12:58:54,208 - minigalaxy - INFO - setup_banished_64_1.0.7_(14938).exe integrity is preserved. MD5 is: 463b2720c5c88c28f24de9176b8b1ec4
2024-07-05 13:00:13,283 - minigalaxy - ERROR - Wine extraction failed.

is there a way to get more debug info, try out different wine versions, …?

@sharkwouter
Copy link
Owner

This is probably an issue with the flatpak package. Can you reproduce it with a natively installed verison?

@tastytea
Copy link
Author

tastytea commented Jul 9, 2024

i tried to install minigalaxy_1.3.0_all.deb from the github release page in a debian 12 VM and minigalaxy won't start:

traceback
Traceback (most recent call last):
  File "/usr/games/minigalaxy", line 66, in <module>
    main()
  File "/usr/games/minigalaxy", line 46, in main
    from minigalaxy.ui.gtk import Gtk
  File "/usr/lib/python3/dist-packages/minigalaxy/ui/__init__.py", line 3, in <module>
    from minigalaxy.ui.window import Window             # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/minigalaxy/ui/window.py", line 6, in <module>
    from minigalaxy.ui.categoryfilters import CategoryFilters
  File "/usr/lib/python3/dist-packages/minigalaxy/ui/categoryfilters.py", line 6, in <module>
    from minigalaxy.ui.filterswitch import FilterSwitch
  File "/usr/lib/python3/dist-packages/minigalaxy/ui/filterswitch.py", line 4, in <module>
    from minigalaxy.ui.gtk import Gtk
  File "/usr/lib/python3/dist-packages/minigalaxy/ui/gtk.py", line 5, in <module>
    gi.require_version('Notify', '0.7')
  File "/usr/lib/python3/dist-packages/gi/__init__.py", line 126, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Notify not available

with the minigalaxy in debian's repos (1.2.2) and wine-8.0 Banished installs, but won't start:

traceback
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/minigalaxy/ui/gametile.py", line 127, in on_button_click
    err_msg = start_game(self.game)
              ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/minigalaxy/launcher.py", line 46, in start_game
    error_message, process = run_game_subprocess(game)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/minigalaxy/launcher.py", line 203, in run_game_subprocess
    get_execute_command(game),
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/minigalaxy/launcher.py", line 63, in get_execute_command
    exe_cmd = get_windows_exe_cmd(game, files)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/minigalaxy/launcher.py", line 140, in get_windows_exe_cmd
    filename = os.path.splitext(os.path.basename(executables[0]))[0] + '.exe'
                                                 ~~~~~~~~~~~^^^
IndexError: list index out of range

i'd rather not install it on my gentoo machine because that would mean a lot of compilation that i try to avoid with flatpak 😊

@ell1e
Copy link

ell1e commented Jul 9, 2024

I think this is possibly related to #602 and might be a race condition or some other unpredictable trigger. When I prompt to install a few games, I seem to see this with every 2nd one or so. Maybe it's related to queuing multiple games to install at once?

Edit: or maybe it's some of the installer downloads getting corrupted or truncated due to internet hiccups? Is minigalaxy verifying the checksum of what it downloaded before running it? If not, maybe that could also be the cause. Whatever it is, it feels like throwing dice to see whether an install works fine or not.

Edit 2: nevermind I got to test it with a better internet connection and the extraction failed still happens with the same games

@sharkwouter
Copy link
Owner

It did some more research into this and it turns out that the dependency on the package gir1.2-notify-0.7 is missing from the Debian package. @tastytea can you try installing it?

@tastytea
Copy link
Author

tastytea commented Aug 7, 2024

with gir1.2-notify-0.7 installed minigalaxy 1.3.0 starts but i get this error when i try to install banished:

traceback
2024-08-07 10:58:43,820 - minigalaxy - ERROR - Error installing game Banished
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/minigalaxy/installer.py", line 66, in install_game
    error_message = extract_installer(game, installer, tmp_dir, language, _use_innoextract)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/minigalaxy/installer.py", line 131, in extract_installer
    err_msg = extract_windows(game, installer, temp_dir, language, use_innoextract)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/minigalaxy/installer.py", line 150, in extract_windows
    err_msg = extract_by_wine(game, installer, temp_dir)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/minigalaxy/installer.py", line 205, in extract_by_wine
    os.unlink(drive)
FileNotFoundError: [Errno 2] No such file or directory: '/home/tea/GOG Games/Banished/prefix/dosdevices/d:'
2024-08-07 10:58:43,841 - minigalaxy - ERROR - Unhandled error.

there is a symlink d:: to /dev/sr0 in this directory. after renaming it to d: banished installs. but when i hit play, i get the same error as with minigalaxy from the debian repos:

traceback
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/minigalaxy/ui/gametile.py", line 121, in on_button_click
    err_msg = start_game(self.game)
              ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/minigalaxy/launcher.py", line 48, in start_game
    error_message, process = run_game_subprocess(game)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/minigalaxy/launcher.py", line 205, in run_game_subprocess
    get_execute_command(game),
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/minigalaxy/launcher.py", line 65, in get_execute_command
    exe_cmd = get_windows_exe_cmd(game, files)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/minigalaxy/launcher.py", line 142, in get_windows_exe_cmd
    filename = os.path.splitext(os.path.basename(executables[0]))[0] + '.exe'
                                                 ~~~~~~~~~~~^^^
IndexError: list index out of range

@sharkwouter
Copy link
Owner

I'm not sure if python can work with files with : characters in it. Windows does not support that.

@ell1e
Copy link

ell1e commented Aug 7, 2024

It seems to work just fine:

~ $ python3
Python 3.12.4 (main, Aug  1 2024, 12:52:32) [GCC 13.2.1 20240309] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.mkdir(":test")
>>> os.listdir(":test")
[]
>>> f = open(":test/bla", "w"); f.write("test"); f.close()
4
>>> os.listdir(":test")
['bla']
>>>

@sharkwouter
Copy link
Owner

I'll have to investigate this. I don't understand what's going on.

@GB609
Copy link
Collaborator

GB609 commented Nov 27, 2024

@sharkwouter
It's the issue about drives i had when testing the fix #620.
So it seems like i am not the only one having an optical drive. Maybe it's better to change the letter as a temporary measure after all.

@sharkwouter
Copy link
Owner

@GB609 we can do that. What drive letter do you suggest? Would you want to make a PR or should apply the change?

@GB609
Copy link
Collaborator

GB609 commented Nov 27, 2024

I can make a PR for that.
Which letter...
Considering how wine tends to create drive links for all mounted physical device and removable storage, we should keep a couple of letters free. But picking an arbitrary letter in the middle appears a bit strange.
Maybe s(etup), i(install), t(emp) or something at the end but below z (reserved by wine itself)

@sharkwouter
Copy link
Owner

I think all of these are fine. I'd probably go with t.

GB609 added a commit to GB609/minigalaxy that referenced this issue Nov 27, 2024
@GB609
Copy link
Collaborator

GB609 commented Nov 27, 2024

See PR #621

GB609 added a commit to GB609/minigalaxy that referenced this issue Nov 27, 2024
@GB609
Copy link
Collaborator

GB609 commented Nov 28, 2024

There might be more to this issue than just the matter with the drive letter.
The first problem was that the installation didn't run because the drive d: and thus temporary install directory was not set up.

The second issue is likely related to the arguments used with the install command in wine itself.
I've found some issues with the /dir argument and how it is used while testing some changes on my fork.
But to diagnose further, a simple ls of the install_dir would already help to check if the game files have been set up correctly.
If yes, it's likely that the main executable is not in the root dir, but another subdirectory.

@GB609 GB609 mentioned this issue Nov 29, 2024
1 task
@ell1e
Copy link

ell1e commented Dec 14, 2024

It seems like this issue is still present in 1.3.1, if anybody was wondering. I'm seeing it e.g. with Fallout 3 GOTY.

@GB609
Copy link
Collaborator

GB609 commented Dec 14, 2024

Would you be able to try the code that's currently on the master branch of this repository? I basically completely reworked how wine installations work, but its not in a public release yet as we're still testing.
Just yesterday i've test-installed 11 windows games in a row without issues, one of them even was a windows dosbox game.
(Not all of them could start afterwards, but that is mostly due to missing winetricks etc)

@ell1e
Copy link

ell1e commented Dec 14, 2024

Yes I could try, but I'm unsure how to do it. I run minigalaxy in a flatpak since this is a musl system, so I can't really use it well outside of flatpak since that breaks most of the Linux native games. So ideally I would probably need to copy over the dev code into the flatpak sandbox or something. Is that possible? Or do you guys have some flatpak ref that leads to some dev build not from flathub?

@GB609
Copy link
Collaborator

GB609 commented Dec 14, 2024

How would your system being musl be related to any of that? And why do you think running minigalaxy natively and installing windows games breaks linux games? I don't understand how that would be related.
If your system's package manager provides python3, git and wine it should normally work as these are set up to work and run by the distribution maintainers.
However, if you don't feel confident about any of this, then don't do it. I don't want you to break your system by accident because of a test.
Generally speaking, i find it difficult to evaluate issues with a flatpak packaged application. Because flatpak adds at least one additional layer of complexity in terms of isolation and dependencies. Something that might even be completely out of minigalaxy's control because its something related to how fltpak works.
I'm sure flatpak has its uses for simple games and apps that don't need to do anything on the system outside their own directories.
I'm not sure the same could be said about something like minigalaxy whose actual nature is more on the 'administrative' side instead of self-containment.
I wouldnt manipulate the flatpak package, but wait for the next release instead.

@ell1e
Copy link

ell1e commented Dec 14, 2024

The linux games are glibc binaries, not musl binaries.

@GB609
Copy link
Collaborator

GB609 commented Dec 15, 2024

@ell1e
Just for my understanding: Your native system does not have any dynamic *.so files (because it is musl based) which glibc uses. That's why you have the linux games (from GOG i assume) all in a flatpak that brings those with it? Or, to be more precise, the 'native' linux games we are talking about are the ones installed by minigalaxy and they are therefore also placed and executed in the flatpak sandbox of minigalaxy?

In theory, you can have the git based developer variant of gog run in parallel with the flatpak without impacting it at all, as long as the native system has the packages needed for it available: Python3, git, webkit2gtk and 2 python modules. Plus wine for windows installations. The steps needed to get it up and running are explained here: Dev infos. The only package you wouldn't need to install is glade i guess, because that is a tool to design the ui. That's not necessary to just run minigalaxy from sources.

I'm not fully sure where the HOME for flatpak apps is. Might it be possible it's your regular user home? In that case the dev version of minigalaxy would share configuration files and install location paths with the flatpak variant. But that doesn't mean that it changes any of the games you've already installed, so long as you don't touch them from within minigalaxy's UI.

@ell1e
Copy link

ell1e commented Dec 15, 2024

Your understanding is mostly correct. At the risk of being pedantic, a musl system does have *.so files and is mostly the same, but you can't open musl *.so files from a glibc program. This means on a musl system, glibc Linux binaries will not run without some layer like flatpak or gcompat, since they miss all the system libraries, and gcompat isn't good enough to handle most games.

The home directory in flatpak is in ~/.var/app/io.github.sharkwouter.Minigalaxy.

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

4 participants