[SPIGOT-7161] SnakeYaml 1.32 changed the default file size limit to 3mb Created: 25/Sep/22 Updated: 25/Dec/24 Resolved: 09/Oct/22 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | blablubbabc | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 1 |
Labels: | SnakeYaml, config |
Version: | This server is running CraftBukkit version dev-Spigot-4aa5ead-c2c3908 (MC: 1.19.2) (Implementing API version 1.19.2-R0.1-SNAPSHOT) |
Guidelines Read: | Yes |
Description |
With the upgrade to Snakeyaml 1.32, there is now a default size limit of ~3mb: https://bitbucket.org/snakeyaml/snakeyaml/commits/440d98e2ebd586aafd9034fc74a2a47c656eb0ce There are some plugins that use Bukkit's configuration API for storing plugin data that can exceed this new default limit. It might make sense to increase or even remove the default limit inside Bukkit ( Error: org.bukkit.configuration.InvalidConfigurationException: org.yaml.snakeyaml.error.YAMLException: The incoming YAML document exceeds the limit: 3145728 code points. Other alternatives could be to:
But I think increasing the default limit will probably suffice. |
Comments |
Comment by BloodEko [ 05/Nov/22 ] |
I totally agree on md_5 here. A limit just makes things more complex for little to no benefit. |
Comment by md_5 [ 09/Oct/22 ] |
Same as with the max aliases for collections ( |
Comment by Parker Hawke [ 02/Oct/22 ] |
> I believe it would be best to expose a method which can change this limit to plugins, but importantly, not raise the default. My opinion is that there are far better solutions for data storage than using YAML, especially for files over 3MB, be it a database, 'minified' JSON flat-file, and so on. By raising the default, it doesn't discourage plugin developers from exploring an alternative. I agree with this point and plugins should seriously be discouraged from using YAML as a means of storage. There are, however, some plugins that do make use of very large configuration files for good reason. Things such as MythicMobs or DeluxeMenus need access to extremely large config files. The reason those plugins are as popular as they are is because their extensive configurability makes the plugin rather flexible. I think if we don't expose a way to increase the limit (maybe via MemoryConfigurationOptions), we're unnecessarily handicapping thoroughly configurable plugins. |
Comment by blablubbabc [ 02/Oct/22 ] |
> Are you sure there was a limit at all? You are correct, the limit as a whole is a recent addition: https://bitbucket.org/snakeyaml/snakeyaml/commits/72dfa9f1074abe2b8a6c8776bee4476b0aed02e3 |
Comment by md_5 [ 01/Oct/22 ] |
> (the previous limit was 100mb). Are you sure there was a limit at all? Can you provide a code reference. The commit you linked (which I think was not in megabytes anyway) wasn't in the prior release, it looks to be a new addition. See, eg, https://bitbucket.org/snakeyaml/snakeyaml/src/snakeyaml-1.31/src/main/java/org/yaml/snakeyaml/LoaderOptions.java |
Comment by lokka30 [ 30/Sep/22 ] |
I believe it would be best to expose a method which can change this limit to plugins, but importantly, not raise the default. My opinion is that there are far better solutions for data storage than using YAML, especially for files over 3MB, be it a database, 'minified' JSON flat-file, and so on. By raising the default, it doesn't discourage plugin developers from exploring an alternative. |
Comment by Bjarne Koll [ 26/Sep/22 ] |
If this is to be implemented, snakeyml will most likely have to be bumped to 1.33 as the current usage of it does not properly forward the yamlLoaderOptions of the yaml instance. See: https://github.com/PaperMC/Paper/blob/master/patches/api/0397-Expose-codepoint-limit-in-YamlConfigOptions-and-incr.patch |