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

Panic occurs when outputs in YAML format #57

Closed
Mic-U opened this issue Oct 27, 2021 · 1 comment · Fixed by #58
Closed

Panic occurs when outputs in YAML format #57

Mic-U opened this issue Oct 27, 2021 · 1 comment · Fixed by #58

Comments

@Mic-U
Copy link
Owner

Mic-U commented Oct 27, 2021

$ ecsher version
ecsher version
Version: 0.11.0
Revision: f7b935a

$ ecsher describe svc -n alb-service-EcsService-TauaveQzrnFE
panic: reflect.Value.Interface: cannot return value obtained from unexported field or method [recovered]
        panic: reflect.Value.Interface: cannot return value obtained from unexported field or method

goroutine 1 [running]:
gopkg.in/yaml%2ev2.handleErr(0xc00019fa70)
        /home/runner/go/pkg/mod/gopkg.in/[email protected]/yaml.go:249 +0x6d
panic({0x161f440, 0x17c8450})
        /opt/hostedtoolcache/go/1.17.0/x64/src/runtime/panic.go:1038 +0x215
reflect.valueInterface({0x166fd20, 0xc000366cd0, 0x0}, 0x40)
        /opt/hostedtoolcache/go/1.17.0/x64/src/reflect/value.go:1362 +0xd9
reflect.Value.Interface(...)
        /opt/hostedtoolcache/go/1.17.0/x64/src/reflect/value.go:1351
gopkg.in/yaml%2ev2.(*encoder).marshal(0xc0003cc048, {0x0, 0x0}, {0x166fd20, 0xc000366cd0, 0x4})
        /home/runner/go/pkg/mod/gopkg.in/[email protected]/encode.go:103 +0xb7
gopkg.in/yaml%2ev2.(*encoder).structv.func1()
        /home/runner/go/pkg/mod/gopkg.in/[email protected]/encode.go:226 +0x468
gopkg.in/yaml%2ev2.(*encoder).mappingv(0xc0000eb340, {0x0, 0xc000366cc0}, 0xc00019efc0)
        /home/runner/go/pkg/mod/gopkg.in/[email protected]/encode.go:256 +0x143
gopkg.in/yaml%2ev2.(*encoder).structv(0xc0000eb340, {0x0, 0x0}, {0x16b48c0, 0xc000366cc0, 0x10101})
        /home/runner/go/pkg/mod/gopkg.in/[email protected]/encode.go:213 +0xce
gopkg.in/yaml%2ev2.(*encoder).marshal(0x1613c60, {0x0, 0x0}, {0x16b48c0, 0xc000366cc0, 0x8})
        /home/runner/go/pkg/mod/gopkg.in/[email protected]/encode.go:160 +0x9a5
gopkg.in/yaml%2ev2.(*encoder).slicev(0xc0000eb340, {0x0, 0xc000366d50}, {0x1613c60, 0xc00013ed00, 0x12})
        /home/runner/go/pkg/mod/gopkg.in/[email protected]/encode.go:272 +0x1bf
gopkg.in/yaml%2ev2.(*encoder).marshal(0xc0000e7f08, {0x0, 0x0}, {0x1613c60, 0xc00013ed00, 0x1f})
        /home/runner/go/pkg/mod/gopkg.in/[email protected]/encode.go:166 +0x905
gopkg.in/yaml%2ev2.(*encoder).structv.func1()
        /home/runner/go/pkg/mod/gopkg.in/[email protected]/encode.go:226 +0x468
gopkg.in/yaml%2ev2.(*encoder).mappingv(0xc0000eb340, {0x0, 0xc00013ed00}, 0xc00019f5c0)
        /home/runner/go/pkg/mod/gopkg.in/[email protected]/encode.go:256 +0x143
gopkg.in/yaml%2ev2.(*encoder).structv(0xc0000eb340, {0x0, 0x0}, {0x16e12a0, 0xc00013ed00, 0x8})
        /home/runner/go/pkg/mod/gopkg.in/[email protected]/encode.go:213 +0xce
gopkg.in/yaml%2ev2.(*encoder).marshal(0x163e700, {0x0, 0x0}, {0x16e12a0, 0xc00013ed00, 0x0})
        /home/runner/go/pkg/mod/gopkg.in/[email protected]/encode.go:160 +0x9a5
gopkg.in/yaml%2ev2.(*encoder).marshal(0xc0000eb340, {0x0, 0x0}, {0x163e700, 0xc00013ed00, 0x0})
        /home/runner/go/pkg/mod/gopkg.in/[email protected]/encode.go:154 +0x7f9
gopkg.in/yaml%2ev2.(*encoder).marshalDoc(0xc0000eb340, {0x0, 0x0}, {0x163e700, 0xc00013ed00, 0x17d0cc0})
        /home/runner/go/pkg/mod/gopkg.in/[email protected]/encode.go:93 +0x125
gopkg.in/yaml%2ev2.Marshal({0x163e700, 0xc00013ed00})
        /home/runner/go/pkg/mod/gopkg.in/[email protected]/yaml.go:203 +0x37e
github.com/Mic-U/ecsher/cmd.describeService()
        /home/runner/work/ecsher/ecsher/cmd/describe.go:116 +0x1fa
github.com/Mic-U/ecsher/cmd.glob..func3(0x1ba70e0, {0xc000150c30, 0x3, 0x3})
        /home/runner/work/ecsher/ecsher/cmd/describe.go:36 +0x69
github.com/spf13/cobra.(*Command).execute(0x1ba70e0, {0xc000150c00, 0x3, 0x3})
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:860 +0x5f8
github.com/spf13/cobra.(*Command).ExecuteC(0x1ba7ae0)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:902
github.com/Mic-U/ecsher/cmd.Execute()
        /home/runner/work/ecsher/ecsher/cmd/root.go:45 +0x25
main.main()
        /home/runner/work/ecsher/ecsher/main.go:21 +0x17
@Mic-U
Copy link
Owner Author

Mic-U commented Oct 27, 2021

It seems that relates to the following issue.
go-yaml/yaml#463

@Mic-U Mic-U changed the title Panic occurs when describe service/task Panic occurs when outputs in YAML format Oct 27, 2021
Mic-U added a commit that referenced this issue Oct 29, 2021
@Mic-U Mic-U linked a pull request Oct 29, 2021 that will close this issue
@Mic-U Mic-U closed this as completed in #58 Oct 30, 2021
Mic-U added a commit that referenced this issue Oct 30, 2021
* fix #57

* Add error check
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

Successfully merging a pull request may close this issue.

1 participant