legendary icon indicating copy to clipboard operation
legendary copied to clipboard

Error when running legendary status

Open z3roco01 opened this issue 2 years ago • 8 comments

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

  1. Authenticate
  2. Run legendary status

Additional information

I have successfully authenticated.

z3roco01 avatar Jul 18 '22 02:07 z3roco01

Are you using a VPN? Sometimes Epic's services are blocked there resulting in these issues.

derrod avatar Jul 18 '22 02:07 derrod

no

z3roco01 avatar Jul 18 '22 02:07 z3roco01

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.

derrod avatar Jul 18 '22 03:07 derrod

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.

Formedras avatar Sep 12 '22 01:09 Formedras

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?

torstenchr avatar May 31 '23 19:05 torstenchr

@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!?

torstenchr avatar Nov 17 '23 20:11 torstenchr

Well im5glad somebody finally figured this out!

Legendary uses the requests library, I don't know if it's easy to disable this behaviour.

derrod avatar Nov 17 '23 20:11 derrod

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.

torstenchr avatar Nov 17 '23 21:11 torstenchr