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

Package Verification Bug bufio.Scanner: token too long #1397

Closed
kensipe opened this issue Mar 6, 2020 · 7 comments · Fixed by #1400
Closed

Package Verification Bug bufio.Scanner: token too long #1397

kensipe opened this issue Mar 6, 2020 · 7 comments · Fixed by #1400

Comments

@kensipe
Copy link
Member

kensipe commented Mar 6, 2020

With the release of v0.11.0-rc1 a failure to create a package was detected resulting in a token too long

 go run cmd/kubectl-kudo/main.go package verify ../operators/repository/spark/operator/
Errors                                                             
reading from document decoder failed: bufio.Scanner: token too long
Error: found 1 package verification errors
exit status 255

It was determined that #1376 caused this break.

@kensipe kensipe added this to the 0.11.0 milestone Mar 6, 2020
@porridge
Copy link
Member

porridge commented Mar 9, 2020

This also highlights the fact that our error messages have a lot of room for improvement - many of them lack enough context. In this case at least the path to the file being read is needed.

@nfnt
Copy link
Member

nfnt commented Mar 9, 2020

This is YamlToObject in pkg/engine/renderer. docDecoder.Read is returning that error. Checking if this is related to #1376. The input YAML is indeed very long. Unfortunately, installing the spark operator wasn't tested as part of KUDO tests.

@nfnt
Copy link
Member

nfnt commented Mar 9, 2020

@nfnt
Copy link
Member

nfnt commented Mar 9, 2020

It's an error returned by yaml.NewDocumentDecoder. The input buffer is too large.

@nfnt
Copy link
Member

nfnt commented Mar 9, 2020

#1376 is unrelated. We should go back to splitting input YAML ourselves, as the helpers in apimachinery don't seem to handle large input strings. cc @porridge

@nfnt
Copy link
Member

nfnt commented Mar 9, 2020

By default, a bufio.Scanner uses MaxScanTokenSize = 64 * 1024 (https://golang.org/pkg/bufio/#pkg-constants). Our input is much larger than that.

@kensipe
Copy link
Member Author

kensipe commented Mar 9, 2020

Added bug report against api-machinery ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants