Cloning private repo continues to fail (audit_event_streaming_git_operations flag enabled)
Summary
- Performing a git clone/pull/fetch operation on a private project is still failing for an undetermined reason when the
audit_event_streaming_git_operationsflag is enabled. - This was discovered during the flag rollout: https://gitlab.com/gitlab-org/gitlab/-/issues/357211
- It also caused a production issue: gitlab-com/gl-infra/production#7016 (closed)
- The flag was rolled-back until a fix could be put in place.
Steps to reproduce
- Enable the feature flag
audit_event_streaming_git_operationson 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_idof the newly created deploy token toNULLin thedeploy_tokenstable. - Clone the repository using
httpcredentials.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 listingWhat 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_repositoryusing the git CLI.
Relevant logs and/or screenshots
Example screenshot from a test performed on staging.gitlab.com
Proposed solution
- Implement proper attribution of audit events to deploy tokens, see Implement proper attribution to deploy token au... (!87042 - merged) for more details.
- Attempt feature flag rollout on GitLab.com again.
Edited by Dennis Tang
