badges / badges/shields

ValidationError: "x-ratelimit-limit" is required

Open
#4,258 2 comments 0 reactions 0 assignees View on GitHub
bug core
Dominant language
JavaScript
Stars
27.2k
Forks
5.6k
Avg merge
1d 8h
Merged PRs (30d)
46

Description

Sentry Issue: [SHIELDS-3H](https://sentry.io/organizations/shields/issues/1138884350/?referrer=github_integration)

```
ValidationError: "x-ratelimit-limit" is required
File "/home/m/shields/services/github/github-api-provider.js", line 81, in GithubApiProvider.getV3RateLimitFromHeaders
const h = Joi.attempt(headers, headerSchema)
File "/home/m/shields/services/github/github-api-provider.js", line 121, in GithubApiProvider.updateToken
} = this.getV3RateLimitFromHeaders(res.headers))
File "/home/m/shields/services/github/github-api-provider.js", line 200, in request
this.updateToken({ token, url, res })
File "/home/m/shields/core/base-service/legacy-request-handler.js", line 223, in Request.request [as _callback]
callback(err, res, body)
...
(5 additional frame(s) were not displayed)
```

Contributor guide

Open the contributing guide

Research direction

Start in services/github/github-api-provider.js at GithubApiProvider.getV3RateLimitFromHeaders and inspect headerSchema, then follow the updateToken and request call paths shown in the report. Reproduce or trace a response missing x-ratelimit-limit, determine the expected handling, and verify that GitHub requests no longer produce this ValidationError.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, javascript
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.