legendary
legendary copied to clipboard
Error when running legendary status
Platform
Operating system and version: Gentoo kernel 5.15.41
Legendary version (legendary -V
): Legendary v0.20.27 - "Dark Energy (hotfix)"
Expected Behavior
Should show status info.
Current Behavior
It gives this error
[Core] INFO: Trying to re-use existing login session...
[EPCAPI] WARNING: Login to EGS API failed with errorCode: errors.com.epicgames.common.authentication.authentication_failed
[Core] WARNING: Resuming failed due to invalid credentials: InvalidCredentialsError('errors.com.epicgames.common.authentication.authentication_failed')
[Core] INFO: Falling back to using refresh token...
[Core] INFO: Logging in...
Traceback (most recent call last):
File "/home/brook/.local/bin/legendary", line 8, in <module>
sys.exit(main())
File "/home/brook/.local/lib/python3.9/site-packages/legendary/cli.py", line 2990, in main
cli.status(args)
File "/home/brook/.local/lib/python3.9/site-packages/legendary/cli.py", line 1505, in status
games_available = len(self.core.get_game_list(update_assets=not args.offline))
File "/home/brook/.local/lib/python3.9/site-packages/legendary/core.py", line 383, in get_game_list
return self.get_game_and_dlc_list(update_assets=update_assets, platform=platform)[0]
File "/home/brook/.local/lib/python3.9/site-packages/legendary/core.py", line 397, in get_game_and_dlc_list
self.get_assets(update_assets=update_assets, platform=_platform)
File "/home/brook/.local/lib/python3.9/site-packages/legendary/core.py", line 343, in get_assets
self.egs.get_game_assets(platform=platform)
File "/home/brook/.local/lib/python3.9/site-packages/legendary/api/egs.py", line 153, in get_game_assets
r.raise_for_status()
File "/usr/lib/python3.9/site-packages/requests/models.py", line 960, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://launcher-public-service-prod06.ol.epicgames.com/launcher/api/public/assets/Windows?label=Live
Steps to Reproduce
- Authenticate
- Run
legendary status
Additional information
I have successfully authenticated.
Are you using a VPN? Sometimes Epic's services are blocked there resulting in these issues.
no
Unfortunately this is a duplicate of #267 where we were never able to figure out why this is happening. It seems that the refresh token works (or at least, fails in a way that doesn't throw an error for some reason), and the authentication token obtained is invalid. This may be due to a block on Epic's side for some reason but I cannot tell you why.
I commented on #267 but didn't notice that it was Closed; is it possible that this error is related to 2FA?
Epic's official launcher does user/pass or OAuth in browser, but it does 2FA TOTP in the launcher itself.
I also get this error consistenly now - i cannot seem to get out of this state. Hence I am unable to list, install or play any games. Any updates on this issue? If you need help debugging the issue @derrod please let me know. Any additional information i can provide?
@z3roco01 @derrod @Formedras I found what caused issue on my machine. If the .netrc file contains an entry with a "default" machine, some parts of the python code tries to authenticate with the credentials present in this file. Can this somehow be fixed, such that .netrc is never used!?
Well im5glad somebody finally figured this out!
Legendary uses the requests library, I don't know if it's easy to disable this behaviour.
To be fair - I shouldn't be using a default entry in the .netrc file, it ought to be specialized entries only. On the other hand I don't see why the authentication agains Epic's API should have anything to with this file either. At least now you can tell other that report this bug on linux first to check their .netrc file.