pagerduty integration fails with error 500
Summary
When sending a message from pagerduty to gitlab via the pagerduty integration, a 500 error is returned.
Steps to reproduce
curl --trace-ascii - -H 'Content-Type: application/json' -d @incident.json https://git.lausch.at/mla/testit/-/incidents/integrations/pagerduty?token=xxxxxxx
where incident.json contains a payload from pagerduity to gitlab, intercepted with Beeceptor.
Example Project
What is the current bug behavior?
A 500 status is returned to pagerduty and no alert/incident is created.
What is the expected correct behavior?
A 200 or 202 error is returned to pagerduty and an alert/incident is created
Relevant logs and/or screenshots
gitlab-rails/production.log the following error is printed:
Errno::ENOENT (No such file or directory @ rb_check_realpath_internal - lib/pager_duty/validator/schemas/message.json):
lib/pager_duty/webhook_payload_parser.rb:69:in `valid_message?'
lib/pager_duty/webhook_payload_parser.rb:24:in `parse_message'
lib/pager_duty/webhook_payload_parser.rb:16:in `block in call'
lib/pager_duty/webhook_payload_parser.rb:16:in `map'
lib/pager_duty/webhook_payload_parser.rb:16:in `call'
lib/pager_duty/webhook_payload_parser.rb:12:in `call'
app/services/incident_management/pager_duty/process_webhook_service.rb:43:in `block in pager_duty_processable_events'
lib/gitlab/utils/strong_memoize.rb:30:in `strong_memoize'
app/services/incident_management/pager_duty/process_webhook_service.rb:41:in `pager_duty_processable_events'
app/services/incident_management/pager_duty/process_webhook_service.rb:35:in `process_incidents'
app/services/incident_management/pager_duty/process_webhook_service.rb:25:in `execute'
app/controllers/projects/incident_management/pager_duty_incidents_controller.rb:16:in `create'
app/controllers/application_controller.rb:482:in `set_current_admin'
lib/gitlab/session.rb:11:in `with_session'
app/controllers/application_controller.rb:473: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:467:in `set_locale'
lib/gitlab/error_tracking.rb:52:in `with_context'
app/controllers/application_controller.rb:532:in `sentry_context'
app/controllers/application_controller.rb:460:in `block in set_current_context'
lib/gitlab/application_context.rb:56:in `block in use'
lib/gitlab/application_context.rb:56:in `use'
lib/gitlab/application_context.rb:22:in `with_context'
app/controllers/application_controller.rb:451:in `set_current_context'
lib/gitlab/request_profiler/middleware.rb:17:in `call'
lib/gitlab/jira/middleware.rb:19:in `call'
lib/gitlab/middleware/go.rb:20:in `call'
lib/gitlab/etag_caching/middleware.rb:21:in `call'
lib/gitlab/middleware/multipart.rb:172:in `call'
lib/gitlab/middleware/read_only/controller.rb:50:in `call'
lib/gitlab/middleware/read_only.rb:18:in `call'
lib/gitlab/middleware/same_site_cookies.rb:27:in `call'
lib/gitlab/middleware/handle_malformed_strings.rb:21: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:21:in `call'
config/initializers/fix_local_cache_middleware.rb:11:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:76:in `call'
lib/gitlab/middleware/release_env.rb:12:in `call'
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
Running in a container:
gitlab-rake gitlab:env:info System information System: Current User: git Using RVM: no Ruby Version: 2.7.2p137 Gem Version: 3.1.4 Bundler Version:2.1.4 Rake Version: 13.0.3 Redis Version: 6.0.10 Git Version: 2.29.0 Sidekiq Version:5.2.9 Go Version: unknown GitLab information Version: 13.9.1 Revision: 03979b4aaf0 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 12.6 URL: https://git.lausch.at HTTP Clone URL: https://git.lausch.at/some-group/some-project.git SSH Clone URL: ssh://git@git.lausch.at:4422/some-group/some-project.git Using LDAP: no Using Omniauth: yes Omniauth Providers: GitLab Shell Version: 13.16.1 Repository storage paths: - default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
gitlab-rake gitlab:check SANITIZE=true Checking GitLab subtasks ... Checking GitLab Shell ... GitLab Shell: ... GitLab Shell version >= 13.16.1 ? ... OK (13.16.1) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful Checking GitLab Shell ... Finished Checking Gitaly ... Gitaly: ... default ... OK Checking Gitaly ... Finished Checking Sidekiq ... Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1 Checking Sidekiq ... Finished Checking Incoming Email ... Incoming Email: ... Reply by email is disabled in config/gitlab.yml Checking Incoming Email ... Finished Checking LDAP ... LDAP: ... LDAP is disabled in config/gitlab.yml Checking LDAP ... Finished Checking GitLab App ... Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 2/1 ... yes 2/2 ... yes 2/3 ... yes 2/5 ... yes 2/7 ... yes 2/9 ... yes 2/10 ... yes 2/11 ... yes 5/12 ... yes 2/13 ... yes 2/14 ... yes 2/15 ... yes 2/16 ... yes 7/17 ... yes 2/19 ... yes 2/20 ... yes 2/22 ... yes 7/23 ... yes 2/24 ... yes 2/25 ... yes Redis version >= 4.0.0? ... yes Ruby version >= 2.7.2 ? ... yes (2.7.2) Git version >= 2.29.0 ? ... yes (2.29.0) Git user has default SSH configuration? ... yes Active users: ... 4 Is authorized keys file accessible? ... yes GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... yes Checking GitLab App ... Finished Checking GitLab subtasks ... Finished (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)