GET /projects/{id}/pipelines 500 Internal Server Error when sorting a large dataset

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

A 500 Internal Server Error is raised when performing the following request.

curl -sS --header "Authorization: Bearer <redacted>" "https://gitlab.com/api/v4/projects/<redacted>/pipelines?updated_after=2025-04-10T00:00:00Z&page=1&per_page=100&sort=asc"

Expected behavior

The request returns data without raising a 500 error.

Additional info

The very same request succeed when the sort parameter is not set, or when updated_after is more recent, e.g. 2025-04-11T:00:00:00Z. This might hint at an issue with sorting large datasets.

I redacted the project ID because I was not sure whether it is safe to share it on this board. However, I can provide it in a confidential issue if you are unable to replicate it.

Edited by 🤖 GitLab Bot 🤖