How to fix "Exit with return code 256"

I had the problem that i could not install ANYTHING in Lutris, because it always sended me message 256 in the log. There was no answer on the internet. I found my problem.

Some distros like mine (Manjaro), install dev versions of wine and wine tricks on the distro, you have to install classic ones.

How i solved my problem:

  • Uninstall anything related with wine, winetricks and lutris.
  • Remove all folders made by lutris (typically in ~/games and ~/wine games) Also try:
sudo rm -rf /var/lib/lutris   
sudo rm -rf /var/lutris
sudo rm -rf /lutris
rm -rf ~/.config/lutris
  • Do the same erase folders process with wine. Just replace lutris with wine on the commands
  • Install wine in your package manager. In my case is:
sudo pacman -S wine
  • Check your version is the latest one for regular use (NOT DEVELOPMENT). In 2023 is 8.1
wine --version
  • Install winetricks. In my case (Manjaro pacman aur), the only avaliable version is the development one. So i installed manualy winetricks with:
cd "${HOME}/Downloads"
wget  https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
chmod +x winetricks
sudo cp winetricks /usr/local/bin

Or

cd "${HOME}/Downloads"
wget  https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks.bash-completion
sudo cp winetricks.bash-completion /usr/share/bash-completion/completions/winetricks
  • After that, re-install lutris. In my case is
sudo pacman -S lutris
  • Install your favorite game from lutris website
  • The game should be installing and message #256 should’nt be appearing anymore

Winetricks website:

Winetricks - WineHQ Wiki

1 Like

Hello.

Very interesting.
Thank for all.

I see (and try) another method without terminal :

Its works for me.

Easy, just destroy a file.

2 Likes

The problem is, that’s not a useful error code. There are many wrongs that will cause Lutris to spit out that error.

They might as well just use “exit 1” so people aren’t chasing their tails thinking that 256 code is a useful diagnostic.

Anything other than “0” is an unsuccessful termination. Programs and scripts can return different error codes for different reasons of failure, but this does not seem to be the case here, or this code may be returned for too many unknown failures to be useful.

It could also be something silly like, the error code being multiplied by 256 and it’s really exit code 1 :slight_smile:

1 Like

Sorry for replying so long after the initial post, but are you able to provide more detail on how to do this on a Ubuntu/Debian distro? (If you are wondering I’m using Linux Mint 21.2 Version 5.8.4 with the 5.15.0-84-generic Linux Kernel)

are you asking how to follow this tutorial? if so I can help you. my discord is “dagoated77”

also-
I had the same problem and this tutorial helped me.

I faced this error code because on a certain installation step, a download of a tar file was failing and the installer was going ahead anyway and trying to extract the file, which was not present – after manually downloading that file (whose url was mentioned in the logs), and placing it in the required directory (also mentioned in the logs), the installation was successful. Just cancelled the installation without removing game files and started it again.

So, as @Grogan mentioned, it could be anything…

I just had to troubleshoot an error code 256 during install of Setllers II, so I thought I’d share how I found the solution – after a considerable number of wrong guesses.

I finally found the real problem by launching Lutris from a terminal with:

lutris -d

Users of the Flatpak release would launch it like this:

flatpak run net.lutris.Lutris -d

This shows the install log in the terminal which doesn’t disappear when the install finishes.

Among the output I saw this:

DEBUG    2024-03-10 01:52:13,716 [interpreter._iter_commands:317]:Installer command: {'execute': {'args': "-c 'mv $GAMEDIR/drive_c/game/* $GAMEDIR'", 'file': '/bin/sh', 'terminal': False}}
lutris-wrapper: /bin/sh
Started initial process 223988 from /bin/sh -c mv /home/thub/Games/gog/the-settlers-ii-gold-edition/drive_c/game/* /home/thub/Games/gog/the-settlers-ii-gold-edition
Start monitoring process.
mv: /home/thub/.local/share/lutris/runtime/steam/amd64/lib/x86_64-linux-gnu/libattr.so.1: version `ATTR_1.3' not found (required by mv)
Monitored process exited.
Initial process has exited (return code: 256)
All processes have quit
Exit with return code 256
DEBUG    2024-03-10 01:52:13,960 [command.on_stop:219]:Process 223986 has terminated with code 256
DEBUG    2024-03-10 01:52:14,720 [commands._monitor_task:441]:Return code: 256
ERROR    2024-03-10 01:52:14,720 [errors.__init__:18]:Command exited with code 256
ERROR    2024-03-10 01:52:14,720 [exception_backstops.error_wrapper:81]:Error handling timeout function: Command exited with code 256
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/lutris/exception_backstops.py", line 79, in error_wrapper
    return handler(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/lutris/installer/commands.py", line 443, in _monitor_task
    raise ScriptingError(_("Command exited with code %s") % command.return_code)
lutris.installer.errors.ScriptingError: Command exited with code 256

I could see that the wine-based installer exited with a normal exit code of 0, but a subsequent command to clean up the files involved a shell mv command, which spit out a version conflict error with a file in a steam runtime folder located among the Lutris runtimes. I browsed to the folder /home/thub/.local/share/lutris/runtime/steam, renamed it, and relaunched lutris -d so that I could see the log output and I tried the install again. This time it worked perfectly! Now I know I can safely delete that renamed folder.

It seems that as of early 2021 (based on the date on that folder), whatever version of Lutris I had installed downloaded a version of the Steam runtime and since then Lutris has changed how it handles this, at least for local Lutris installs (it may behave differently when running inside a Flatpak). This runtime had some pretty old libraries which caused a problem because the executable was running from my own system (/bin/sh) which should be pretty up-to-date.

As a point of information, error code 256 has a general meaning on Linux. This error can happen any time the system fails to execute an executable binary. That means that library conflicts are a likely culprit, so being able to see the log for the install is important to troubleshoot such an error. In my case, the program couldn’t find all the libraries it needed to execute its one-line script with the mv command.

Of course, error code 256 could be arbitrarily coming from the Windows binary for any number of reasons, so keep your wits about you. :wink:

I hope this helps someone.