FriendsOfGalaxy / galaxy-integration-steam

Integration with Steam for Galaxy
372 stars 77 forks source link

Steam offline bug #159

Open m1cha3l02 opened 1 year ago

m1cha3l02 commented 1 year ago

Describe the bug While trying to log in to steam with plugin in the GOG app tries to load but it always ends with a message "Offline. Try again."

To Reproduce

  1. Launch GOG Galaxy
  2. Try to log in with your steam account
  3. The "Offline" message should pop up

Expected behavior An expcted behaviour should be the abillity to log in and synchronise my games within the GOG Galaxy launcher

ABaumher commented 1 year ago

Does not stay online for me after a restart

That's to be expected. That line ensures we get an access or refresh token before continuing. Since the message containing the access key is never sent, that will never run and we would get a timeout (indirectly, this thing is multi-threaded and a pain to understand). This is only a temporary, hack fix, just like the previous one. But this version does all the error checking and importing before saying everything is ok.

A more technical explanation: Steam uses Google's Protocol Buffers (protobuf) to send data along the websocket. It's a way to save raw computer data in a format other computers (and usually humans) can read. It's also imo a pain to work with. The messages we send and receive are formatted this way. The message we send used to cause multiple responses, one being the ClientNewKey response, which contained our token. I need to find the proper message to request that token, then get and parse the response. For whatever reason, the protobuf data is hard-coded into the python files, instead of its own .proto files, which is the default, so after i find the correct message, i'm going to need to generate the python file from it. If i'm lucky its already in one of our files, but i doubt it. Once we send this message and parse the result, the integration will work again.

I should note that this is still not a perfect fix. We should be supporting QR codes and the nice new UI steam has for login, but frankly that's more than i want to do.

Finally, for those that are testing, can you check to see if 2FA (Steam Guard) with phone, email, etc work as intended?

Krynh commented 1 year ago

Does not stay online for me after a restart

That's to be expected. That line ensures we get an access or refresh token before continuing. Since the message containing the access key is never sent, that will never run and we would get a timeout (indirectly, this thing is multi-threaded and a pain to understand). This is only a temporary, hack fix, just like the previous one. But this version does all the error checking and importing before saying everything is ok.

A more technical explanation: Steam uses Google's Protocol Buffers (protobuf) to send data along the websocket. It's a way to save raw computer data in a format other computers (and usually humans) can read. It's also imo a pain to work with. The messages we send and receive are formatted this way. The message we send used to cause multiple responses, one being the ClientNewKey response, which contained our token. I need to find the proper message to request that token, then get and parse the response. For whatever reason, the protobuf data is hard-coded into the python files, instead of its own .proto files, which is the default, so after i find the correct message, i'm going to need to generate the python file from it. If i'm lucky its already in one of our files, but i doubt it. Once we send this message and parse the result, the integration will work again.

I should note that this is still not a perfect fix. We should be supporting QR codes and the nice new UI steam has for login, but frankly that's more than i want to do.

Finally, for those that are testing, can you check to see if 2FA (Steam Guard) with phone, email, etc work as intended?

I mean I can get it to sync once, but after a restart it goes offline and clicking retry does nothing.

It accepts Steam guard codes on the login prompt but does not always bring up the Steam guard notification from the app.

ABaumher commented 1 year ago

Does not stay online for me after a restart

That's to be expected. That line ensures we get an access or refresh token before continuing. Since the message containing the access key is never sent, that will never run and we would get a timeout (indirectly, this thing is multi-threaded and a pain to understand). This is only a temporary, hack fix, just like the previous one. But this version does all the error checking and importing before saying everything is ok. A more technical explanation: Steam uses Google's Protocol Buffers (protobuf) to send data along the websocket. It's a way to save raw computer data in a format other computers (and usually humans) can read. It's also imo a pain to work with. The messages we send and receive are formatted this way. The message we send used to cause multiple responses, one being the ClientNewKey response, which contained our token. I need to find the proper message to request that token, then get and parse the response. For whatever reason, the protobuf data is hard-coded into the python files, instead of its own .proto files, which is the default, so after i find the correct message, i'm going to need to generate the python file from it. If i'm lucky its already in one of our files, but i doubt it. Once we send this message and parse the result, the integration will work again. I should note that this is still not a perfect fix. We should be supporting QR codes and the nice new UI steam has for login, but frankly that's more than i want to do. Finally, for those that are testing, can you check to see if 2FA (Steam Guard) with phone, email, etc work as intended?

I mean I can get it to sync once, but after a restart it goes offline and clicking retry does nothing.

It accepts steamguard codes but does not always bring up the steamguard notification on the app.

Huh. Can you post your log file? If i had to guess, it's trying to authenticate with the data in the cache, but the cache is missing the token and the whole thing is blowing up. But i don't know for sure.

Krynh commented 1 year ago

Where are the log files located?

ABaumher commented 1 year ago

Assuming windows, C:\ProgramData\GOG.com\Galaxy\logs

Krynh commented 1 year ago

plugin-steam-ca27391f-2675-49b1-92c0-896d43afa4f8.log

DonaemouS commented 1 year ago

here is mine:

SyntaxError: invalid syntax 2023-04-26 21:55:53,425 - root - ERROR - Plugin exception Traceback (most recent call last): File "C:\Program Files (x86)\GOG Galaxy\plugin_runner.py", line 35, in <module> module = importlib.import_module(filename) File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32\__init__.py", line 127, in import_module File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "C:\Users\~\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\plugin.py", line 37, in <module> from backend_steam_network import SteamNetworkBackend File "C:\Users\~\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\backend_steam_network.py", line 45, in <module> from steam_network.websocket_client import WebSocketClient, UserActionRequired File "C:\Users\~\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\steam_network\websocket_client.py", line 16, in <module> from .protocol_client import ProtocolClient, UserActionRequired File "C:\Users\~\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\steam_network\protocol_client.py", line 232 @await self._protobuf_client.login_key_retrieved.wait() ^ SyntaxError: invalid syntax

ABaumher commented 1 year ago

here is mine:

SyntaxError: invalid syntax 2023-04-26 21:55:53,425 - root - ERROR - Plugin exception Traceback (most recent call last): File "C:\Program Files (x86)\GOG Galaxy\plugin_runner.py", line 35, in <module> module = importlib.import_module(filename) File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32\__init__.py", line 127, in import_module File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "C:\Users\~\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\plugin.py", line 37, in <module> from backend_steam_network import SteamNetworkBackend File "C:\Users\~\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\backend_steam_network.py", line 45, in <module> from steam_network.websocket_client import WebSocketClient, UserActionRequired File "C:\Users\~\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\steam_network\websocket_client.py", line 16, in <module> from .protocol_client import ProtocolClient, UserActionRequired File "C:\Users\~\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\steam_network\protocol_client.py", line 232 @await self._protobuf_client.login_key_retrieved.wait() ^ SyntaxError: invalid syntax

comments in python are a '#', that log says you have an '@'

DonaemouS commented 1 year ago

thx for the help, gg! Now I get all the library updated but something is "strange":

2023-04-26 22:26:15,326 - steam_network.protocol_client - WARNING - authenticate_token failed with code: 5 2023-04-26 22:26:15,326 - steam_network.websocket_client - ERROR - Failed to establish authenticated WebSocket connection InvalidCredentials() 2023-04-26 22:26:15,327 - backend_steam_network - ERROR - Unable to authenticate to steam backend: InvalidCredentials() Traceback (most recent call last): File "C:\Users\~\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\backend_steam_network.py", line 323, in _authenticate_with_stored_credentials await self._steam_run_task File "C:\Users\~\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\steam_network\websocket_client.py", line 86, in run await auth_task File "C:\Users\~\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\steam_network\websocket_client.py", line 225, in _authenticate ret_code = await self._protocol_client.authenticate_token(self._user_info_cache.steam_id, self._user_info_cache.account_username, self._user_info_cache.token, auth_lost_handler) File "C:\Users\~\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\steam_network\protocol_client.py", line 249, in authenticate_token raise translate_error(result) galaxy.api.errors.InvalidCredentials

But, as soon as I quit the client and relaunch it:

immagine

ABaumher commented 1 year ago

@Krynh Your error says that we got an unknown backend response. Which means we got a bogus message back. I still think that's caused by the lack of an access token but i don't know. You're also in the public profile backend instead of the network one, which was the old backup method for when network auth failed. That backend may do something i haven't checked fully yet. Ideally the new auth method means we could throw the public fallback in the trash, but i'm not there yet.

If you are comfortable editing python, a couple logger.debug statements would help narrow down where that response is coming from. If so, give me a minute and i'll tell you where and what exactly to put

@DonaemouS Yours is easier to parse. It's trying to authenticate the token we don't have, and then raising an error when steam says "i can't authenticate nothing"

