500 error on save of general pipeline settings timeout
<!--- Please read this! Before opening a new issue, make sure to search for keywords in the issues filtered by the "regression" or "bug" label. For the Community Edition issue tracker: - https://gitlab.com/gitlab-org/gitlab-ce/issues?label_name%5B%5D=regression - https://gitlab.com/gitlab-org/gitlab-ce/issues?label_name%5B%5D=bug For the Enterprise Edition issue tracker: - https://gitlab.com/gitlab-org/gitlab-ee/issues?label_name%5B%5D=regression - https://gitlab.com/gitlab-org/gitlab-ee/issues?label_name%5B%5D=bug and verify the issue you're about to submit isn't a duplicate. ---> ### Summary When trying to save timout settings in Project >> Settings >> CI/CD >> General Pipeline >> Timemout with the value of less than `10m` receiving a 500 error.<br> gitlab version: 11.5<br> ZD: https://gitlab.zendesk.com/agent/tickets/109265 ### Steps to reproduce Go to `Project >> Settings >> CI/CD >> General Pipeline >> Timemout` enter `5m` and click save. ### Example Project Any ### What is the current *bug* behavior? 500 error generated on save of General Pipeline settings: ``` ==> /var/log/gitlab/gitlab-rails/production.log <== Started PATCH "/root/aws/settings/ci_cd" for 37.228.247.26 at 2018-11-29 15:34:19 +0000 Processing by Projects::Settings::CiCdController#update as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "project"=>{"build_allow_git_fetch"=>"true", "build_timeout_human_readable"=>"5m", "ci_config_path"=>"", "public_builds"=>"1", "auto_cancel_pending_pipelines"=>"enabled", "build_coverage_regex"=>""}, "namespace_id"=>"root", "project_id"=>"aws"} Completed 500 Internal Server Error in 151ms (ActiveRecord: 14.6ms | Elasticsearch: 0.0ms) ArgumentError (First argument in form cannot contain nil or be empty): ee/app/views/projects/protected_environments/_form.html.haml:1:in `_ee_app_views_projects_protected_environments__form_html_haml__4105040759488106744_69885580783100' ee/app/views/projects/settings/ci_cd/_protected_environments.html.haml:14:in `_ee_app_views_projects_settings_ci_cd__protected_environments_html_haml__784866354574180049_69885583011100' app/helpers/application_helper.rb:12:in `render_if_exists' app/views/projects/settings/ci_cd/show.html.haml:31:in `_app_views_projects_settings_ci_cd_show_html_haml__3722987514963214584_69885610184400' ee/app/helpers/ee/application_helper.rb:18:in `render_ce' ee/app/views/projects/settings/ci_cd/show.html.haml:1:in `_ee_app_views_projects_settings_ci_cd_show_html_haml__2521426076322296764_69885609766200' app/controllers/application_controller.rb:116:in `render' app/controllers/projects/settings/ci_cd_controller.rb:24:in `block in update' app/controllers/projects/settings/ci_cd_controller.rb:15:in `tap' app/controllers/projects/settings/ci_cd_controller.rb:15:in `update' lib/gitlab/i18n.rb:55:in `with_locale' lib/gitlab/i18n.rb:61:in `with_user_locale' app/controllers/application_controller.rb:434:in `set_locale' lib/gitlab/middleware/multipart.rb:101:in `call' lib/gitlab/request_profiler/middleware.rb:14:in `call' ee/lib/gitlab/jira/middleware.rb:15:in `call' lib/gitlab/middleware/go.rb:17:in `call' lib/gitlab/etag_caching/middleware.rb:11:in `call' lib/gitlab/middleware/rails_queue_duration.rb:22:in `call' lib/gitlab/metrics/rack_middleware.rb:15:in `block in call' lib/gitlab/metrics/transaction.rb:53:in `run' lib/gitlab/metrics/rack_middleware.rb:15:in `call' lib/gitlab/middleware/read_only/controller.rb:40:in `call' lib/gitlab/middleware/read_only.rb:16:in `call' lib/gitlab/middleware/basic_health_check.rb:25:in `call' lib/gitlab/request_context.rb:20:in `call' lib/gitlab/metrics/requests_rack_middleware.rb:27:in `call' lib/gitlab/middleware/release_env.rb:10:in `call' ``` ### What is the expected *correct* behavior? Should show the following error instead: ![500_error](/uploads/a51a8cdf3a56857d3f554e265bb6957b/500_error.png) ### Output of checks On Gitlab.com its weird, as customer can reporduce the 500 error however when I test the same on gitlab.com I get the error message `Build timeout needs to be between 10 minutes and 1 month` however all `expand` buttons become unresponsive.However on my self hosted test instance 11.5 I can reproduce the same 500 error. ![500_2](/uploads/1781cf423436c4638d0ce14aa613d80b/500_2.png) #### Results of GitLab environment info <details> <summary>Expand for output related to GitLab environment info</summary> <pre> (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`) </pre> </details> #### Results of GitLab application Check <details> <summary>Expand for output related to the GitLab application check</summary> <pre> (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) </pre> </details> ### Possible fixes (If you can, link to the line of code that might be responsible for the problem)
issue