Cannot push tags to gitlab from gitlab-ci

we are getting 500 errors on pushing tags from gitlab-ci

$ git push origin HEAD:$CI_COMMIT_REF_NAME --tags
error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly

2 Likes

Are you using gitlab.com or a self-hosted gitlab?

I am using gitlab.com

$CI_JOB_TOKEN that is used inside gitlab-ci pipelines doesn’t have write permissions.
There’s a request for adding this: https://gitlab.com/gitlab-org/gitlab/-/issues/35067

The path would be creating a deploy token with write permissions and adding this to CI environment variables so the agent could use this to write tags.