ABaumher commented 1 year ago

I could probably hunt down the function calls telling the integration to authenticate with the token and skip them, but that's still only a hack fix; i'd rather just get the token. still, it's nice to know everything initially works if we skip waiting for the auth token

Krynh commented 1 year ago

So should I make my profile private or something instead? Yesterday when I deleted the plugin and re-installed I didn't get the Steam Guard pop-up but it did accept the code to let me log in at least (after replacing backend_steam_network.py)

ABaumher commented 1 year ago

No, it's how the integration behaves, not something on your end. Issue #74 was the reason this was implemented. If certain conditions are met, it'd switch to the public profile method to get your games, etc. Honestly, i have no idea how the switching takes place or is reversed. There's apparently a config file you can override this behavior with but for now i've just been testing the network method. The network should be stable with the new authentication (i hope), so we wouldn't need public profiles. But if you're already in public profiles, then we'd get different errors.

Deleting and reinstalling the plugin should have put you back in the network method, unless the cache is kept despite you deleting the plugin

ReiTung commented 1 year ago

@ABaumher first of all, many thanks for all your efforts, very much appreciated. Also thx for the explanations, even though I am everything but no coder I get the issue.

one question though: should we apply your hack in addition to the other one skipping the other function or would yours be enough?

and on a separate note, I saw you were looking for some older logs to compare how the client responded in earlier versions? If it helps, I believe I have uploaded some older version logs when troubleshooting and testing other bugs, I could go and see if they are still available?`

again, many thanks

ABaumher commented 1 year ago

Just apply the one I found. The short version is that the original hack will set the code status to "OK" and ignored any error checking, to get around the fact the message will timeout. This would cause problems if the error checking found something. The one i found occurs after all the other checks are complete, which means we only get there when everything else works.

Just a note, this will cause errors when you restart GOG, but i'm working on it.

ReiTung commented 1 year ago

can confirm your hack works, at least at first start (did not try restarts as above yet). Games seem to be imported, playtime as well. I do not (yet) see any achievements synced (or at least shown in Galaxy) though, but remember there have been delays in earlier versions either.

ABaumher commented 1 year ago

@ReiTung If you do have an old log around, i'd love to see it. At this point it's more of a confirmation than a source of information but i could still use it to see when a message was sent. The timeout is 60 seconds and i'd assume the token is one of the first messages received so we don't hit that.

fun fact: Every 50 or so games imported, the integration will pause for about 5 seconds to let GOG fully integrate them. This is for people who have like 1000 steam games so GOG doesn't get overwhelmed and tank your computer's performance. so there is a bit of a tradeoff of time there.

ABaumher commented 1 year ago

SteamKit uses a different protocol buffer. Joy. Fortunately they also have all the proto files retrieved so i can pull the one i need. Time to learn how to compile it with python so it's hard-coded.

Side note, if i get this to work, i am absolutely going to try cashing in those bug bounty comments above. This is painful lol.

Corneliabeater commented 1 year ago

Found the message we aren't getting. We no longer get EMsg 5463, or ClientNewLoginKey. Found where we hang, too. May have a temporary fix that will work, but it may cause you to have to log in every time. If anyone is feeling adventurous, comment out await self._protobuf_client.login_key_retrieved.wait() in \steam_network\protocol_client.py (if you are on Linux or Mac, use forward slashes instead of backslashes)

This may break something else in the code; i am looking now to see if that's the case, but it's probably faster to just try it, and if it errors, send me a log

Working for me, thanks for looking into this!

ReiTung commented 1 year ago

@ABaumher attached a few older version logs I still found, hope they are helpful ... did those supporting troubleshooting of older bugs

plugin-steam.log.zip plugin-steam-ca27391f-2675-49b1-92c0-896d43afa4f8.log logs_with_crashed_v053_before_fresh_install_20210122.zip logs_with_offline_v055_specialedition_after_fresh_install_pc1_20210206.zip

DonaemouS commented 1 year ago

So should I make my profile private or something instead? Yesterday when I deleted the plugin and re-installed I didn't get the Steam Guard pop-up but it did accept the code to let me log in at least (after replacing backend_steam_network.py)

The version you downloaded from GoG is the legacy one. So, each time you do a new reinstall, you have to edit some files to get your version updated or hacked.

Endominius commented 1 year ago

Commenting out the line is working here. 2FA fails through Steam Guard and have to fall back to public profile. Achievements aren't coming through but that happens a lot and eventually resolves.

Krynh commented 1 year ago

Still failing back to public profile, doesn't trigger steam guard

So should I make my profile private or something instead? Yesterday when I deleted the plugin and re-installed I didn't get the Steam Guard pop-up but it did accept the code to let me log in at least (after replacing backend_steam_network.py)

The version you downloaded from GoG is the legacy one. So, each time you do a new reinstall, you have to edit some files to get your version updated or hacked.

@DonaemouS I was just confused thinking that public profile meant making my account public (which it is) rather than how it scrapes my library

joerg-nafcom commented 1 year ago

It also did fall back to me towards public profile, but triggered steam guard for me.

Still failing back to public profile, doesn't trigger steam guard

So should I make my profile private or something instead? Yesterday when I deleted the plugin and re-installed I didn't get the Steam Guard pop-up but it did accept the code to let me log in at least (after replacing backend_steam_network.py)

The version you downloaded from GoG is the legacy one. So, each time you do a new reinstall, you have to edit some files to get your version updated or hacked.

ABaumher commented 1 year ago

Found another call that does not happen. @ReiTung The log did help, thanks. We used to receive a ClientUpdateMachineAuth message and send a response, neither appear in the current log. Currently i'm stuck though, I can't get a protocol buffer file to compile into python properly. Waiting on a response from the ValvePython people, will likely put it up on Stack Overflow as well.

For now, the code being buggy after first run (if successful) is essentially guarenteed. If you slip into the public profile backend, nothing has been changed there so if it errored before for reasons outside of the "authenticate" call, it will still do so.

lDiGaOl commented 1 year ago

Today I tried to login to the steam list, and it worked. there was update on Launch Gog recently. I think that solved the problem

DonaemouS commented 1 year ago

hey @lDiGaOl , I think not, cause I see a friend of mine using the standard Steam plugin without achievements updates, still. But, yes, since this morning or yesterday, now the game time is updated correctly, as well as recently played.

BenGamin98 commented 1 year ago

Here to say it's true for me too.

mondodimotori commented 1 year ago

Had a GOG galaxy update today.

Steam integration is still broken. After 2FA it just loops on "connecting" before going "offline retry".

slo commented 1 year ago

@ABaumher I think I have it working quite nicely. I've taken protobufs from here: https://github.com/ValvePython/steam/tree/74e429249977df2adfdbdb11408a140f618f86b9/steam/protobufs - just import has to be shortened ( remove steam.protobufs. package) However, I can confirm that ClientNewLoginKey is not working. I think it is just not being sent. There are recipes in above repo - take a look at them - event is also missing in that communication. I think it would be good to ask Valve/Steam support about it - I asked them, I'll keep you updated. As for ClientUpdateMachineAuth I got it working actually because of this event - it returns sentry which can be used to omit 2FA. Unfortunately it requires storing Steam password in GOG GALAXY, which is bad, I suppose (and for now, my version has hardcocded password inside) - but set of: account_name + password + sentry also allows conecting with Steam. I pushed the code here: https://github.com/slo/galaxy-integration-steam/tree/passwd_workaround

ABaumher commented 1 year ago

@ABaumher I think I have it working quite nicely. I've taken protobufs from here: https://github.com/ValvePython/steam/tree/74e429249977df2adfdbdb11408a140f618f86b9/steam/protobufs - just import has to be shortened ( remove steam.protobufs. package) However, I can confirm that ClientNewLoginKey is not working. I think it is just not being sent. There are recipes in above repo - take a look at them - event is also missing in that communication. I think it would be good to ask Valve/Steam support about it - I asked them, I'll keep you updated. As for ClientUpdateMachineAuth I got it working actually because of this event - it returns sentry which can be used to omit 2FA. Unfortunately it requires storing Steam password in GOG GALAXY, which is bad, I suppose (and for now, my version has hardcocded password inside) - but set of: account_name + password + sentry also allows conecting with Steam. I pushed the code here: https://github.com/slo/galaxy-integration-steam/tree/passwd_workaround

I was just on their repo trying to figure out how they compiled it (i even posted a discussion a few days ago), and found their makefile, which could explain why i was getting different python code than they were. Storing the password in GOG breaks Steam API's Terms of Service, which is why I think the previous devs didn't do this. If i can find the right message to get a token from what we have already, i can just store that.

EDIT: Holy hell, i am dumb. See https://github.com/FriendsOfGalaxy/galaxy-integration-steam/blob/master/README_UPDATE_PROTOBUF_FILES.md

@slo i assume you understand code/are a coder, which is a welcome sight, lol. One thing i noticed was the Client Login Response is that it gives us a lot of extra information, which i assume we can use to get an access token somehow. any thoughts?

Thadir commented 1 year ago

Still got a probem, so any idea.

ABaumher commented 1 year ago

Nevermind, that readme is out of date, the tasks.py invoke would require is nowhere in the project. heck, the directory doesn't exist either. Time to steal the makefile from ValvePython

ABaumher commented 1 year ago

@slo Your version is more up-to-date than mine due to you pulling the newer proto files. It'd probably be smart for me to rebase to your repo but i'm going to pull the proto files directly from the source using the shell script at SteamKit and then compile them with the Makefile from ValvePython in case Steam added something in the last 4 months. Protocol Buffers use optional fields almost exclusively, so any additions won't be breaking. From there, i need to find the one message to send for either a refresh or auth token and we're home free. ngl i'd much prefer to just store the password like you did with the workaround and call it but i'd rather not risk the wrath of Steam's Lawyers.

slo commented 1 year ago

@ABaumher We could regenerate it ourselves, but I tried and ended up with some mess. But I can try. This is new topic for me as I have never worked with protobufs and websockets - I'm still learning and know more than when I started touching this couple of days ago. As for the one message which could be used, I'm not feeling that there is such message. In my understanding Steam receives Logon message and then it produces whole bunch of messages. Some of them are used, some are ignored, but I expected that ClientNewLoginKey would still be one of them. Maybe there is some flag/account setting which blocks sending that message. I may try to search for it again, but in my previos search I haven't seen anything which could be of any help.

ABaumher commented 1 year ago

I can pull the files from https://github.com/SteamDatabase/Protobufs/tree/master/steam , but protoc has been giving me trouble. I'm going to see if i can get it working using a modified version of ValvePython's Makefile. I did get SteamKit's protobuf dumper to compile and build but i don't know the targets and that's probably more work than its worth. The steam database seems plenty up to date (steammessages_auth.steamclient was updated 2 days ago) so I'm just gonna pull theirs. Iirc that's what valve python does in their Makefile

The ClientNewLoginKey sends us an access token, apparently. See https://github.com/SteamDatabase/Protobufs/blob/master/steam/steammessages_clientserver_login.proto#L86 If that's true, we can just use that. Of course, since all proto fields are optional i have no idea if we get that. I know for a fact it isn't in the parsed python object we use in our code (the only reason i knew that sent additional data was i added a debug print statement on it with pretty print and got a bunch of fields), though that could be due to an outdated proto definition.

Edit, nvm, that's our message, not the response. The response includes a webapi_authenticate_user_nonce which i think we should be able to use with the web api for an access token, but i have no idea how.

ABaumher commented 1 year ago

@slo Steam changed their authentication workflow, which is why they no longer send ClientNewLoginKey. This is a security thing, they basically want us to use a network version of OAuth2. I was hoping for a good way around it, but apparently not. This was originally why I was looking for how to compile the protoc files to python. Copying how SteamKit does it, I'd need to use steammessages_auth.steamclient.py which iirc isn't in our project right now. I don't think it's in ValvePython either ValvePython renames it to steammessages_auth.py to avoid the extra directory it would otherwise create. Cheeky. I'll just copy that if I can't get the compile to python to work.

I've been dreading it, but i'm going to have to change the calls we use. Unfortunately, the logs don't tell us which requests we send besides the client login on. Currently it seems like client login causes a ton of responses, which would be painful to request manually. But I think we do a couple requests and simply don't log them right now. On the plus side, we could support QR code login in the future? I'm not implementing it, but the messages would be available for use if someone else wanted to implement it.

Edit: The new workflow is roughly:

  1. Request the password's public key (RSA encryption. Python should have RSA built in somewhere)
  2. Get the user's username and password.
  3. encipher the password using the public key
  4. Send a login request with the username and enciphered password.
  5. Parse the response, and get a weak token. This will be used to get our strong, access token.
  6. Exchange that weak token for a refresh token and access token
  7. Make any requests the ClientLogin used to that we no longer do
slo commented 1 year ago

Oh, thanks for clearing this for me. I'll see what I can do regarding OAuth2 :D

ABaumher commented 1 year ago

I've made a discussion so we don't massively fill this page with coding talk. I have some idea how steamkit does it and how we could replicate it

https://github.com/FriendsOfGalaxy/galaxy-integration-steam/discussions/164

ReiTung commented 1 year ago

just to reconfirm, while games and playing time seems to sync OK with the hack, achievements don't (I understand it is unlikely directly related but rather points to an additional issue). Had Galaxy and Steam connected running for about 8hrs, zero achievements made it through to being viewed in Galaxy.

thanks

ABaumher commented 1 year ago

Achievements are updated in the Tick function, which runs periodically. I'll take a look at it, but getting the authentication working properly takes priority.

ReiTung commented 1 year ago

sure thing. thanks for all your effort

Allexedge commented 1 year ago

Achievements are updated in the Tick function, which runs periodically. I'll take a look at it, but getting the authentication working properly takes priority.

Regarding achievements and friends: it seems something is changed and/or broken in GOG backend on the server side. I have a lot of messages in GalaxyClient.log like these:

[galaxy_client]: Upload external achievements task failed: Error Message: Failed to store achievements for game 'steam_403640' with code '429 - Too Many Requests'
[galaxy_client]: Upload external achievements task failed: Error Message: Failed to store achievements for game 'steam_491950' with code '400 - Bad Request'
[galaxy_client]: Successfully imported 4 friends from platform 'steam'
[galaxy_client]: Starting importing presence for platform 'steam' failed. Error reason: UnknownError | Error internal type: '' | Error internal message: 'Method not found'

So I assume the plugin reports achievements correctly, but GOG server endpoint doesn't handle these requests amymore.

ABaumher commented 1 year ago

That's useful to know. Might still be plugin-side. Can you send me your plugin log? i want to see if any achievement data is written down in there, because if it is, it's definitely on GOG's end

Allexedge commented 1 year ago

That's useful to know. Might still be plugin-side. Can you send me your plugin log? i want to see if any achievement data is written down in there, because if it is, it's definitely on GOG's end

Sure, here it is. I have almost 1000 games on account, so achievements list is pretty big. plugin-steam-ca27391f-2675-49b1-92c0-896d43afa4f8.zip

Allexedge commented 1 year ago

Also, notice the "Method not found" error when importing friends presence:

2023-04-30 15:58:36,431 - galaxy.task_manager - DEBUG - Task manager jsonrpc server: creating task 6530 (start_user_presence_import)
2023-04-30 15:58:36,431 - galaxy.task_manager - DEBUG - Task manager plugin external: creating task 7183 (start_user_presence_import)
2023-04-30 15:58:36,431 - root - DEBUG - Sending data: {"jsonrpc": "2.0", "id": "150159", "error": {"code": -32601, "message": "Method not found"}}
2023-04-30 15:58:36,431 - galaxy.task_manager - DEBUG - Task manager jsonrpc server: finished task 6530 (start_user_presence_import)
ABaumher commented 1 year ago

Plugin Log looks good. Too Many Requests can occur if you are sending too many messages to GOG at once, and you might have hit it lol. We should be caching your achievements so we don't overload GOG with requests, but it is possible that with the bug, we've lost that cache and will need to refill it. Which we can't do right now because the integration is borked.

I can try updating the GOG API python module in the integration to the current version. No idea if it'll do anything, but it couldn't hurt. If GOG introduced a breaking change, their app would have the current version and if ours is calling a bad function we'd get that error. We could potentially see that a function no longer matches a signature and update it. NGL i doubt that's the case, but i'll look into it.

Tovrin commented 1 year ago

Used the workaround .py file and it still disconnects occasionally and won't reconnect. You need to reconnect manually. Hopefully a proper fix will be available soon.

TheSentry commented 1 year ago

So, I found out that there are quite a few other attempts of what I wanted to do with FansOfGalaxy, so I'll ditch that and rather join others instead of making yet another project.

@ABaumher I see you also commented in the Nebula project. What I still don't get is: How do you actually build the plugin?

ABaumher commented 1 year ago

@ABaumher I see you also commented in the Nebula project. What I still don't get is: How do you actually build the plugin?

No idea. There's documentation on GOG's Integration API python page, and i've seen some people use Tasks.py to build the project for deployment. Humble bundle does this iirc. FriendsofGalaxy has a build tools program that apparently builds one, and i've seen it on Galaxy Nebula. I'm not sure how it works, which is essentially what i asked there.