Skip to content

TypeError: unsupported operand type(s) for /: 'NoneType' and 'str' #10

Open

Description

@equesvasil

Hello. When i launch protontricks with flag --gui its show not all games(only 2 of them) and when i select one of them its crashes.

pivnoi@pivnoi:~$ flatpak run com.github.Matoking.protontricks -v --gui
protontricks (INFO): Running inside Flatpak sandbox, version 1.6.5.
protontricks (WARNING): Flatpak version is too old (<1.12.1) to support sub-sandboxes. Disabling bwrap. --no-bwrap will be ignored.
protontricks (INFO): Found Steam directory at /home/pivnoi/.var/app/com.valvesoftware.Steam/data/Steam. You can also define Steam directory manually using $STEAM_DIR
protontricks (INFO): Using default Steam Runtime at /home/pivnoi/.steam/root/ubuntu12_32/steam-runtime
protontricks (INFO): WINETRICKS environment variable is not available. Searching from $PATH.
protontricks (INFO): Found 1 Steam library folders
protontricks (INFO): Currently logged-in Steam user: equesvasil
protontricks (INFO): Couldn't find custom shortcuts. Maybe none have been created yet?
protontricks (INFO): Using 'yad' as GUI provider
protontricks (INFO): Found active compatibility tool: Proton 5.13
protontricks (INFO): Active compatibility tool is a Proton installation
protontricks (INFO): WINE environment variable is not available. Setting WINE environment variable to Proton bundled version
Traceback (most recent call last):
  File "/app/bin/protontricks", line 8, in <module>
    sys.exit(cli())
  File "/app/lib/python3.9/site-packages/protontricks/cli/main.py", line 28, in cli
    main(args)
  File "/app/lib/python3.9/site-packages/protontricks/cli/util.py", line 143, in wrapper
    return cli_func(self, *args, **kwargs)
  File "/app/lib/python3.9/site-packages/protontricks/cli/main.py", line 220, in main
    run_command(
  File "/app/lib/python3.9/site-packages/protontricks/util.py", line 352, in run_command
    str(proton_app.proton_dist_path / "bin" / "wine")
TypeError: unsupported operand type(s) for /: 'NoneType' and 'str'

Activity

  1. Matoking commented on Jan 24, 2022

    @Matoking
    Collaborator

    Do you have two installations of Steam, one installed using Flatpak and another other than Flatpak? Protontricks found both ~/.steam/root and ~/.var/app/com.valvesoftware.Steam but in this case it should prioritize the Flatpak installation of Steam (i.e. ~/.var/app/com.valvesoftware.Steam) instead of mixing the two installations together, as it has done here and which might explain the crash. I'll prepare a fix for this.


    If you are intending to use Protontricks Flatpak with the non-Flatpak version of Steam, you could either remove the other Steam installation or use the STEAM_DIR environment variable to explicitly choose the Steam installation. For example, you could use the following command:

    STEAM_DIR=$HOME/.steam/steam flatpak run com.github.Matoking.protontricks -v --gui
    

    You could also create aliases to separate the two installations. For example, you could add these to your ~/.bashrc to create two different commands, one for Flatpak and the other for your distro's own Steam installation. This could be handy if you need two installations of Steam:

    alias protontricks-flat="flatpak run com.github.Matoking.protontricks"
    alias protontricks="STEAM_DIR=$HOME/.steam/steam flatpak run com.github.Matoking.protontricks"
    
  2. Matoking commented on Jan 24, 2022

    @Matoking
    Collaborator

    I've pushed a potential fix to the Steam installation discovery. Could you try installing the fix using the following command and check if it fixes the issue?

    flatpak install --user https://dl.flathub.org/build-repo/73729/com.github.Matoking.protontricks.flatpakref
    
  3. equesvasil commented on Jan 24, 2022

    @equesvasil
    Author

    STEAM_DIR=$HOME/.steam/steam flatpak run com.github.Matoking.protontricks -v --guiit's worked nicely! No crash and i can see games in my library. Thanks!
    flatpak install --user https://dl.flathub.org/build-repo/73729/com.github.Matoking.protontricks.flatpakrefit's not worked. I see again wrong steam installation and its crashes with same error like before.

  4. Matoking commented on Jan 25, 2022

    @Matoking
    Collaborator

    The Flatpak version of Protontricks defaulting to the Flatpak version of Steam is intentional, but the crash is not.

    It seems like that Proton is installed for Flatpak Steam, but hasn't been launched yet, which is causing the crash. Proton versions except for Proton Experimental install a directory named dist the first time that Proton installation is used to launch an app, which Protontricks needs to work properly.

    I've pushed another potential fix. Could you try running this command to install the newer fix:

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

    After that, try running the following command:

    $ flatpak run com.github.Matoking.protontricks -v --gui
    

    Assuming everything works correctly, it should now instruct the user to launch a Steam app at least once to ensure that the Proton installation is finished. If not, the problem is probably elsewhere and needs more investigation.

  5. equesvasil commented on Jan 26, 2022

    @equesvasil
    Author

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

    log changes but still only 2 games and crashes...

    protontricks (INFO): Running inside Flatpak sandbox, version 1.6.5.
    protontricks (WARNING): Flatpak version is too old (<1.12.1) to support sub-sandboxes. Disabling bwrap. --no-bwrap will be ignored.
    protontricks (INFO): Found Steam directory at /home/pivnoi/.var/app/com.valvesoftware.Steam/data/Steam. You can also define Steam directory manually using $STEAM_DIR
    protontricks (INFO): Using default Steam Runtime at /home/pivnoi/.var/app/com.valvesoftware.Steam/data/Steam/ubuntu12_32/steam-runtime
    protontricks (INFO): WINETRICKS environment variable is not available. Searching from $PATH.
    protontricks (INFO): Found 1 Steam library folders
    protontricks (INFO): Currently logged-in Steam user: equesvasil
    protontricks (INFO): Couldn't find custom shortcuts. Maybe none have been created yet?
    protontricks (INFO): Using 'yad' as GUI provider
    protontricks (INFO): Found active compatibility tool: Proton 5.13
    protontricks (INFO): Active compatibility tool is a Proton installation
    protontricks (INFO): WINE environment variable is not available. Setting WINE environment variable to Proton bundled version
    Traceback (most recent call last):
    File "/app/bin/protontricks", line 8, in
    sys.exit(cli())
    File "/app/lib/python3.9/site-packages/protontricks/cli/main.py", line 28, in cli
    main(args)
    File "/app/lib/python3.9/site-packages/protontricks/cli/util.py", line 143, in wrapper
    return cli_func(self, *args, **kwargs)
    File "/app/lib/python3.9/site-packages/protontricks/cli/main.py", line 220, in main
    run_command(
    File "/app/lib/python3.9/site-packages/protontricks/util.py", line 286, in run_command
    str(proton_app.proton_dist_path / "bin" / "wine")
    TypeError: unsupported operand type(s) for /: 'NoneType' and 'str'

  6. Matoking commented on Jan 29, 2022

    @Matoking
    Collaborator

    Investigated this problem more, and turns out that while both versions of Steam write the identical path ~/.share/local/Steam into their own configuration files, that path corresponds to two different locations depending on which Steam installation is in use. In short, Protontricks was looking for Flatpak Steam's apps in the wrong place.

    Third time's the charm, hopefully. Could you try installing this fix:

    $ flatpak remove com.github.Matoking.protontricks # Remove the existing installation first
    $ flatpak install --user https://dl.flathub.org/build-repo/74209/com.github.Matoking.protontricks.flatpakref
    

    and test the following command again:

    $ flatpak run com.github.Matoking.protontricks -v --gui
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions