terramate: [BUG][0.11.3] `panic: abspath "/opt/actions-runner/_work/a/b/c" does not start with root "/opt/actions-runner/_work/a/a"`

Describe the bug

After updating the version from 0.11.2 to 0.11.3 ,

terramate create --all-terragrunt --tags dev

command started to fail with the weird error:

panic: abspath "/opt/actions-runner/_work/a/b/c" does not start with root "/opt/actions-runner/_work/a/a"

goroutine 1 [running]:
github.com/terramate-io/terramate/project.PrjAbsPath({0xc000b0c2d0, 0x2d}, {0xc001aaf480, 0x39})
	/home/runner/work/terramate/terramate/project/project.go:126 +0x1b9
github.com/terramate-io/terramate/tg.ScanModules({0xc000b0c2d0, 0x2d}, {{0xc000178aed?, 0x3c?}}, 0x1)
	/home/runner/work/terramate/terramate/tg/tg_module.go:183 +0x2031
github.com/terramate-io/terramate/cmd/terramate/cli.(*cli).initTerragrunt(0xc000c9a000)
	/home/runner/work/terramate/terramate/cmd/terramate/cli/cli.go:1454 +0x73
github.com/terramate-io/terramate/cmd/terramate/cli.(*cli).scanCreate(0xc000c9a000)
	/home/runner/work/terramate/terramate/cmd/terramate/cli/cli.go:1447 +0x2c5
github.com/terramate-io/terramate/cmd/terramate/cli.(*cli).run(0xc000c9a000)
	/home/runner/work/terramate/terramate/cmd/terramate/cli/cli.go:706 +0x4f3
github.com/terramate-io/terramate/cmd/terramate/cli.Exec({0x19ac959, 0x6}, {0xc000142010, 0x4, 0x4}, {0x200a8a0, 0xc00012c040}, {0x200a8c0, 0xc00012c048}, {0x200a8c0, ...})
	/home/runner/work/terramate/terramate/cmd/terramate/cli/cli.go:388 +0xfc
main.main()
	/home/runner/work/terramate/terramate/cmd/terramate/main.go:20 +0x89

I’m wondering why the root is set to /opt/actions-runner/_work/a/a (The directory a is repeated)

Expected behavior

don’t fail.

Environment (please complete the following information):

Operating System
  Distribution: Ubuntu 22.04.5 LTS
  Architecture: x86_64

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Hi @i4ki, we are working on the same project at the moment as coworkers.

We are not using symlinks in the project. We are just using git sources to define our terragrunt stacks terraform source.

Are you using terramate -C <dir> … ?

No, we use terramate create --all-terragrunt

does it also happen when you run terramate create --all-terragrunt locally in your machine?

In the CI we are using ubuntu x86 24.04 and locally apple silicon m2

terramate --version
0.11.3

Yes, this is the error trace:


panic: abspath "/Users/myuser/reponame" does not start with root "/Users/myuser/reponame/"

goroutine 1 [running]:
github.com/terramate-io/terramate/project.PrjAbsPath({0x14000231280, 0x31}, {0x1400090adc0, 0x3d})
        /home/runner/work/terramate/terramate/project/project.go:126 +0x1d8
github.com/terramate-io/terramate/tg.ScanModules({0x14000231280, 0x31}, {{0x140002309b1?, 0x40?}}, 0x1)
        /home/runner/work/terramate/terramate/tg/tg_module.go:183 +0x19ec
github.com/terramate-io/terramate/cmd/terramate/cli.(*cli).initTerragrunt(0x14000c10400)
        /home/runner/work/terramate/terramate/cmd/terramate/cli/cli.go:1454 +0x60
github.com/terramate-io/terramate/cmd/terramate/cli.(*cli).scanCreate(0x14000c10400)
        /home/runner/work/terramate/terramate/cmd/terramate/cli/cli.go:1447 +0x2cc
github.com/terramate-io/terramate/cmd/terramate/cli.(*cli).run(0x14000c10400)
        /home/runner/work/terramate/terramate/cmd/terramate/cli/cli.go:706 +0x4dc
github.com/terramate-io/terramate/cmd/terramate/cli.Exec({0x103d9a003, 0x6}, {0x1400003a0d0, 0x2, 0x2}, {0x104869fa8, 0x1400007a008}, {0x104869fc8, 0x1400007a010}, {0x104869fc8, ...})
        /home/runner/work/terramate/terramate/cmd/terramate/cli/cli.go:388 +0xb0
main.main()
        /home/runner/work/terramate/terramate/cmd/terramate/main.go:20 +0x94

hey @LittleWat

can you check if this PR fixes the problem in your real repository? https://github.com/terramate-io/terramate/pull/1993

you can install this branch with:

go install github.com/terramate-io/terramate/cmd/terramate@i4k-fix-terragrunt-create-deps

Thanks for the help!