Matoking / protontricks

A wrapper that does winetricks things for Proton enabled games, requires Winetricks.
GNU General Public License v3.0
1.57k stars 35 forks source link

PT not launching #246

Closed brianx87 closed 10 months ago

brianx87 commented 10 months ago

Receiving the following error when launching PT. I've removed the list of non-steam game shortcuts from the error message as the list was quite long. Tried reinstalling and restarting with no luck.

Protontricks was closed due to the following error:

Traceback (most recent call last):

  File "/app/lib/python3.10/site-packages/PIL/JpegImagePlugin.py", line 639, in _save

    rawmode = RAWMODE[im.mode]

KeyError: 'P'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

  File "/app/lib/python3.10/site-packages/protontricks/cli/util.py", line 149, in wrapper

    return cli_func(self, *args, **kwargs)

  File "/app/lib/python3.10/site-packages/protontricks/cli/main.py", line 264, in main

    steam_app = select_steam_app_with_gui(

  File "/app/lib/python3.10/site-packages/protontricks/gui.py", line 318, in select_steam_app_with_gui

    appid2icon = _get_appid2icon(steam_apps, steam_path=steam_path)

  File "/app/lib/python3.10/site-packages/protontricks/gui.py", line 104, in _get_appid2icon

    resized_img.save(icon_cache_path)

  File "/app/lib/python3.10/site-packages/PIL/Image.py", line 2413, in save

    save_handler(self, fp, filename)

  File "/app/lib/python3.10/site-packages/PIL/JpegImagePlugin.py", line 642, in _save

    raise OSError(msg) from e

OSError: cannot write mode P as JPEG

=============

Please include this entire error message when making a bug report.

Log messages:

Running inside Flatpak sandbox, version 1.12.4.

Found Steam directory at /home/deck/.local/share/Steam

Using default Steam Runtime at /home/deck/.local/share/Steam/ubuntu12_32/steam-runtime

WINETRICKS environment variable is not available. Searching from $PATH.

Found 2 Steam library folders

Multiple compatdata directories found for app 275850

Multiple compatdata directories found for app 304240

Multiple compatdata directories found for app 2310

Multiple compatdata directories found for app 377160

Currently logged-in Steam user: 

Shortcut Konsole (4155333422) does not have a prefix. It's either not a Proton app or it hasn't been launched yet.

Found 7 Steam shortcuts running using Steam compatibility tools

Using 'yad' as GUI provider

App icon /home/deck/.local/share/Steam/appcache/librarycache/1092660_icon.jpg has unusual size, resizing
kristoffertell commented 10 months ago

I'm having the exact same issue on Steam Deck since updating to protontricks 1.10.4.

EDIT: For those that need to get it working and have their sudo password set up, you can downgrade to 1.10.3 by running this: sudo flatpak update --commit=828719815e853cbdd2d2dd36039596f033ea4fab476e4f4fd999a1c87dacafff com.github.Matoking.protontricks

Jlom93 commented 10 months ago

I'm having the same issue.

`Protontricks was closed due to the following error:

Traceback (most recent call last): File "/app/lib/python3.10/site-packages/PIL/JpegImagePlugin.py", line 639, in _save rawmode = RAWMODE[im.mode] KeyError: 'P'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/app/lib/python3.10/site-packages/protontricks/cli/util.py", line 149, in wrapper return cli_func(self, *args, **kwargs) File "/app/lib/python3.10/site-packages/protontricks/cli/main.py", line 264, in main steam_app = select_steam_app_with_gui( File "/app/lib/python3.10/site-packages/protontricks/gui.py", line 318, in select_steam_app_with_gui appid2icon = _get_appid2icon(steam_apps, steam_path=steam_path) File "/app/lib/python3.10/site-packages/protontricks/gui.py", line 104, in _get_appid2icon resized_img.save(icon_cache_path) File "/app/lib/python3.10/site-packages/PIL/Image.py", line 2413, in save save_handler(self, fp, filename) File "/app/lib/python3.10/site-packages/PIL/JpegImagePlugin.py", line 642, in _save raise OSError(msg) from e OSError: cannot write mode P as JPEG

@kristoffertell, unfortunately your suggestion didn't work but thank you!

shinseitom commented 10 months ago

Similar issue here, except instead of "P as JPEG" it's "RGBA as JPEG" In my case, seems to be related to using custom icons from SteamGridDB. Downgrading using the command from @kristoffertell got the gui to open.

Jlom93 commented 10 months ago

I'm having the same issue.

`Protontricks was closed due to the following error: Traceback (most recent call last): File "/app/lib/python3.10/site-packages/PIL/JpegImagePlugin.py", line 639, in _save rawmode = RAWMODE[im.mode] KeyError: 'P' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/app/lib/python3.10/site-packages/protontricks/cli/util.py", line 149, in wrapper return cli_func(self, *args, **kwargs) File "/app/lib/python3.10/site-packages/protontricks/cli/main.py", line 264, in main steam_app = select_steam_app_with_gui( File "/app/lib/python3.10/site-packages/protontricks/gui.py", line 318, in select_steam_app_with_gui appid2icon = _get_appid2icon(steam_apps, steam_path=steam_path) File "/app/lib/python3.10/site-packages/protontricks/gui.py", line 104, in _get_appid2icon resized_img.save(icon_cache_path) File "/app/lib/python3.10/site-packages/PIL/Image.py", line 2413, in save save_handler(self, fp, filename) File "/app/lib/python3.10/site-packages/PIL/JpegImagePlugin.py", line 642, in _save raise OSError(msg) from e OSError: cannot write mode P as JPEG

@kristoffertell, unfortunately your suggestion didn't work but thank you!

I have fixed the issue.

The last line of the log report says

App icon /home/deck/.local/share/Steam/appcache/librarycache/1092660_icon.jpg has unusual size, resizing

Your specific icon will be different but you need to locate the icon mentioned above, in the same directory. Once done so, open the image and it will show you its dimension - this needs to be 32x32 however most icons are 512x512.

If you have a photo editor like GIMP installed then you can resize the image to 32x32. if not, you can visit sites like iloveimg.com which will resize the image to your specific dimensions.

Replace the old icon with the new one, keep the names exactly the same.

Once you've replaced this icon PT should open without any problems.

If multiple icon are highlighted you will need to replace all of them.

Matoking commented 10 months ago

I pushed a small fix to icon conversion that should hopefully fix this. You can install the development version with this fixed applied using the following command:

flatpak install --user https://dl.flathub.org/build-repo/44386/com.github.Matoking.protontricks.flatpakref

Does this fix the bug?

JooZehh commented 10 months ago

It has!!! Thank you very much for the update

kristoffertell commented 10 months ago

I pushed a small fix to icon conversion that should hopefully fix this. You can install the development version with this fixed applied using the following command:

flatpak install --user https://dl.flathub.org/build-repo/44386/com.github.Matoking.protontricks.flatpakref

Does this fix the bug?

Not for me, unfortunately:

Protontricks was closed due to the following error:

Traceback (most recent call last): File "/app/lib/python3.10/site-packages/PIL/JpegImagePlugin.py", line 639, in _save rawmode = RAWMODE[im.mode] KeyError: 'RGBA'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/app/lib/python3.10/site-packages/protontricks/cli/util.py", line 149, in wrapper return cli_func(self, *args, **kwargs) File "/app/lib/python3.10/site-packages/protontricks/cli/main.py", line 264, in main steam_app = select_steam_app_with_gui( File "/app/lib/python3.10/site-packages/protontricks/gui.py", line 318, in select_steam_app_with_gui appid2icon = _get_appid2icon(steam_apps, steam_path=steam_path) File "/app/lib/python3.10/site-packages/protontricks/gui.py", line 104, in _get_appid2icon resized_img.save(icon_cache_path) File "/app/lib/python3.10/site-packages/PIL/Image.py", line 2413, in save save_handler(self, fp, filename) File "/app/lib/python3.10/site-packages/PIL/JpegImagePlugin.py", line 642, in _save raise OSError(msg) from e OSError: cannot write mode RGBA as JPEG

Matoking commented 10 months ago

I pushed a small fix to icon conversion that should hopefully fix this. You can install the development version with this fixed applied using the following command:

flatpak install --user https://dl.flathub.org/build-repo/44386/com.github.Matoking.protontricks.flatpakref

Does this fix the bug?

Not for me, unfortunately:

Protontricks was closed due to the following error: Traceback (most recent call last): File "/app/lib/python3.10/site-packages/PIL/JpegImagePlugin.py", line 639, in _save rawmode = RAWMODE[im.mode] KeyError: 'RGBA' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/app/lib/python3.10/site-packages/protontricks/cli/util.py", line 149, in wrapper return cli_func(self, *args, **kwargs) File "/app/lib/python3.10/site-packages/protontricks/cli/main.py", line 264, in main steam_app = select_steam_app_with_gui( File "/app/lib/python3.10/site-packages/protontricks/gui.py", line 318, in select_steam_app_with_gui appid2icon = _get_appid2icon(steam_apps, steam_path=steam_path) File "/app/lib/python3.10/site-packages/protontricks/gui.py", line 104, in _get_appid2icon resized_img.save(icon_cache_path) File "/app/lib/python3.10/site-packages/PIL/Image.py", line 2413, in save save_handler(self, fp, filename) File "/app/lib/python3.10/site-packages/PIL/JpegImagePlugin.py", line 642, in _save raise OSError(msg) from e OSError: cannot write mode RGBA as JPEG

The image mode should have been converted to RGB at that point, but the exception seems to show that image with RGBA (i.e. with an alpha channel) being written.

Please check if the correct version is installed by running these commands:

$ flatpak run --command=bash com.github.Matoking.protontricks
# Run the following inside the new shell
$ grep 'resized_img' /app/lib/python3.10/site-packages/protontricks/gui.py
                    resized_img = img.resize(APP_ICON_SIZE).convert("RGB")
                    resized_img.save(icon_cache_path)

The grep command should print a line with convert("RGB"), indicating the development version is installed. If not, something else is going on. You can try uninstalling Protontricks and then using the provided command.

kristoffertell commented 10 months ago

The image mode should have been converted to RGB at that point, but the exception seems to show that image with RGBA (i.e. with an alpha channel) being written.

Please check if the correct version is installed by running these commands:

You were right, I was indeed running the wrong version.

Managed to actually install and run the dev version and it seems to run perfectly now :)

willnix86 commented 10 months ago

I'm still seeing this issue on my Steam Deck. Tried the above but the link says "server not found"

Matoking commented 10 months ago

I released 1.10.5 with the icon conversion fix which should fix this problem.

willnix86 commented 10 months ago

I'll see what version I have. It certainly appears to be the latest one available on the Discover app, but I'll confirm