Todos API endpoint v4 giving "500 Internal Server Error" because of an entry.
Summary
If I call the endpoint https://gitlab.com/api/v4/todos?page=1&per_page=28, I get the response {"message":"500 Internal Server Error"}. If I change the per_page value to 27, I get an expected response.
If I go to https://gitlab.com/dashboard/todos?page=2, the 8th entry on the page (28th total) is a todo entry about a failed build for a project that was later renamed/archived. That todo id is 37999302.
Steps to reproduce
Unfortunately, I've been unable to recreate the issue with respects to another todo entry.
So, for right now, the best I've got is:
- Be me.
-
curl -s --header "PRIVATE-TOKEN: $GITLAB_PRIVATE_TOKEN" https://gitlab.com/api/v4/todos?page=1\&per_page=100.
Here's what I've tried that did NOT trigger the 500 error:
- Create the new repo.
- Clone it locally.
- Create a change, commit it, push it, and create a MR.
- Create a todo on the MR.
- Call the todos endpoint with page=1&per_page=1. Verified that it was giving me the new todo entry.
- Archive the project.
- Call the todos endpoint with page=1&per_page=1. Verified that it was giving me the new todo entry.
- Renamed the project.
- Call the todos endpoint with page=1&per_page=1. Verified that it was giving me the new todo entry.
- Changed the url of the project.
- Call the todos endpoint with page=1&per_page=1. Verified that it was giving me the new todo entry.
So since my problem todo entry has something to do with a failed build, maybe it's related to the CI/CD stuff rather than the moving/renaming/archiving of a project.
Example Project
I tried making https://gitlab.com/dwedul-sofi/testing-todo-api-bug-archived to reproduce the issue, but was not able to.
What is the current bug behavior?
I get the response {"message":"500 Internal Server Error"}
What is the expected correct behavior?
I get the json of all my todos.
Relevant logs and/or screenshots
Here's what the todo looks like:
> curl -s --header "PRIVATE-TOKEN: $GITLAB_PRIVATE_TOKEN" https://gitlab.com/api/v4/todos?page=1\&per_page=28 | jq ' length '
28
Thu 11-21 18:36:54 :~
> curl -s --header "PRIVATE-TOKEN: $GITLAB_PRIVATE_TOKEN" https://gitlab.com/api/v4/todos?page=1\&per_page=29
{"message":"500 Internal Server Error"}Thu 11-21 18:37:01 :~
>
Output of checks
This bug happens on GitLab.com
