-
-
Notifications
You must be signed in to change notification settings - Fork 924
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
org.yaml.snakeyaml.error.YAMLException: The incoming YAML document exceeds the limit: 3145728 code points. #7543
Comments
This is due to #7388 and the 3MB code point limit now honored in SnakeYaml Without looking at the specifics, suspect this might require ruby/psych#579 to workaround by setting |
Yeah, this looks right. Any way to set the limit before ruby/psych#579 is done? |
Apart from some hardcore runtime bytecode manipulation, I don't think so. Sadly the |
I have added some of these methods in ruby/psych#613. This is a unilateral exposure of these properties only in the JRuby version, so we should try to work with the maintainers of the C extension and see if we can have the same API for both. |
I've requested review for my changes in ruby/psych#613. I would also like to release psych 5.1 to incorporate the new SnakeYAML Engine in ruby/psych#612, so this is a good time to do it. |
* bump-gems-2023-01-31 * Sync with uap-core * Simplify tests matrix * Limit simplecov to a single test run * Lock jruby version for tests Ref jruby/jruby#7543 * Bump actions/checkout
Looks like ability to control this was merged in ruby/psych#613, released in Psych Also not sure if it needs some docs somewhere to show how to override them in normal use cases. |
Oops, yup, this one should have been resolved as of 9.4.1. |
There are no docs for the new features and no tests. Perhaps you could come up with some? I must admit I do not know exactly what YAML constructs the various settings apply to. |
The irony is that my/our use case of JRuby actually doesn't rely on YAML parsing, Psych or SnakeYAML at all - it's just that we use I wonder if @donv has something on the test side. Where do you suggest the docs would sit? Within Psych? Jruby itself somewhere? |
Hi! Documenting the usage here since I could not find it anywhere else yet. @parser = Psych::Parser.new
@parser.code_point_limit = 20_000_000 I have switched to JRuby 9.4.1.0 in development and it seems to work fine. |
@donv thanks for confirming! |
@chadlwilson Well that is a good question. There is no logic in rdoc to generate documentation from the Java extension, and any way we don't have the same feature in the C extension so putting it in the general psych docs would not work anyway. @hsbt @tenderlove How should we handle this? Maybe we can collaborate to get these same config options supported in the C extension? |
Environment Information
jruby 9.3.9.0 (2.6.8) 2022-10-24 537cd1f OpenJDK 64-Bit Server VM 17.0.5+8-LTS on 17.0.5+8-LTS +jit [x86_64-darwin]
Darwin 21.6.0 Darwin Kernel Version 21.6.0: Sun Nov 6 23:31:16 PST 2022; root:xnu-8020.240.14~1/RELEASE_X86_64 x86_64
Expected Behavior
Using Psych::Parser to parse a large yaml file succeeds.
Actual Behavior
Using JRuby 9.3.9.0 parsing a large yaml file results in an exception:
Reverting to jruby-9.3.8.0 works.
The text was updated successfully, but these errors were encountered: