abextm / keepassxc-runelite

BSD 2-Clause "Simplified" License
5 stars 4 forks source link

Inconsistent errors when running Runelite through Steam #12

Closed Jademalo closed 2 years ago

Jademalo commented 2 years ago

Further to the issue written in a comment of #11, I've got a little bit more detail on the second error I was having. The primary fix in #11 was successful for the AppImage, however this seems to be something separate.

I'm launching RuneLite through steam with the following launch option; /home/deck/.local/appimages/KeePassXC-2.7.1-x86_64.AppImage & "/home/deck/.local/share/Steam/steamapps/common/Old School RuneScape/bin/win64/RuneLite.AppImage" %command% && pkill -15 keepassxc This should be fairly self explanatory, loading both KeePass and RuneLite. It then kills keepassxc once runelite is closed, so it's not hanging open in the background of gamescope.

This works, however it's very intermittent. Most of the time I receive the following error;

2022-08-15 11:57:08 [KeePassXCSocketConnection] INFO  a.os.keepassxc.proto.KeePassXCSocket - failed to read keyring
abex.os.keepassxc.proto.IOTimeoutException: Hit deadline
    at abex.os.keepassxc.proto.InterruptableInputStream.check(InterruptableInputStream.java:30)
    at abex.os.keepassxc.proto.InterruptableInputStream.read(InterruptableInputStream.java:46)
    at com.google.common.io.LittleEndianDataInputStream.readAndCheckByte(LittleEndianDataInputStream.java:231)
    at com.google.common.io.LittleEndianDataInputStream.readInt(LittleEndianDataInputStream.java:117)
    at abex.os.keepassxc.proto.KeePassXCSocket.call(KeePassXCSocket.java:194)
    at abex.os.keepassxc.proto.KeePassXCSocket.ensureAssociate(KeePassXCSocket.java:253)
    at abex.os.keepassxc.proto.KeePassXCSocket.init(KeePassXCSocket.java:137)
    at abex.os.keepassxc.KeePassXcPanel.lambda$load$2(KeePassXcPanel.java:63)
    at java.base/java.lang.Thread.run(Unknown Source)
2022-08-15 11:57:08 [KeePassXCSocketConnection] WARN  abex.os.keepassxc.KeePassXcPanel - error connecting to KeePassXC
java.io.IOException: Nonce mismatch [104, -78, -47, -16, -20, -6, -4, -94, 101, 107, -62, 47, 94, 10, 97, 113, 32, 88, -28, 124, -39, 79, 14, 1] != [-81, -124, -36, 75, -47, 95, -113, -128, 0, 73, -105, 60, -30, 64, 10, -110, -78, 20, -127, 108, -92, 38, -77, -112]
    at abex.os.keepassxc.proto.KeePassXCSocket.call(KeePassXCSocket.java:213)
    at abex.os.keepassxc.proto.KeePassXCSocket.ensureAssociate(KeePassXCSocket.java:272)
    at abex.os.keepassxc.proto.KeePassXCSocket.init(KeePassXCSocket.java:137)
    at abex.os.keepassxc.KeePassXcPanel.lambda$load$2(KeePassXcPanel.java:63)
    at java.base/java.lang.Thread.run(Unknown Source)

If I keep pressing retry, eventually it works. Sometimes it works immediately, sometimes it takes one or two retries, and sometimes it can be 50+. It does work eventually though, so I know this isn't some other weird conflict. Once it's connected it works absolutely fine, so I'm assuming this is just a bit slow for whatever reason.

If not running it through steam and just directly running the KeePassXC AppImage and the RuneLite AppImage on the desktop, it works every time. I don't know why this is only the case when running it through Steam, though obviously it's necessary on the Steam Deck when running in game mode (which is the main reason for me wanting to use this plugin, it's an absolute life saver for logging in without a keyboard!).

abextm commented 2 years ago

The flatpack thing is on me, I was reading the chrome docs when trying to emulate firefox and I assumed that they would pass the same arguments...

I think you have mutliple versions of keepassxc running and listening to the socket, or something else is trying to read data from it. Try running a browser under steam and see if that works, because I suspect it will not.

Jademalo commented 2 years ago

Haha, why do something one way when you can do it multiple! =p ty for the fixes for those, hugely appreciated!

I've got keepassxc set to single instance mode, so I'd be surprised if that was the problem. It also happens if I do a hard restart of the steam deck and launch it.

Annoyingly I can't test a browser due to another, different bug, which is that flatpak firefox doesn't like to work with anything except a natively installed keepass. While it doesn't work on steam, it also just doesn't work generally.

Is there any way I could log the activity on the socket to see if there's a conflict?

abextm commented 2 years ago

Ok I have looked at this again (and fixed the flatpak thing I think) and I believe I see what is happening, its hitting the deadline, then continuing with the same socket so it reads the previous response for the current request. I have made it fail correctly in this case, and made it tolerate being slow so hopefully that should prevent the deadline from being hit as easily

Jademalo commented 2 years ago

Just gave it a test, extremely pleased to say that it seems to have fixed the problem! Was able to load it up without any issues and it let me select my password every time.

Thank you so much!

abextm commented 2 years ago

Great!