-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EDMC needs to re-authenticate every time I switch computers #1632
Comments
Totally random, possibly unrelated heads up: I had a user that synced with Dropbox. And that put a full on lock on the journal each time the game wrote to it (and Dropbox re-synced), leading to … fun interactions with applications trying to read from it. No idea if it’s related to your issue or if OneDrive even has the same problem, but, you know. |
About this Journal re-syncing. Have you ever deleted and re-made your Commander with a different name? If so, do any of the Journal files currently in the folder have that prior/other Commander name ? That could be the culprit if the OneDrive file syncing is messing with the 'creation time' timestamps on the files and fooling EDMC into thinking an old Journal is the latest. Apart from that, relevant part from the -debug log, which definitely picked up a Journal file from yesterday as the latest: 2022-08-09 12:48:07.571 UTC - INFO - 12472:3636:3636 monitor.EDLogs.start:256: Start Journal File: "C:\Users\james\Saved Games\Frontier Developments\Elite Dangerous\Journal.2022-08-08T215936.01.log"
2022-08-09 12:48:07.587 UTC - DEBUG - 12472:3636:3636 monitor.EDLogs.start:259: Starting Journal worker thread...
2022-08-09 12:48:07.587 UTC - DEBUG - 12472:10712:10712 monitor.EDLogs.worker:369: Starting on logfile "C:\Users\james\Saved Games\Frontier Developments\Elite Dangerous\Journal.2022-08-08T215936.01.log"
2022-08-09 12:48:07.587 UTC - DEBUG - 12472:3636:3636 monitor.EDLogs.start:263: Done
2022-08-09 12:48:07.587 UTC - DEBUG - 12472:3636:3636 monitor.EDLogs.start:265: Done.
2022-08-09 12:48:08.514 UTC - DEBUG - 12472:10712:10712 monitor.EDLogs.worker:395: Now at end of latest file.
2022-08-09 12:48:08.514 UTC - DEBUG - 12472:10712:10712 monitor.EDLogs.worker:436: Entering loop...
2022-08-09 12:48:08.548 UTC - DEBUG - 12472:3636:3636 companion.Session.login:678: changed account or retrying login during auth
2022-08-09 12:48:08.548 UTC - DEBUG - 12472:3636:3636 companion.Auth.refresh:323: Trying for "Unknown Zombie"
2022-08-09 12:48:08.548 UTC - DEBUG - 12472:3636:3636 companion.Auth.refresh:327: Cmdrs: ['Unknown Zombie']
2022-08-09 12:48:08.548 UTC - DEBUG - 12472:3636:3636 companion.Auth.refresh:330: idx = 0
2022-08-09 12:48:08.548 UTC - DEBUG - 12472:3636:3636 companion.Auth.refresh:335: We have a refresh token for that idx
2022-08-09 12:48:08.548 UTC - DEBUG - 12472:3636:3636 companion.Auth.refresh:342: Attempting refresh with Frontier...
2022-08-09 12:48:12.140 UTC - ERROR - 12472:3636:3636 companion.Auth.refresh:359: Frontier CAPI Auth: Can't refresh token for "Unknown Zombie"
2022-08-09 12:48:12.140 UTC - DEBUG - 12472:3636:3636 companion.Auth.dump:532: Frontier CAPI Auth: failed with `r` False: <Response [401]>
2022-08-09 12:48:12.140 UTC - INFO - 12472:3636:3636 companion.Auth.refresh:371: Frontier CAPI Auth: New authorization request
2022-08-09 12:48:12.140 UTC - INFO - 12472:3636:3636 companion.Auth.refresh:377: Trying auth from scratch for Commander "Unknown Zombie"
2022-08-09 12:48:12.341 UTC - DEBUG - 12472:3636:3636 companion.Session.login:694: We do NOT have an access_token
2022-08-09 12:48:12.425 UTC - DEBUG - 12472:10492:10492 plugins.edsm.worker:654: Got "events to discard" list, commencing queue consumption...
2022-08-09 12:48:50.960 UTC - DEBUG - 12472:7892:7892 protocol.WindowsProtocolHandler.worker:313: Message starts with edmc://auth
2022-08-09 12:48:50.960 UTC - DEBUG - 12472:7892:7892 protocol.GenericProtocolHandler.event:54: event_generate("<<CompanionAuthEvent>>")
2022-08-09 12:48:50.960 UTC - DEBUG - 12472:3636:3636 companion.Session.auth_callback:702: Handling auth callback
2022-08-09 12:48:50.960 UTC - DEBUG - 12472:3636:3636 companion.Session.auth_callback:709: Trying authorize with payload from handler
2022-08-09 12:48:50.975 UTC - DEBUG - 12472:3636:3636 companion.Auth.authorize:397: Checking oAuth authorization callback
2022-08-09 12:48:50.975 UTC - DEBUG - 12472:3636:3636 companion.Auth.authorize:418: Got code, posting it back...
2022-08-09 12:48:52.128 UTC - INFO - 12472:3636:3636 companion.Auth.authorize:470: Frontier CAPI Auth: New token for "Unknown Zombie"
2022-08-09 12:48:52.131 UTC - DEBUG - 12472:3636:3636 companion.Session.start_frontier_auth:642: Starting session So, indeed the initial attempt to use the Refresh Token failed, with the Frontier servers returning a What I'd like you to do now is check the registry key
Please confirm whether yours looks roughly like that. Either way then:
Obviously in your case you'll need to perform those steps on both computers to ensure the Registry |
I always suspend OneDrive while playing the game (or any other game that constantly updates synced files) and then turn it back on once playtime is over. Because I have run into issues like the one you advise about above with several games. |
I've never renamed or deleted my commander. The journal files in that folder date all the way back to my first launch of the game in November 2016. Something I did in 2019 changed all the older journal files' modified times (to 2019), but anything since then has proper timestamps.
Yes I have an alphanumeric key there, formatted 8-4-4-4-12
I will perform that now on my laptop, and on my desktop later in the day once I get home. Then, I'll report back with results. |
Actually, this got me curious and I looked closer at the files and OneDrive is doing some weird stuff with creation times. Only the modified times are properly preserved. When a remote file which does not exist on the system is synced, it is given a current timestamp for file creation, and file modified time is the only field being properly synced. The file on the left was created on this laptop yesterday during play. The file on the right was created remotely on a desktop later in the day yesterday during play. The creation date on the file on the right has a creation time of the time that OneDrive downloaded the file to this laptop today and not a creation time of when the original file was created on the desktop, last night. This might, conceivably, cause issues if EDMC is looking at creation date instead of modification date, and if OneDrive were to sync multiple new journal entry files created on a different machine, and it did not download/create them in the proper chronological order in which they were originally created. I'm not sure that this is causing the reported issue, but thought it was worth pointing out what I dug up in case it could be useful to know in some capacity. |
Well, if you only ever:
Then the last step will cause a new Journal file and things will go OK from then on. Also, yes, given the "only ever one commander name" in this scenario there shouldn't be any way for the syncing to be causing this auth issue. One commander means EDMC only stores/retrieves one |
Ok I got home and messed around a bit with the laptop and desktop side-by-side. Deleting fdev_apikeys did not resolve the issue. Deleting this registry entry on both machines and then launching EDMC did not alter behavior. EDMC would require authentication every time it was first launched on opposing machines (not counting the first expected login after deleting registry keys, of course). What I did notice is that every time EDMC launches, whether authentication is required or not, and even when launched on the same computer, the fdev_apikeys registry entry changes. Cut/pasting the value of this registry entry between computers would allowed EDMC to launch without having to re-authenticate. But because the value changes every time the program is launched, unless the value is cut/pasted every time computers are switched then re-authentication is still necessary. |
That's expected, because every time that Refresh Token is used in order to get a new Access Token it also returns a new Refresh Token, and invalidates that old Refresh Token, so the new one must be stored for future use.
Now I'm wondering if this is, in fact, just expected behaviour on Frontier's part. If they're seeing the same combination of:
and always storing only the one Refresh Token for that tuple, then that will precisely cause what you're seeing. The only solution would, indeed, be to find a way to automate syncing that registry key between the computers. It does occur to me now that I've never tested precisely this scenario. I'm either using other software, with a different Client ID, or else testing with a different (Frontier, Steam, EGS) account. Other than the registry syncing the only thing I can suggest is that you attempt using Steam authentication on one and Frontier authentication on the other. Maybe that will be enough to cause Frontier to consider them different. |
Yup, I've just tested this myself, running a second EDMC instance as another user, but against the same account. Authorizing in that, and restarting the original EDMC instance, has invalidated the 'original' Refresh Token. So you'll have to sync that Registry entry as well in your use case. I feel an additional Wiki:Troubleshooting section coming on .... |
Please complete the following information:
Log files
EDMarketConnector-debug.log
EDMarketConnector.log
^ This log may be useless since this log is from a second run of the program. I re-launched EDSM after the first run (where re-authentication was required). So this log won't show any errors.
Will upload later today when I get home and have access to this computer.
Describe the bug
Re-authentication with Frontier is always required the first time that EDMC is launched after switching computers.
To Reproduce
Expected behavior
I want to move back and forth between computers without having to log in every time.
Additional context
(Cut & paste from our forum conversation about this)
It's a Steam account. I've tried using Frontier login auth and Steam login auth, both require me to re-authenticate when I move between computers.
I do have the journal directory, trade data folder, and visited stars cache folder all synced to OneDrive so that both computers stay accurate on all data.
For reference, in case something about my setup might be causing the problem, these are the synced folders...
C:\Users\james\Saved Games\Frontier Developments\Elite Dangerous
C:\Users\james\AppData\Local\Frontier Developments\Elite Dangerous\2576704
C:\Users\james\AppData\Local\Frontier Developments\Elite Dangerous\2592140
The above are actually symlinks (mklink /d) that point to respective subdirectories inside my OneDrive folder (the folder which actually gets synced).
I'm not sure if having those folders synced (or having them linked to a different location) could be causing problems but figured I'd lay out my setup just in case.
The text was updated successfully, but these errors were encountered: