Error: RPC failed; HTTP 500 curl 22

git push --tags $CI_REPOSITORY_URL HEAD:$CI_COMMIT_REF_NAME

The requested URL returned error: 500 Internal Server Error
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly

I have a very similar issue that started about 2 hours ago. We’re using ssh instead of http, so the error is just slightly different. It happens anytime you push commits + tags together, either using --tags or --follow-tags. Here’s the output error that I see:

git push origin HEAD:master --follow-tags
Warning: Permanently added ‘gitlab.com,172.65.251.78’ (ECDSA) to the list of known hosts.
Counting objects: 4, done.
Delta compression using up to 16 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 440 bytes | 440.00 KiB/s, done.
Total 4 (delta 1), reused 0 (delta 0)
error executing git hookerror executing git hookfatal: ref updates aborted by hook
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly

I see the question is tagged as ci and runner. while we also found the issue on our CI server, I can replicate it locally from the command line.