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

First Login : "ERROR Failed to extract key 'name' from response:" #53

Open
rmivdc opened this issue May 5, 2024 · 2 comments
Open

First Login : "ERROR Failed to extract key 'name' from response:" #53

rmivdc opened this issue May 5, 2024 · 2 comments

Comments

@rmivdc
Copy link

rmivdc commented May 5, 2024

After running the docker image with correct settings :

WARNING: Published ports are discarded when using host network mode
2024-05-05 10:07:14,636 INFO Login to EcoFlow API https://api.ecoflow.com/auth/login
2024-05-05 10:07:15,447 ERROR Failed to extract key 'name' from response:
...

@enikioy
Copy link

enikioy commented Jul 4, 2024

After running the docker image with correct settings :

WARNING: Published ports are discarded when using host network mode 2024-05-05 10:07:14,636 INFO Login to EcoFlow API https://api.ecoflow.com/auth/login 2024-05-05 10:07:15,447 ERROR Failed to extract key 'name' from response: ...

Set nickname for your account.

@Nid01
Copy link

Nid01 commented Oct 7, 2024

Someone else ran into this issue too: https://www.facebook.com/groups/1405868123482532/posts/1746028616133146/?__cft__[0]=AZXhsOA1GgQQhFpwSOUdu4tAYQa-5Uu0mR_83YCLps8iweY9f7k8OBJYM0MGle4JDXcpUNBjI6zTmX6Eg-BcvhZ8jbdomVdkaKKGjHklRPks8K0_pxRgBcLwW_Fp2Ppw3aAvdtZripAYW8mJsDp5eDDsoNC8PLsy4zdty7Q3pCrHpZmb7bul1K1O46qPIhY54Bkh3ZAxwtut0tGJJGV8APLX&__tn__=%2CO%2CP-R

After debugging I propose to modify the code here like this since the name is only used for one log entry:

        try:
            token = response["data"]["token"]
            user_id = response["data"]["user"]["userId"]
            user_name = response["data"]["user"]["name"]
        except KeyError as key:
            if key == "name":
                log.warning(f"Failed to extract key {key} from response: {response}. Continuing anyway")
                user_name = "nickname not set in app"
            raise Exception(f"Failed to extract key {key} from response: {response}")

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

3 participants