GitLab branch unable to access protected variables

Last modified date

Comments: 0

Problem

GitLab is throwing the error Unable to locate credentials when running a pipeline job and the variables are protected.

Solution

The most likely reason for this is that if the variables are protected then they can only be accessed by a protected branch or tag.

And if the branch is protected but the tag isn’t protected then GitLab will throw the error.

So ensure that the the branch and the tags are protected.

This can be done in:

Settings > Repository > Protected Branches / Protected Tags

To protect all tags by default, the wildcard * can be used:

References

https://docs.gitlab.com/ee/ci/variables/#create-a-custom-variable-in-the-ui

JakTech

Leave a Reply

Your email address will not be published. Required fields are marked *

Post comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.