Cloning private repo continues to fail (audit_event_streaming_git_operations flag enabled)

Summary

Steps to reproduce

  • Enable the feature flag audit_event_streaming_git_operations on the instance in question.
  • Create a private project on a group with an Ultimate license.
  • Create a deploy token, with read_repository, scope for the project. (Settings -> Repository -> Deploy tokens)
  • Set the creator_id of the newly created deploy token to NULL in the deploy_tokens table.
  • Clone the repository using http credentials. git clone https://staging.gitlab.com/compliance-tanuki/test-violations.git
  • Use the deploy token user/password as the credentials.
  • Expect to see an error like this:
Username for 'https://staging.gitlab.com': gitlab+deploy-token-33250
Password for 'https://gitlab+deploy-token-33250@staging.gitlab.com':
error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500
fatal: expected flush after ref listing

What is the current bug behavior?

  • 500 error and unable to clone/pull/fetch when the flag is enabled and using a deploy token as a form of authentication.

What is the expected correct behavior?

  • No 500 error and the ability to use deploy tokens to read_repository using the git CLI.

Relevant logs and/or screenshots

Example screenshot from a test performed on staging.gitlab.com

Screenshot_2022-04-14_at_10.45.28

Proposed solution

Edited by Dennis Tang