Cannot create a deploy token without an expiration date in GitLab UI

When trying to create a deploy token for my group (within Settings → Repository → Deploy tokens), I can’t seem to create a token without expiration date. Although the ‘Expiration date’ field is marked as optional, it is prefilled with the current date and there seems to be no way to remove this date. Any token created will actually use the prefilled value and expire within a day.

Setting an expiration date in the far future works, but seems like an ugly workaround.

Note: tried using multiple browsers.

Looks like a bug on Gitlab.com - on my own Gitlab installation the date isn’t completed. You may wish to open an issue here for Gitlab to fix it, or perhaps explain why they don’t allow the expiry: Issues · GitLab.org / GitLab · GitLab

I’ve checked the Gitlab documentation and nothing appears there to say that Gitlab.com works differently, so I can only assume it’s a bug.

1 Like

I’m seeing this in one of my projects, too, the expiration date is marked as today’s date and can’t be deleted (it just comes back). However, upon testing, the deploy token w/ today’s date in the expiration, actually doesn’t expire:

Actually, I missed that you were creating a group deploy token. In that case, it might related to this bug that was reported yesterday :thinking: Cannot create a deploy token on repository : "Scopes can't be blank" (#378244) · Issues · GitLab.org / GitLab · GitLab

Yeah I figured that as well when looking through the issues; already mentioned this in a comment on there. Hopefully a fix can be made soon. Thanks for your time checking this!

1 Like

Looks like it was a bug from a recent feature flag. One of our Backend Engineers looked into this and posted on the issue:

Confirmed that the tokens can be generated after the ajax_new_deploy_token feature flag disablement… I’ve disabled the feature flag, so you should be able to create a deploy token again. Please let us know if you still encounter this issue. Thanks.

Thanks for flagging this in the forum @jnoordsij!