Alerts endpoint integration returns 500 error
Description
There is an error when visiting the Alerts endpoint integration on service templates, instance-level, and group-level integrations.
I'm not sure if this is related to the latest changes from @oregand 6bc88545.
ActionView::Template::Error - undefined method `find_or_initialize_service' for nil:NilClass:
app/views/projects/services/alerts/_help.html.haml:1:in `view template'
app/helpers/operations_helper.rb:8:in `block in prometheus_service'
lib/gitlab/utils/strong_memoize.rb:30:in `strong_memoize'
app/helpers/operations_helper.rb:7:in `prometheus_service'
app/helpers/operations_helper.rb:20:in `alerts_settings_data'
ee/app/helpers/ee/operations_helper.rb:40:in `alerts_settings_data'
app/views/projects/services/alerts/_help.html.haml:1
app/views/shared/_service_settings.html.haml:4
app/views/admin/services/_form.html.haml:7
app/views/admin/services/_form.html.haml:6
app/views/admin/services/edit.html.haml:6
app/controllers/application_controller.rb:134:in `render'
ee/lib/gitlab/ip_address_state.rb:10:in `with'
ee/app/controllers/ee/application_controller.rb:44:in `set_current_ip_address'
app/controllers/application_controller.rb:493:in `set_current_admin'
lib/gitlab/session.rb:11:in `with_session'
app/controllers/application_controller.rb:484:in `set_session_storage'
lib/gitlab/i18n.rb:73:in `with_locale'
lib/gitlab/i18n.rb:79:in `with_user_locale'
app/controllers/application_controller.rb:478:in `set_locale'
lib/gitlab/error_tracking.rb:52:in `with_context'
app/controllers/application_controller.rb:543:in `sentry_context'
app/controllers/application_controller.rb:471:in `block in set_current_context'
lib/gitlab/application_context.rb:54:in `block in use'
lib/gitlab/application_context.rb:54:in `use'
lib/gitlab/application_context.rb:21:in `with_context'
app/controllers/application_controller.rb:463:in `set_current_context'
lib/gitlab/metrics/elasticsearch_rack_middleware.rb:16:in `call'
lib/gitlab/middleware/rails_queue_duration.rb:33:in `call'
lib/gitlab/metrics/rack_middleware.rb:16:in `block in call'
lib/gitlab/metrics/transaction.rb:61:in `run'
lib/gitlab/metrics/rack_middleware.rb:16:in `call'
lib/gitlab/request_profiler/middleware.rb:17:in `call'
lib/gitlab/query_limiting/middleware.rb:17:in `block in call'
lib/gitlab/query_limiting/transaction.rb:39:in `run'
lib/gitlab/query_limiting/middleware.rb:16:in `call'
lib/gitlab/jira/middleware.rb:19:in `call'
lib/gitlab/middleware/go.rb:20:in `call'
lib/gitlab/etag_caching/middleware.rb:13:in `call'
lib/gitlab/middleware/multipart.rb:218:in `call'
lib/gitlab/middleware/handle_null_bytes.rb:19:in `call'
lib/gitlab/middleware/read_only/controller.rb:51:in `call'
lib/gitlab/middleware/read_only.rb:18:in `call'
lib/gitlab/middleware/same_site_cookies.rb:27:in `call'
lib/gitlab/middleware/basic_health_check.rb:25:in `call'
lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in `call'
lib/gitlab/middleware/request_context.rb:23:in `call'
config/initializers/fix_local_cache_middleware.rb:9:in `call'
lib/gitlab/middleware/static.rb:11:in `call'
lib/gitlab/webpack/dev_server_middleware.rb:34:in `perform_request'
lib/gitlab/metrics/requests_rack_middleware.rb:49:in `call'
lib/gitlab/middleware/release_env.rb:12:in `call'
Steps to reproduce
- Go to Admin http://localhost:3000/admin
- Go to Service Templates or Settings > Integrations
- Click on Alerts endpoint
💣
Edited by Arturo Herrero