EDCD / EDMarketConnector

Downloads commodity market and other station data from the game Elite: Dangerous for use with all popular online and offline trading tools.
GNU General Public License v2.0
994 stars 156 forks source link

CAPI Authentication Issues - New Installer #2057

Closed Rixxan closed 1 year ago

Rixxan commented 1 year ago

The cAPI on the new installer in a small subset of users may have issues authenticating with the cAPI. This often can be identified in logs by a failed attempt to authenticate and lock the journal file, as seen here:

2023-08-05 14:08:32.245 UTC - INFO - 13332:9220:9220 EDMarketConnector.__main__:359: An EDMarketConnector.exe process was already running, exiting.
2023-08-05 14:08:32.328 UTC - INFO - 5588:6872:6872 journal_lock.JournalLock._obtain_lock:106: Exception: Couldn't lock journal directory "C:\Users\Conny\Saved Games\Frontier Developments\Elite Dangerous", assuming another process running: PermissionError(13, 'Permission denied')
2023-08-05 14:08:32.357 UTC - INFO - 2948:10836:10836 EDMarketConnector.__main__:359: An EDMarketConnector.exe process was already running, exiting.
2023-08-05 14:08:32.482 UTC - INFO - 5588:6872:6872 EDMarketConnector.__main__:359: An EDMarketConnector.exe process was already running, exiting.
2023-08-05 14:08:32.495 UTC - INFO - 21936:2572:2572 EDMarketConnector.__main__:359: An EDMarketConnector.exe process was already running, exiting.
2023-08-05 14:08:32.750 UTC - INFO - 8816:21092:21092 journal_lock.JournalLock._obtain_lock:106: Exception: Couldn't lock journal directory "C:\Users\Conny\Saved Games\Frontier Developments\Elite Dangerous", assuming another process running: PermissionError(13, 'Permission denied')
2023-08-05 14:08:32.783 UTC - INFO - 12852:23084:23084 journal_lock.JournalLock._obtain_lock:106: Exception: Couldn't lock journal directory "C:\Users\Conny\Saved Games\Frontier Developments\Elite Dangerous", assuming another process running: PermissionError(13, 'Permission denied')
2023-08-05 14:08:32.821 UTC - INFO - 25196:22028:22028 journal_lock.JournalLock._obtain_lock:106: Exception: Couldn't lock journal directory "C:\Users\Conny\Saved Games\Frontier Developments\Elite Dangerous", assuming another process running: PermissionError(13, 'Permission denied')
2023-08-05 14:08:32.917 UTC - INFO - 8816:21092:21092 EDMarketConnector.__main__:359: An EDMarketConnector.exe process was already running, exiting.
2023-08-05 14:08:33.041 UTC - INFO - 12852:23084:23084 EDMarketConnector.__main__:359: An EDMarketConnector.exe process was already running, exiting.
2023-08-05 14:08:33.097 UTC - INFO - 25196:22028:22028 EDMarketConnector.__main__:359: An EDMarketConnector.exe process was already running, exiting.
2023-08-05 14:08:33.156 UTC - INFO - 3856:21628:21628 journal_lock.JournalLock._obtain_lock:106: Exception: Couldn't lock journal directory "C:\Users\Conny\Saved Games\Frontier Developments\Elite Dangerous", assuming another process running: PermissionError(13, 'Permission denied')
2023-08-05 14:08:33.293 UTC - INFO - 3856:21628:21628 EDMarketConnector.__main__:359: An EDMarketConnector.exe process was already running, exiting.

Originally posted by @connylindquist in https://github.com/EDCD/EDMarketConnector/issues/2048#issuecomment-1666516313

Current belief has this as an issue with the windows registry and protocol handling of the edmc://auth link and how FDEV hands us back the information.

Rixxan commented 1 year ago

As a temporary solution, we may wish to put harder protocol registers in for authenticating using the EDMC:// protocol.

Longer-term solutions might include retiring that handler in favor of localhost default.

I've been able to reliably recreate this occurrence and have some fixes in testing. Longer term solutions may need to be tested further.

Athanasius commented 1 year ago

As per a 5.8.1 install, you should have registry keys under Computer\HKEY_CLASSES_ROOT\edmc\ to enable the edmc:// handler.

https://github.com/EDCD/EDMarketConnector/blob/develop/resources/EDMC_Installer_Config_template.txt#L71-L80 appears to be missing the ddeexec key as per https://github.com/EDCD/EDMarketConnector/blob/Release/5.8.1/wix/template.wxs#L104-L106 .

IIRC, the ddeexec method is preferred over the shell\open one, so it being missing might be the culprit here.

Rixxan commented 1 year ago

As per a 5.8.1 install, you should have registry keys under Computer\HKEY_CLASSES_ROOT\edmc\ to enable the edmc:// handler.

https://github.com/EDCD/EDMarketConnector/blob/develop/resources/EDMC_Installer_Config_template.txt#L71-L80 appears to be missing the ddeexec key as per https://github.com/EDCD/EDMarketConnector/blob/Release/5.8.1/wix/template.wxs#L104-L106 .

IIRC, the ddeexec method is preferred over the shell\open one, so it being missing might be the culprit here.

Agreed with your diagnosis, came to that conclusion yesterday before work. PR opened for fix, is in testing right now. Aiming for fix release on Wednesday? Will see what tests show.

Rixxan commented 1 year ago

Should be fixed. Will leave this open for 3 days for any follow-up issues before closing.