You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug][GitHub GraphQL] Fetching Pull Requests fails with HTTP 502 #8469
I had searched in the issues and found no similar issues.
What happened
In one of our projects, the GitHub GraphQL PR Collector fails reproducible due to HTTP 502. I already found this old bug #3708 and tried to further reduce the page size, but without success. It always seems to happen at the same collector page (depending on page size).
What do you expect to happen
I would expect that the Job doesn't fail or at least gives more valuable information in the logs about the query which failed. I only see the response body (standard nginx 502 gateway error).
How to reproduce
This seems to related to actual data of one private repository, so I can't share a way to reproduce it. I'm not familiar to Go programming, but can do a local docker backend rebuild and would appreciate getting help to further boil this down.
5xx errors indicate a server-side issue—in this case, with the GitHub API—where the server encounters a problem it cannot properly handle. These errors can be triggered by various factors such as page size or other request-specific conditions, so it's difficult to say definitively whether you're encountering the same issue as described in #3708.
Ideally, GitHub should address the underlying cause of the 5xx error and return a more appropriate response, such as a 4xx error indicating the request size is too large or something along those lines. I recommend reporting this issue to GitHub so they can investigate further.
That said, if you’d like to dig deeper into this on your end, feel free to reach out—I’m happy to help however I can.
Good catch.
Changing the page size dynamically is too complicated and hard to maintain IMO.
How about exposing an Environment Variable for changing the page size?
This would already be an improvement. It would still affect all projects, even the ones that could handle much bigger page sizes (all other 6 projects with different repositories worked fine with a page size of 10).
This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.
Activity
Startrekzky commentedon Jun 16, 2025
Noted. Please take a look @klesh
klesh commentedon Jun 19, 2025
5xx errors indicate a server-side issue—in this case, with the GitHub API—where the server encounters a problem it cannot properly handle. These errors can be triggered by various factors such as page size or other request-specific conditions, so it's difficult to say definitively whether you're encountering the same issue as described in #3708.
Ideally, GitHub should address the underlying cause of the 5xx error and return a more appropriate response, such as a 4xx error indicating the request size is too large or something along those lines. I recommend reporting this issue to GitHub so they can investigate further.
That said, if you’d like to dig deeper into this on your end, feel free to reach out—I’m happy to help however I can.
robaca commentedon Jun 26, 2025
Not sure what changed, but this error didn't occur any more after a while.
robaca commentedon Jul 7, 2025
With a second clean installation with the same project setup, the error is occurring again, so I reopen the ticket.
It would be helpful if I can get DevLake to at least skip the PR and continue with the job.
robaca commentedon Jul 7, 2025
I get the following stacktrace:
robaca commentedon Jul 7, 2025
I was able to get PR collection to work by rebuilding the backend with page size of 1.
As there is already some retry logic, would it be possible to reduce page size on each retry until 502 errors vanish?
klesh commentedon Jul 7, 2025
Good catch.
Changing the page size dynamically is too complicated and hard to maintain IMO.
How about exposing an Environment Variable for changing the page size?
robaca commentedon Jul 7, 2025
This would already be an improvement. It would still affect all projects, even the ones that could handle much bigger page sizes (all other 6 projects with different repositories worked fine with a page size of 10).
github-actions commentedon Sep 6, 2025
This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.
github-actions commentedon Sep 14, 2025
This issue has been closed because it has been inactive for a long time. You can reopen it if you encounter the similar problem in the future.