-
Notifications
You must be signed in to change notification settings - Fork 45
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: resolveTable item not yet handled: N (with ) #23
Comments
I have narrowed it down: this has nothing to do with the size of the file. The error occurs when the last yaml document in file is empty. Here's a minimal example:
first:
file: without --- at top
---
second:
file: which is actually the last one
next: there's nothing after the last delimiter
--- Result: $ yaml2json < simple.yaml
{"first":{"file":"without --- at top"}}
{"second":{"file":"which is actually the last one","next":"there's nothing after the last delimiter"}}
panic: resolveTable item not yet handled: N (with ) [recovered]
panic: resolveTable item not yet handled: N (with )
goroutine 1 [running]:
github.com/bronze1man/yaml2json/vendor/gopkg.in/yaml%2ev2.handleErr(0xc000079cc8)
/Users/a/work/yaml2json/src/github.com/bronze1man/yaml2json/vendor/gopkg.in/yaml.v2/yaml.go:249 +0x9a
panic(0x509cc0, 0xc00007c5f0)
/usr/local/go/src/runtime/panic.go:513 +0x1b9
github.com/bronze1man/yaml2json/vendor/gopkg.in/yaml%2ev2.resolve(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/a/work/yaml2json/src/github.com/bronze1man/yaml2json/vendor/gopkg.in/yaml.v2/resolve.go:198 +0xe40
github.com/bronze1man/yaml2json/vendor/gopkg.in/yaml%2ev2.(*decoder).scalar(0xc0000b6240, 0xc0000b5880, 0x511a60, 0xc00007c5e0, 0x194, 0x511a60)
/Users/a/work/yaml2json/src/github.com/bronze1man/yaml2json/vendor/gopkg.in/yaml.v2/decode.go:376 +0x92
github.com/bronze1man/yaml2json/vendor/gopkg.in/yaml%2ev2.(*decoder).unmarshal(0xc0000b6240, 0xc0000b5880, 0x511a60, 0xc00007c5e0, 0x194, 0x1)
/Users/a/work/yaml2json/src/github.com/bronze1man/yaml2json/vendor/gopkg.in/yaml.v2/decode.go:330 +0xd6
github.com/bronze1man/yaml2json/vendor/gopkg.in/yaml%2ev2.(*decoder).document(0xc0000b6240, 0xc0000b5810, 0x511a60, 0xc00007c5e0, 0x194, 0xc000079c30)
/Users/a/work/yaml2json/src/github.com/bronze1man/yaml2json/vendor/gopkg.in/yaml.v2/decode.go:344 +0x7a
github.com/bronze1man/yaml2json/vendor/gopkg.in/yaml%2ev2.(*decoder).unmarshal(0xc0000b6240, 0xc0000b5810, 0x511a60, 0xc00007c5e0, 0x194, 0x194)
/Users/a/work/yaml2json/src/github.com/bronze1man/yaml2json/vendor/gopkg.in/yaml.v2/decode.go:320 +0x1d3
github.com/bronze1man/yaml2json/vendor/gopkg.in/yaml%2ev2.(*Decoder).Decode(0xc000079d20, 0x503820, 0xc00007c5e0, 0x0, 0x0)
/Users/a/work/yaml2json/src/github.com/bronze1man/yaml2json/vendor/gopkg.in/yaml.v2/yaml.go:130 +0x1da
github.com/bronze1man/yaml2json/y2jLib.TranslateStream(0x554fa0, 0xc00008c000, 0x7f0acb96b000, 0xc00008c008, 0xc00008c008, 0x0)
/Users/a/work/yaml2json/src/github.com/bronze1man/yaml2json/y2jLib/lib.go:16 +0x1fb
main.main()
src/github.com/bronze1man/yaml2json/main.go:19 +0xa9 |
I've been able to confirm this issue with a similar reproduction recipe - but in this case, the following file is enough to cause the same panic on the latest release:
This can even be further simplified - any object that has a null value seems to cause the panic, such as a file containing only
I was able to track this down to a regression between tags 1.2 and 1.3. I don't have a build environment to see if the latest un-released commits have the same issue, though. |
This bug has already been fixed in v1.3.2 .
|
Hi @bronze1man We use this library and face the same issue. We see there is a fix in v1.3.2 but there is no official release with a binary. Are you planning to release this version? Thank you! |
@martinrangelov96 ok, I release with a binary |
@bronze1man thanks for the fast response and release! |
When?
Converting a large input comprising multiple documents divided with
---
. No issues with the same input when usingyq
for example.Source of the original file (kubernetes crds):
https://doc.crds.dev/raw/github.com/crossplane/provider-aws@v0.23.0
What happened?
The text was updated successfully, but these errors were encountered: