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

503 Service unavailable #34

Closed
kgroshert opened this issue Oct 28, 2023 · 7 comments · Fixed by #35
Closed

503 Service unavailable #34

kgroshert opened this issue Oct 28, 2023 · 7 comments · Fixed by #35

Comments

@kgroshert
Copy link

Node: 8.5.3
anylist: latest

Started getting error 503 from anylist yesterday in the home assistant addon. Just tried with the index.js and this also give a 503:

$ node index.js 
/home/dev/anylist/node_modules/got/dist/source/as-promise.js:118
                const error = new errors_1.HTTPError(response, options);
                              ^

HTTPError: Response code 503 (Service Unavailable)
    at EventEmitter.<anonymous> (/home/dev/anylist/node_modules/got/dist/source/as-promise.js:118:31)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

@kevdliu
Copy link
Collaborator

kevdliu commented Oct 28, 2023

That sounds like their service is down, does the anylist app still work?

@kgroshert
Copy link
Author

Yes, the web-version works, as well as the android- and MacOS versions.

@kevdliu
Copy link
Collaborator

kevdliu commented Oct 29, 2023

Ah yeah I see it on my end too. I'll have to look into it but I really hope this is not because anylist decided to block our access 🤞

@kevdliu
Copy link
Collaborator

kevdliu commented Oct 30, 2023

Yeah looks like they changed how clients are authenticated. I'll work on fixing it.

@codetheweb
Copy link
Owner

Thanks for investigating @kevdliu :)

@jeffhunter
Copy link

The primary problem is that this library is attempting to use /data/validate-login for authentication. This has been obsolete for many years and is being phased out.

A related problem is that users of this library often engage in patterns of login behavior that appear to be potentially suspicious, such as attempting to sign in to the same account dozens or hundreds of times per hour. This makes it look like an account may be under attack, and could lead to the account being restricted by automated security tools.

@kevdliu
Copy link
Collaborator

kevdliu commented Oct 31, 2023

Thanks for your comments. I've attempted to address the authentication issue by updating the library to use bearer tokens in this PR #35. You're right in that the library can definitely be optimized to utilize caching in order to reduce calls to the auth endpoint. When I get a chance I plan on adding caching for the access and refresh tokens in addition to the client id.

@codetheweb codetheweb linked a pull request Nov 3, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

4 participants