Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bake: panic value is unknown #2960

Open
crazy-max opened this issue Feb 1, 2025 · 0 comments · May be fixed by #2965
Open

bake: panic value is unknown #2960

crazy-max opened this issue Feb 1, 2025 · 0 comments · May be fixed by #2965
Assignees
Labels
area/bake kind/bug Something isn't working
Milestone

Comments

@crazy-max
Copy link
Member

Made a typo in my definition and it panics:

variable "REPO_SLUG" {
  default = "foo/bar"
}

target "default" {
  cache-from = ["${REPO}:master"]
}
$ docker buildx bake --print
#1 [internal] load local bake definitions
panic: value is unknown

goroutine 1 [running]:
github.com/zclconf/go-cty/cty.Value.AsString({{{0x2c99178?, 0xc000012861?}}, {0x2430a80?, 0xc000355990?}})
        github.com/zclconf/[email protected]/cty/value_ops.go:1393 +0xf8
github.com/docker/buildx/util/buildflags.isEmpty(...)
        github.com/docker/buildx/util/buildflags/utils.go:53
github.com/docker/buildx/util/buildflags.(*CacheOptions).fromCtyValue(0xc00062c450, {{{0x2c989f0?, 0xc00062c3d8?}}, {0x22c96c0?, 0xc00062c3f0?}}, {0x0, 0x0, 0x0})
        github.com/docker/buildx/util/buildflags/cache_cty.go:29 +0x1b5
github.com/docker/buildx/util/buildflags.(*CacheOptions).FromCtyValue(0x41f5bb0?, {{{0x2c989f0?, 0xc00062c3d8?}}, {0x22c96c0?, 0xc00062c3f0?}}, {0x0?, 0x10?, 0x10?})
        github.com/docker/buildx/util/buildflags/cache_cty.go:17 +0x59
github.com/docker/buildx/bake/hclparser.capsuleValueCapsuleType.func1.1({{{0x2c989f0?, 0xc00062c3d8?}}, {0x22c96c0?, 0xc00062c3f0?}}, {0x0, 0x0, 0x0})
        github.com/docker/buildx/bake/hclparser/type_implied_ext.go:66 +0x111
github.com/zclconf/go-cty/cty/convert.conversionToCapsule.func1({{{0x2c989f0?, 0xc00062c3d8?}}, {0x22c96c0?, 0xc00062c3f0?}}, {0x0?, 0xc0004f3f80?, 0x10?})
        github.com/zclconf/[email protected]/cty/convert/conversion_capsule.go:14 +0x4a
github.com/zclconf/go-cty/cty/convert.getConversion.func1({{{0x2c989f0?, 0xc00062c3d8?}}, {0x22c96c0?, 0xc00062c3f0?}}, {0x0, 0x0, 0x0})
        github.com/zclconf/[email protected]/cty/convert/conversion.go:57 +0x2ae
github.com/zclconf/go-cty/cty/convert.GetConversionUnsafe.retConversion.func1({{{0x2c989f0?, 0xc00062c3d8?}}, {0x22c96c0?, 0xc00062c3f0?}})
        github.com/zclconf/[email protected]/cty/convert/conversion.go:203 +0x34
github.com/zclconf/go-cty/cty/convert.Convert({{{0x2c989f0?, 0xc00062c3d8?}}, {0x22c96c0?, 0xc00062c3f0?}}, {{0x2c98980?, 0xc00062b140?}})
        github.com/zclconf/[email protected]/cty/convert/public.go:51 +0x1fb
github.com/docker/buildx/bake/hclparser/gohcl.DecodeOptions.DecodeExpression({0x2a07b48?, 0x2a08bc8?}, {0x7fc9041bed18, 0xc0004f4820}, 0x2cca330?, {0x25f10c0, 0xc0006053f0})
        github.com/docker/buildx/bake/hclparser/gohcl/decode.go:295 +0x114
github.com/docker/buildx/bake/hclparser/gohcl.DecodeOptions.decodeBodyToStruct({0x2a07b48?, 0x2a08bc8?}, {0x2c98910, 0xc0004f3740}, 0xc00062c018, {0x28598e0?, 0xc000605340?, 0xc00062c018?})
        github.com/docker/buildx/bake/hclparser/gohcl/decode.go:138 +0xda5
