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

Rate limiting: causing TypeError: json.map is not a function #156

Closed
omusavi opened this issue Mar 15, 2021 · 2 comments
Closed

Rate limiting: causing TypeError: json.map is not a function #156

omusavi opened this issue Mar 15, 2021 · 2 comments
Labels
bug a bug which occured

Comments

@omusavi
Copy link

omusavi commented Mar 15, 2021

This error started popping up in our mega-linter runs in our CI system as well as locally, but very intermittently. Was a strange one but I think I tracked it down to the latest commit.

Basically, the call to getAvailableVersions pings github, but if we do that too much, github rate limits us:

{"message":"API rate limit exceeded for <my ip address redacted> (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}

This causes an error in the json.map call inside getAvailableVersions

ERROR: TypeError: json.map is not a function
    at /node_modules/editorconfig-checker/dist/lib.js:160:22
    at step (/node_modules/editorconfig-checker/dist/lib.js:52:23)
    at Object.next (/node_modules/editorconfig-checker/dist/lib.js:33:53)
    at fulfilled (/node_modules/editorconfig-checker/dist/lib.js:24:58)
    at processTicksAndRejections (node:internal/process/task_queues:94:5)

Unfortunately, using --skip-update-check also does not work because --skip-update-check is checked after the call to getAvailableVersions.

This issue popped up for us using the mega-linter, and as I understand it, mega-linter will call editorconfig-checker for every file that needs to be checked....which can be a lot and quickly will cause a rate limiting issue.

@mstruebing
Copy link
Member

Thank you very much. I wasn't aware of that issue and it was my mistake.
I rolled back the changes and released a new version.

@omusavi
Copy link
Author

omusavi commented Mar 16, 2021

Thanks for the quick fix!

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

No branches or pull requests

2 participants