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

Application yaml files cannot be loaded when they exceed 3mb #34743

Closed
kirangodishala opened this issue Mar 24, 2023 · 5 comments
Closed

Application yaml files cannot be loaded when they exceed 3mb #34743

kirangodishala opened this issue Mar 24, 2023 · 5 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@kirangodishala
Copy link

I am from Spinnaker community and we are in the process of upgrading Spring and Springboot versions. But with the yaml file size limitation introduced in snakeyaml-1.32 we can't upgrade to Springboot 3.0.x as it uses snakeyaml-1.33 and we have many users with configuration files > 5MB size. The default file size limit of 3MB in snakeyaml can be overriden but Springboot uses the default LoaderOptions with no configurable value to override LoaderOptions.codePointLimit.

We are looking for a configurable option to set the yaml file size limit within Springboot.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 24, 2023
@wilkinsona
Copy link
Member

wilkinsona commented Mar 24, 2023

Have you considered splitting your 5MB+ configuration files up a bit? It would work around this limitation while also perhaps making them easier to read. Having split them up, you'd use spring.config.import to combine them at runtime.

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label Mar 24, 2023
@kirangodishala
Copy link
Author

@wilkinsona - Spinnaker uses yaml files containing cloud provider (kubernetes, google cloud, azure, aws etc) account info to load required details. All the accounts of a particular type(say kubernetes) are configured as an array under kubernetes.accounts and hence if you split them into different files, only the accounts from the file configured under spring.config.import gets loaded as the property names are same. I have tested using clouddriver-local.yml & additional-accounts.yml where I added spring.config.import=additional-accounts.yml under clouddriver-local.yml but only the accounts from additional-accounts.yml got loaded.
There are other challenges as well like the custom ways the yamls are built and integrated into the system by the users will be broken if the file is to be split.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Mar 24, 2023
@wilkinsona wilkinsona added for: team-meeting An issue we'd like to discuss as a team to make progress and removed status: feedback-provided Feedback has been provided labels Mar 27, 2023
@kirangodishala
Copy link
Author

@wilkinsona I would like to work on the PR. Can you give some pointers on how to make use of custom configuration in this scenario?

@scottfrederick
Copy link
Contributor

@kirangodishala The issue is currently tagged with team-meeting, which indicates that we'd like some time to discuss this issue before we make any decisions about what to do. We'll update the status again and add another comment after we've had time to discuss it.

@philwebb
Copy link
Member

philwebb commented May 8, 2023

I think we can increase our limits. The OriginTrackedYamlLoader is only used to load application.yml so I don't see a good reason to artificially restrict the size.

@philwebb philwebb added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged for: team-meeting An issue we'd like to discuss as a team to make progress labels May 8, 2023
@philwebb philwebb added this to the 3.0.x milestone May 8, 2023
@philwebb philwebb changed the title Non-configurable yaml file size limit with snakeyaml-1.33 Spring Boot 3 can no longer load yaml files over 3mb May 8, 2023
@philwebb philwebb changed the title Spring Boot 3 can no longer load yaml files over 3mb Application yaml files cannot be loaded when they exceed 3mb May 8, 2023
@mhalbritter mhalbritter self-assigned this May 9, 2023
@mhalbritter mhalbritter modified the milestones: 3.0.x, 3.0.7 May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

6 participants