Variables key <key> has already been taken
ZD (internal only): https://gitlab.zendesk.com/agent/tickets/103058
bug:
- CI/CD variables cannot be saved with the the same name to different environment. Error
Variables key <key> has already been taken
whenSave variables
button clicked multiple times. - Some times (actually quite often) when we try to edit these variables in the Gitlab UI, we get a validation error saying
Variables key <key> has already been taken
.
Description:
The variables that show up in the error message can differ, sometimes it's all our duplicate variables, sometimes it's just a couple (or even one). I'm able to reproduce this in both Chrome and Firefox locally (latest versions, running on Arch Linux) by just opening the CI/CD variable settings and hitting "Save variables" 2-3 times without changing anything. More often than not, the first 1-2 requests succeed, while the last one fails with the above validation error.
It often works for a colleague of mine when I ask him to perform the changes I need done for me. It somehow seems to be tied to user session or a specific browser/OS combination.
Version affected:
We're running on Gitlab 11.2.3-ee right now, but this issue has been present at least since 11.0 shipped - possibly also before.
Steps to reproduce:
- Go to CI/CD varaibles of the project.
- Create new environment.
- Add Variable to
all environemnts
. - Add a Variable to the newly created environment with the same name.
- Click
Save variables
button multiple times.