Issues API Request Returning 500 Error Instead of 403 for Disabled Issues Feature
Summary
API request is returning a 500 Internal Server Error
instead of a 403 Forbidden
error code when making an api call to get issues for a project where the issues feature has been disabled
.
Steps to reproduce
- Disable a project's issues feature settings
- Execute
/api/v4/projects/{id}/issues?scope=all&updated_after=2023-08-01T00:00:00
-
500 Internal Server Error
is returned.
Example Project
I created an example personal project with issues and merge requests disabled to demonstrate the issue. https://gitlab.com/sarah.hernandez1/test-issues-api/
What is the current bug behavior?
The API request is currently returning a 500 Internal Server Error
instead of the expected 403 Forbidden
error code. This issue occurs when making an API call to retrieve issues for a project where the issues feature has been disabled. It is important to note that prior to July 29, 2023, the API request did not result in a 500 error code. The error was discovered while running a data-pipeline job that retrieves issues for all projects within our private company groups. The pipeline started encountering errors on July 29, 2023. It is noteworthy that the specific project that triggered the error has not been updated recently and its last update occurred on April 25, 2023. Furthermore, the issues feature setting for this project has always been disabled.
What is the expected correct behavior?
When a request is made to the issues
API for a project where the issues
feature is disabled, the response should include a 403 Forbidden
error code. The behavior of the issues
API should mirror that of the merge_request
API, which returns a 403 Forbidden error code when the merge_request
feature is disabled on a project. See example below.
Relevant logs and/or screenshots
Project with Issues and Merge Request Disabled
Response when Issues API request is called for a project with Issues disabled
Response when Merge Request API is called for a project with Merge Requests disabled
Output of checks
This bug happens on GitLab.com