Skip to content
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

Error when running legendary status #454

Open
z3roco01 opened this issue Jul 18, 2022 · 8 comments
Open

Error when running legendary status #454

z3roco01 opened this issue Jul 18, 2022 · 8 comments

Comments

@z3roco01
Copy link

z3roco01 commented Jul 18, 2022

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.

@derrod
Copy link
Owner

derrod commented Jul 18, 2022

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

@z3roco01
Copy link
Author

no

@derrod
Copy link
Owner

derrod commented Jul 18, 2022

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.

@Formedras
Copy link

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.

@torstenchr
Copy link

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
Copy link

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

Repository owner deleted a comment Nov 17, 2023
@derrod
Copy link
Owner

derrod commented Nov 17, 2023

Well im5glad somebody finally figured this out!

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

@torstenchr
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants