Issue search consistently returns 500 with many != operators

Summary

When adding a number of != operators to the issue search, I'm able to get 500 errors after around 5+ filters

Steps to reproduce

  1. Log in
  2. Click the Issues button in the right corner or visit https://gitlab.com/dashboard/issues
  3. Add 5+ filters with the =! operator
  4. Hit enter, instead of the filters being applied, will get a 500 error

Example Project

I reproduced this issue on gitlab itself, and on a personal project. Here are the urls that created 500s

On my personal project https://gitlab.com/snackattas/gitlab-issue-340766/-/issues?scope=all&state=opened&not[author_username]=snackattas&not[assignee_username][]=snackattas&not[milestone_title]=test%201&not[release_tag]=tag&not[my_reaction_emoji]=thumbsup

On gitlab https://gitlab.com/gitlab-org/gitlab/-/issues?scope=all&state=opened&not[author_username]=snackattas&not[assignee_username][]=snackattas&not[milestone_title]=14.4&not[iteration_id]=Current&not[release_tag]=v14.3.0-ee

What is the current bug behavior?

After applying 5+ != filters, when applied, the search/page 500s

What is the expected correct behavior?

The application should be able to handle a number of != filters, or, have some sort of max of them, if there IS in fact a limit of supported != parameters that is reasonable to apply

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Edited by zachary attas