grafana/loki

Terraform init can not download module s3

Closed this issue · 7 comments

Describe the bug
When i execute terraform init, i have this error:
│ Error: Failed to download module

│ on loki.tf line 5:
│ 5: module "loki-s3" {

│ Could not download module "loki-s3" (loki.tf:5) source code from
│ "git::https://github.com/grafana/loki.git": error downloading
│ 'https://github.com/grafana/loki.git': /usr/bin/git exited with 128: fatal:
│ No url found for submodule path '_shared-workflows-dockerhub-login' in
│ .gitmodules

To Reproduce
Steps to reproduce the behavior:

  1. Create a terraform project with module s3: source = "github.com/grafana/loki/production/terraform/modules/s3"
  2. Execute terraform init

Expected behavior
Download module correctly

Environment:

  • Deployment tool: Github action

Screenshots, Promtail config, or terminal output
│ Error: Failed to download module

│ on loki.tf line 5:
│ 5: module "loki-s3" {

│ Could not download module "loki-s3" (loki.tf:5) source code from
│ "git::https://github.com/grafana/loki.git": error downloading
│ 'https://github.com/grafana/loki.git': /usr/bin/git exited with 128: fatal:
│ No url found for submodule path '_shared-workflows-dockerhub-login' in
│ .gitmodules

If i clone the repo and execute
git submodule status
i get the same error:
fatal: no submodule mapping found in .gitmodules for path '_shared-workflows-dockerhub-login'

Hi @trevorwhitney ,

I have seen this PR from you last week that could be related with the issue, could not be?

Regards

yes, that accidentally was added as a submodule as a result of running a workflow locally using act, but that change was reverted. Is this still happening on main?

Yes, i think so. I have just removed the repository from my local path and to clone it again, and when i execute the command git submodule status, i am still receiving the same error.
I think the command
"git rm --cached _shared-workflows-dockerhub-login"
solve the problem. It will remove old path and if you execute the command "git submodule status" again, you would receive the right output "14fe597271d6efc7d77461798f22a6af068300d2 operator/website/themes/doks (v0.2.3-49-g14fe597)"
A new commit and PR will be necessary to solve it in main.

would you mind submitting that PR? I thought the revert PR would do it, so I'm clearly misunderstanding something.

or maybe it's as simple as this? #14966

fixed in #14883