502 Server Error On Repository Search w/ OAuth Token #204805
Replies: 2 comments 1 reply
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
|
The 10-second wait followed by a 502 is the search backend timing out rather than a permissions rejection — and the token type changes how expensive the query is, which is why the PAT "fixes" it. With an OAuth app token, results have to be filtered through the org's third-party app access policy on top of normal visibility rules; with your own classic PAT the visibility evaluation is cheaper, and the query squeaks in under the time budget. Same query, different evaluation cost, and yours is sitting right at the edge (hence the occasional success). Two practical ways out:
If you specifically need to demonstrate the OAuth-vs-PAT discrepancy to GitHub, a support ticket with a request ID from a 502 response ( |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Bug
💬 Feature/Topic Area
API
Body
This issue has been appearing on my app for a few weeks now. When I run a repository search with the following query through my application, using a token generated via OAuth, I get a 10 second wait and then 502 Server Error.
https://api.github.com/search/repositories?q=org%3A{orgname}%20global%20archived%3Afalse%20fork%3Atrue&page=1&per_page=30&sort=updated&order=desc
The above is only an example, multiple other organizations and search params act the same. The errors are mostly consistent, with the 502 appearing 95% of the time, but sometimes results do come through.
When instead I manually change the token to use a Classic PAT I created myself, suddenly the search call works as intended. This happens both through my own application and through Postman, so I'm 99% sure it's not an applicative issue on my side.
The scopes for the OAuth app as configured are: repo,admin:repo_hook,admin:org_hook,read:org,read:user
The following is a link to the API documentation: https://docs.github.com/en/rest/search/search?apiVersion=2026-03-10#search-repositories.
Thanks in advance to anyone who thinks they can help! :)
All reactions