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

bug: when running logging example, panic: inconsistent map element types (cty.Bool then cty.String) #46

Open
mcalhoun opened this issue Jan 6, 2021 · 0 comments

Comments

@mcalhoun
Copy link

mcalhoun commented Jan 6, 2021

When running the logging example, I get the following panic:

panic: inconsistent map element types (cty.Bool then cty.String)

goroutine 1 [running]:
github.com/zclconf/go-cty/cty.MapVal(0xc000deff60, 0xc000deff60, 0xc000c10e26, 0x7, 0xc000df0098)
	/home/runner/go/pkg/mod/github.com/zclconf/[email protected]/cty/value_init.go:207 +0x4b8
github.com/mumoshu/variant2/pkg/app.goToCty(0x2fa6680, 0xc000eb0ae0, 0x19, 0x0, 0x0, 0x0, 0xc000df03a8, 0x19)
	/home/runner/work/variant2/variant2/pkg/app/go_to_cty.go:28 +0x6fb
github.com/mumoshu/variant2/pkg/app.(*RunEvent).toCty(0xc000e9aea0, 0xc000df0458, 0x335055d, 0x4, 0xc000df0530)
	/home/runner/work/variant2/variant2/pkg/app/log.go:54 +0x31a
github.com/mumoshu/variant2/pkg/app.Event.toCty(0x334f726, 0x3, 0xbff5af0eda35bb68, 0x2863b98, 0x4a5d780, 0xc000e9aea0, 0x0, 0xc000df0750, 0x8, 0xc000df0710, ...)
	/home/runner/work/variant2/variant2/pkg/app/log.go:38 +0x393
github.com/mumoshu/variant2/pkg/app.(*App).newLogCollector.func1(0x334f726, 0x3, 0xbff5af0eda35bb68, 0x2863b98, 0x4a5d780, 0xc000e9aea0, 0x0, 0xc000e15a78, 0xc000eb0390, 0xc000e15ab8, ...)
	/home/runner/work/variant2/variant2/pkg/app/app_log.go:18 +0x1e5
github.com/mumoshu/variant2/pkg/app.(*LogCollector).Collect(0xc000e925c0, 0x334f726, 0x3, 0xbff5af0eda35bb68, 0x2863b98, 0x4a5d780, 0xc000e9aea0, 0x0, 0xc000df0ae8, 0x100d830, ...)
	/home/runner/work/variant2/variant2/pkg/app/log.go:197 +0x65
github.com/mumoshu/variant2/pkg/app.(*EventLogger).append(0xc00080fd80, 0x334f726, 0x3, 0xbff5af0eda35bb68, 0x2863b98, 0x4a5d780, 0xc000e9aea0, 0x0, 0x0, 0x0)
	/home/runner/work/variant2/variant2/pkg/app/log.go:132 +0x1ee
github.com/mumoshu/variant2/pkg/app.(*EventLogger).LogRun(0xc00080fd80, 0xc000c10e1c, 0x4, 0xc000eb0ae0, 0xc000eb0a80, 0xc000eb0ae0)
	/home/runner/work/variant2/variant2/pkg/app/log.go:110 +0x105
github.com/mumoshu/variant2/pkg/app.(*App).run(0xc0007afa40, 0xc000e9ab00, 0xc00080fd80, 0xc000c10e1c, 0x4, 0xc000eb0ae0, 0xc000da6c01, 0x0, 0x40, 0x2ebda60)
	/home/runner/work/variant2/variant2/pkg/app/app.go:68 +0x35c
github.com/mumoshu/variant2/pkg/app.(*App).dispatchRunJob(0xc0007afa40, 0xc00080fd80, 0xc000e9ab00, 0xc000e9ae00, 0x0, 0x8000101, 0x0, 0xffffffffffffffff, 0x21c10da)
	/home/runner/work/variant2/variant2/pkg/app/app.go:874 +0xc8
github.com/mumoshu/variant2/pkg/app.(*App).runJobAndUpdateContext(0xc0007afa40, 0xc00080fd80, 0xc000e9ab00, 0xc000e9ae00, 0x0, 0x394b780, 0xc000e5f850, 0x1, 0x0, 0x0, ...)
	/home/runner/work/variant2/variant2/pkg/app/app.go:961 +0xaa
github.com/mumoshu/variant2/pkg/app.(*App).runJobInBody(0xc0007afa40, 0xc00080fd80, 0xc000e9ab00, 0x397f9c0, 0xc000cbd600, 0x1, 0x0, 0x0, 0x0, 0x0)
	/home/runner/work/variant2/variant2/pkg/app/run.go:64 +0x355
github.com/mumoshu/variant2/pkg/app.(*App).execJob(0xc0007afa40, 0xc00080fd80, 0xc000c10e0c, 0x4, 0x0, 0x3980940, 0xc000cd4600, 0x0, 0x0, 0x0, ...)
	/home/runner/work/variant2/variant2/pkg/app/app.go:494 +0x82a
github.com/mumoshu/variant2/pkg/app.(*App).Job.func1(0x0, 0x0, 0x0)
	/home/runner/work/variant2/variant2/pkg/app/app.go:230 +0xbd7
github.com/mumoshu/variant2/pkg/app.(*App).Run(0xc0007afa40, 0xc000c10e0c, 0x4, 0xc000e96ed0, 0xc000e96f00, 0xc000df1b38, 0x1, 0x1, 0x0, 0x0, ...)
	/home/runner/work/variant2/variant2/pkg/app/app.go:58 +0xaa
github.com/mumoshu/variant2.(*Runner).Cobra.func1(0xc000e95900, 0x4a8f778, 0x0, 0x0, 0x0, 0x0)
	/home/runner/work/variant2/variant2/variant.go:634 +0x114
github.com/spf13/cobra.(*Command).execute(0xc000e95900, 0x4a8f778, 0x0, 0x0, 0xc000e95900, 0x4a8f778)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:826 +0x47c
github.com/spf13/cobra.(*Command).ExecuteC(0xc000e9ca00, 0x39302c0, 0xc000198010, 0x39302c0)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:914 +0x30b
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:864
github.com/mumoshu/variant2.(*Runner).Run(0xc000e54140, 0xc00018a0a0, 0x2, 0x2, 0xc000df1ea8, 0x1, 0x1, 0x0, 0x0)
	/home/runner/work/variant2/variant2/variant.go:765 +0x2d4
github.com/mumoshu/variant2.RunMain(0xc00018a090, 0x3, 0x3, 0x34532c0, 0x34532c8, 0x0, 0x0, 0x0, 0x48fd4e0, 0xc000096778)
	/home/runner/work/variant2/variant2/main.go:39 +0x31b
main.main()
	/home/runner/work/variant2/variant2/pkg/cmd/main.go:11 +0xbd

This seems to be related to the exec being in another job. If I move the exec to the test job, then the panic does not occur (below).

job "test" {
  // run "echo" {
  //   message = "foo"
  // }

  exec {
    command = "echo"
    args = ["foo"]
  }
~~~~snip~~~~~
@mcalhoun mcalhoun changed the title bug: panic when running logging example bug: when running logging example, panic: inconsistent map element types (cty.Bool then cty.String) Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant