gitlab internal server error when setting 'Rate limit period in seconds ' to 0
Summary
On private instances: 500 error when setting 'Rate limit period in seconds' to 0.
Steps to reproduce
In admin console -> Settings -> Network -> set any of the 'Rate limit period in seconds' to 0. gitlab will hang immediately and start giving 500 errors.
What is the current bug behavior?
500 internal server error, no access to anywebpage, runners will fail too.
What is the expected correct behavior?
Either dont allow 0 value / code handles 0
Relevant logs and/or screenshots
gitlab-12-8-unicorn-786f84c7bc-tsh6s unicorn This CSRF token verification failure is handled internally by `GitLab::RequestForgeryProtection`
gitlab-12-8-unicorn-786f84c7bc-tsh6s unicorn Unlike the logs may suggest, this does not result in an actual 422 response to the user
gitlab-12-8-unicorn-786f84c7bc-tsh6s unicorn For API requests, the only effect is that `current_user` will be `nil` for the duration of the request
gitlab-12-8-unicorn-786f84c7bc-tsh6s unicorn Completed 422 Unprocessable Entity in 2ms (ActiveRecord: 0.0ms | Elasticsearch: 0.0ms | Allocations: 265)
gitlab-12-8-unicorn-786f84c7bc-tsh6s gitlab-12-8-nginx-ingress-controller-68b87b5c56-rft8kunicorn
gitlab-12-8-unicorn-786f84c7bc-tsh6s nginx-ingress-controllerunicorn ZeroDivisionError (divided by 0):
10.28.9.150 - [10.28.9.150] - - [19/Mar/2020:14:02:47 +0000] "POST /api/v4/runners HTTP/1.1" 500 46 "-" "gitlab-runner 12.7.1 (12-7-stable; go1.13.5; linux/amd64)" 786 0.062 [gitlab-12-8-gitlab-12-8-unicorn-8181] 10.28.1.233:8181 46 0.062 500 5ce4cb9268544a07ec024486402a47d9
gitlab-12-8-unicorn-786f84c7bc-tsh6s unicorn
gitlab-12-8-unicorn-786f84c7bc-tsh6s unicorn lib/gitlab/middleware/read_only/controller.rb:53:in `call'
gitlab-12-8-unicorn-786f84c7bc-tsh6s unicorn lib/gitlab/middleware/read_only.rb:18:in `call'
gitlab-12-8-unicorn-786f84c7bc-tsh6s unicorn lib/gitlab/middleware/basic_health_check.rb:25:in `call'
gitlab-12-8-unicorn-786f84c7bc-tsh6s unicorn lib/gitlab/middleware/request_context.rb:23:in `call'
gitlab-12-8-unicorn-786f84c7bc-tsh6s unicorn config/initializers/fix_local_cache_middleware.rb:9:in `call'
gitlab-12-8-unicorn-786f84c7bc-tsh6s unicorn lib/gitlab/metrics/requests_rack_middleware.rb:49:in `call'
gitlab-12-8-unicorn-786f84c7bc-tsh6s unicorn lib/gitlab/middleware/release_env.rb:12:in `call'
gitlab-12-8-unicorn-786f84c7bc-tsh6s gitlab-workhorse gitlab.progressoft.io 10.28.0.181 - - [2020/03/19:14:02:47 +0000] "POST /api/v4/runners HTTP/1.1" 500 46 "" "gitlab-runner 12.7.1 (12-7-stable; go1.13.5; linux/amd64)" %!f(int64=059)
gitlab-12-8-gitlab-runner-5497767c6b-8bh98 gitlab-12-8-gitlab-runner ERROR: Registering runner... failed runner=wWAqLLzY status=500 Internal Server Error
gitlab-12-8-gitlab-runner-5497767c6b-8bh98 gitlab-12-8-gitlab-runner PANIC: Failed to register this runner. Perhaps you are having network problems
Output of checks
dont have it
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)