github.com/docker/buildx/bake/hclparser/gohcl.DecodeOptions.decodeBodyToValue({0x2a07b48?, 0x2a08bc8?}, {0x2c98910, 0xc0004f3740}, 0xc00062c018, {0x28598e0?, 0xc000605340?, 0x508a8d?})
        github.com/docker/buildx/bake/hclparser/gohcl/decode.go:57 +0xee
github.com/docker/buildx/bake/hclparser/gohcl.DecodeOptions.DecodeBody({0x2a07b48?, 0x0?}, {0x2c98910, 0xc0004f3740}, 0xc00062c018, {0x25efec0?, 0xc000605340?})
        github.com/docker/buildx/bake/hclparser/gohcl/decode.go:30 +0x126
github.com/docker/buildx/bake/hclparser.decodeBody(...)
        github.com/docker/buildx/bake/hclparser/hclparser.go:993
github.com/docker/buildx/bake/hclparser.(*parser).resolveBlock(0xc0004d1880, 0xc000619ba0, 0x0)
        github.com/docker/buildx/bake/hclparser/hclparser.go:456 +0xb85
github.com/docker/buildx/bake/hclparser.Parse({0x2c988d8, 0xc000011968}, {0x2a07b40?, 0xc0004a3680?, 0x2a07b38?}, {0x2657f60, 0xc0004a36b0})
        github.com/docker/buildx/bake/hclparser/hclparser.go:814 +0x1ce7
github.com/docker/buildx/bake.ParseFiles({0xc0004a3650, 0x1, 0x46d31d?}, 0xc0004a3680)
        github.com/docker/buildx/bake/bake.go:347 +0xa5d
github.com/docker/buildx/bake.ReadTargets({0xc0004d1480?, 0x2c983b0?}, {0xc0004a3650?, 0x0?, 0x0?}, {0xc0003552e0, 0x1, 0x0?}, {0x0, 0x0, ...}, ...)
        github.com/docker/buildx/bake/bake.go:197 +0x46
github.com/docker/buildx/commands.runBake({_, _}, {_, _}, {_, _, _}, {{0x426f800, 0x0, 0x0}, ...}, ...)
        github.com/docker/buildx/commands/bake.go:216 +0x185e
github.com/docker/buildx/commands.bakeCmd.func1(0xc0005c0c08, {0xc0003b1350, 0x0, 0x1})
        github.com/docker/buildx/commands/bake.go:454 +0x2e5
github.com/docker/cli/cli-plugins/plugin.RunPlugin.func1.1.2(0xc0005c0c08, {0xc0003b1350, 0x0, 0x1})
        github.com/docker/[email protected]+incompatible/cli-plugins/plugin/plugin.go:64 +0x6c
github.com/spf13/cobra.(*Command).execute(0xc0005c0c08, {0xc00001bc10, 0x1, 0x1})
        github.com/spf13/[email protected]/command.go:985 +0xaaa
github.com/spf13/cobra.(*Command).ExecuteC(0xc000457b08)
        github.com/spf13/[email protected]/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/[email protected]/command.go:1041
github.com/docker/cli/cli-plugins/plugin.RunPlugin(0xc0002eb900, 0xc0005c0608, {{0x28a30e5, 0x5}, {0x28ad4f4, 0xb}, {0x2c6e770, 0x1a}, {0x0, 0x0}, ...})
        github.com/docker/[email protected]+incompatible/cli-plugins/plugin/plugin.go:79 +0x145
main.runPlugin(0xc0002eb900)
        github.com/docker/buildx/cmd/buildx/main.go:65 +0xe6
main.run(0xc0002eb900)
        github.com/docker/buildx/cmd/buildx/main.go:79 +0xe5
main.main()
        github.com/docker/buildx/cmd/buildx/main.go:89 +0x86
@crazy-max crazy-max added area/bake kind/bug Something isn't working labels Feb 1, 2025
@crazy-max crazy-max added this to the v0.20.2 milestone Feb 1, 2025
@jsternberg jsternberg linked a pull request Feb 3, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/bake kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants