Gitlab Terraform remote state auth failure on groups with periods in the path
Summary
When using the Terraform.gitlab-ci.yml
(or Terraform.latest.gitlab-ci.yml
) template on group with a period (.
) in the name, jobs fail with the following error:
Error refreshing state: HTTP remote state endpoint requires auth
Steps to reproduce
- Create an organization with a period (
.
) in the path - Create a project that uses the
Terraform.gitlab-ci.yml
(orTerraform.latest.gitlab-ci.yml
) template - Create a terraform configuration that uses the
http
backend - Run the pipeline against the
main
branch - Observe the failure during the
deploy
phase - Rename the project to the same name but without the period in the name
- Run the pipeline against the
main
branch - Observe the pipeline passing
Example Project
- Failing pipeline against
misfit.dev
group: https://gitlab.com/misfit.dev/devops/bootstrap/-/pipelines/393161676 - Passing pipeline after renaming to
misfitdev
: https://gitlab.com/misfit.dev/devops/bootstrap/-/pipelines/393170185 - Failing pipeline after changing name back to
misfit.dev
: https://gitlab.com/misfit.dev/devops/bootstrap/-/pipelines/393173336
What is the current bug behavior?
Jobs produce and auth failure when communicating with HTTP back end.
What is the expected correct behavior?
Jobs should pass.
Relevant logs and/or screenshots
See links.
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
N/A
Possible fixes
I haven't dug in to find the code that is causing the problem but url encoding seems to have solved it for a similar issue: #219294 (comment 441290781)
Since the group name is not encoded in the HTTP remote source path, I don't see an obvious issue in the logs.