Group Audit events page throwing 500 error when Unregister runner token audit event present
Summary
When there is an Unregister runner token
audit event present then the group audit events page is not getting loaded as it is encountering an error with the message Runner token missing
arising from https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/audit/ci_runner_token_author.rb#L17, which is happening because the runner_authentication_token
is not being added at https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/app/services/audit_events/runner_audit_event_service.rb#L27 as the author being passed to the method is not a string.
This was reported in https://gitlab.slack.com/archives/CN7C8029H/p1712859706693319 with zendesk ticket https://gitlab.zendesk.com/agent/tickets/519290 and kibana logs at https://log.gprd.gitlab.net/app/r/s/4guaW.
Steps to reproduce
Example Project
What is the current bug behavior?
Group audit events page is not loading.
What is the expected correct behavior?
Group audit events page should load.
Relevant logs and/or screenshots
https://log.gprd.gitlab.net/app/r/s/4guaW
Possible fixes
- For fixing the loading issue for now, we can remove the runtime error being thrown at https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/audit/ci_runner_token_author.rb#L17.
- For longterm fix, we need to fix the logic for storing the token in the audit event while unregistering a runner token at https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/app/services/audit_events/runner_audit_event_service.rb#L27.