GitHub: an API request timed out
If GitHub takes more than 10 seconds to process an API request, GitHub terminates the request, and you receive a timeout response and a "Server Error" message (GitHub's troubleshooting the REST API, checked October 28, 2026). GitHub reserves the right to change the timeout window to protect the speed and reliability of the API.
What GitHub answers
- REST API: a timeout response with the message
Server Error. - GraphQL API: a message that "We couldn't respond to your request in time", with a
502or504status code; both indicate that the request timed out (GitHub's rate limits and query limits for the GraphQL API). - A cost to the rate limit: if a timeout occurs for any of your API requests, additional points are deducted from your primary rate limit for the next hour (see API rate limit exceeded).
- Partial results: a GraphQL query that consumes too many resources is terminated too, and GitHub returns partial results along with an error saying that resource limits were exceeded.
- Search: a search query that runs past its time limit returns the matches already found before the timeout, and the response has
incomplete_resultsset totrue. GitHub notes that reaching a timeout does not necessarily mean the results are incomplete: more results might have been found, but also might not (GitHub's timeouts and incomplete results). - 202 from repository statistics: computing statistics is expensive, so GitHub returns cached data when it can. When nothing is cached yet, the endpoint answers
202and starts a background job; send the request again after a short time, and a finished job answers200with the statistics. The cache follows the SHA of the default branch, so a push there resets it. The weekly commit activity endpoint answers422for a repository with 10,000 or more commits (GitHub's repository statistics). - Wait as long as it says: if a response includes an
x-poll-intervalheader, wait at least that many seconds before polling the same endpoint again (GitHub's avoid polling).
When reviews stall on a slow GitHub: Pull Request Inbox for GitHub, a plugin for JetBrains IDEs, reads its lists 100 items a page, and on a 502, 504 or other 5xx says that GitHub did not answer in time and to try again later.
Why it took too long
- A large request: GitHub suggests simplifying the request, for example asking for fewer than 100 items on a page. In GraphQL, the queries that may exceed resource limits include thousands of objects or deeply nested relationships in one query, large
firstorlastarguments in several connections at once, and extensive details for each object. - A problem with the API: the timeout can be due to an incident at GitHub; githubstatus.com shows the status of the REST and GraphQL APIs.
- A large comparison: a comparison that GitHub cannot compute in time fails with its own message (see compare refused).
- Nodes multiply: every GraphQL connection needs a
firstorlastbetween 1 and 100, and one call cannot request more than 500,000 total nodes. Nested connections multiply: in GitHub's example, 50 repositories with 10 issues each are 50 + 500 = 550 nodes (GitHub's node limit).
What to do
- Check the status: look at githubstatus.com, or the GitHub status API, for incidents affecting the API.
- Check the status from a script:
curl -s https://www.githubstatus.com/api/v2/components.jsonlists each component with its status, one ofoperational,degraded_performance,partial_outageormajor_outage; the API is the component namedAPI Requests./api/v2/incidents/unresolved.jsonlists incidents in the Investigating, Identified or Monitoring state (the GitHub status API). - Try later: send the request again later.
- Repeated 5xx answers: GitHub says not to ignore repeated 4xx and 5xx error codes, and to make sure you are interacting with the API correctly instead. Intentionally ignoring repeated validation errors may result in the suspension of your app for abuse (GitHub's do not ignore errors).
- Retrying in a loop: slow requests also count toward a secondary rate limit: no more than 90 seconds of CPU time per 60 seconds of real time, and no more than 60 seconds of it for the GraphQL API. GitHub says the total response time is a rough estimate of the CPU time. When an answer carries
retry-after, wait that many seconds (GitHub's secondary rate limits; see why the API rate limit was exceeded). - Requests one after another: to avoid secondary rate limits, GitHub says to make requests serially instead of concurrently, for example through a queue, and to wait at least one second between each request when making a large number of
POST,PATCH,PUTorDELETErequests (GitHub's avoid concurrent requests and pause between mutative requests). - Ask for less: in the REST API, if you request 100 items on a page, try requesting fewer. In GraphQL, use smaller values for
firstorlastand paginate, avoid deeply nested objects, filter the results, split large queries into simpler ones, and select only the fields you need. - See what a query costs: ask for
rateLimit { cost }in the same GraphQL query to get its point value, or estimate it before sending: add up the requests needed to fulfill each unique connection, assuming each reaches itsfirstorlastlimit, then divide by 100 and round to the nearest whole number (GitHub's returning the point value of a query).
In IntelliJ IDEA: the IDE waits longer than GitHub does
Checked in the IntelliJ IDEA source on November 1, 2026: GithubSettingsConfigurable.kt, GithubSettings.java, GithubApiHelperRequestExecutor.kt, GithubApiRequestExecutor.kt, RequestTimeoutConfigurer.kt, HttpRequests.java, GHAPIExceptionUtil.kt, GithubApiRequest.kt.
The GitHub page of the IDE settings has one time field:
Connection timeout: 5 seconds
It is only the time to connect, from 0 to 60 seconds. Once connected, the IDE waits up to 60 seconds for the answer, the platform's read timeout (idea.read.timeout). GitHub ends a request after 10 seconds, well inside that, so a slow request comes back as GitHub's timeout answer. Raising the field does not change it.
When a 502 or 504 comes with a message in JSON, the IDE shows only GitHub's message. Otherwise it shows the status code and the text of the answer as they are, as in "502 - …". In the pull request list this appears under Can't load pull requests, with Retry (as for a failed search).
A GraphQL answer can hold partial results together with an error that resource limits were exceeded. When the data the IDE asked for is there, it uses that data and does not show the errors that came with it.
GitHub pull requests in IntelliJ IDEA
Pull Request Inbox for GitHub, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, shows a pull request's reviews, checks and conversations next to the diff, and merges it with the methods the target branch allows. It reads its lists from GitHub 100 items a page. When GitHub answers 502, 504 or another 5xx, it says that GitHub did not answer in time, that GitHub ends a request that takes it more than 10 seconds, and to try again later or see githubstatus.com, rather than take a web page for a sign-in page. The review inbox, diffs and conversations are free; approving, commenting, resolving and merging are Pro (US$1.50 a month, with a 30-day trial).
Get it on JetBrains Marketplace
GitHub is a trademark of GitHub, Inc.; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by GitHub, Inc. or JetBrains.
More: GitHub merge refused (405, 409) · GitHub review refused (422) · GitHub search 422 "Validation Failed" · "Resource not accessible by personal access token" · 401 "Bad credentials" · "Resource protected by organization SAML enforcement" · "API rate limit exceeded" · GitHub diff 406 "too_large", 3,000 files · GitHub line comment 422 "must be part of the diff" · GitHub branch update refused (422) · GitHub pull request not created (422, 403) · GitHub auto-merge refused · GitHub draft, ready for review or close refused · GitHub conversation not resolved · GitHub checks not shown (check runs 403) · GitHub file contents not read · GitHub compare refused (404, 422) · GitHub comment or reply refused (403 locked, archived) · GitHub merge method not allowed (405) · GitHub branch not found (404, 301) · GitHub Enterprise Server not reached · GitHub review request not shown · GitHub pull request list incomplete · GitHub 404 Not Found, renamed repositories (301, 307) · GitHub line comment outdated or not on the diff · GitHub pull requests not updating, notifications late · GitHub suggested change cannot be applied · GitHub required check stuck at "Expected" · GitHub code owner review required · GitHub merge blocked by unresolved conversations · GitHub merge blocked by unsigned commits · GitHub branch that merges through a merge queue · GitHub merge waiting for an approval of the most recent push · GitHub merge waiting for code scanning results · GitHub merge waiting for code quality results · GitHub merge blocked by a code coverage threshold · GitHub merge blocked by license compliance results · GitHub branch locked or its updates restricted · GitHub branch not deleted after merging · GitHub merge waiting for a team's approval (Required reviewers) · GitHub merge blocked by secret scanning alerts · GitHub stacked pull request not merging · GitHub push blocked by push rules · GitHub merge blocked by commit metadata rules · GitHub force push blocked · GitHub issue not closed by a merged pull request · GitHub pull request not checked out locally · GitHub pull request has merge conflicts · GitHub changes requested and dismissing a review · GitHub co-author not credited for a commit · GitHub dependency review check failed · GitHub Dependabot not rebasing its pull request · GitHub fork not syncing with upstream · GitHub pull request base branch not changing · GitHub pull request not reverting · GitHub pull request template not showing · GitHub pull request labels or assignees not added · GitHub pull request not closing or reopening · GitHub push blocked by push protection · GitHub pull request comment hidden · GitHub pull request blocked until deployments succeed · GitHub team review request replaced by members · GitHub pull request file no longer marked Viewed · GitHub pull request marked merged without being merged · GitHub Copilot review does not count as an approval · GitHub checks not running on a pull request a workflow created · GitHub Update branch button not shown on a pull request · GitHub checks failing on a Dependabot pull request · GitHub checks failing on a pull request from a fork · GitHub checks skipped by [skip ci] in a commit message · GitHub checks gone after the retention period · GitHub code review limits in a public repository · GitHub pull requests turned off or limited in a repository · GitHub checks run on every pull request in a stack · GitHub pull request showing commits already squash merged · GitHub pull request not showing a file diff · GitHub push to a pull request branch from a fork refused · GitHub check cancelled on a pull request · GitHub Rebase and merge not available · GitHub merge commit message not what you expected · GitHub pull request shows every line changed · GitHub pull request image or document diff not shown · GitHub review request refused (422) · GitHub pull request from Copilot: checks not running, approval not counted · GitHub push refused: GH006 and GH013 on a protected branch · GitHub "At least 1 approving review is required", approvals that do not count · GitHub pull request plugins for IntelliJ IDEA, compared · 日本語