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

Quarkus throws an IllegalArgumentException on startup if a yaml file is too large #42070

Closed
krusc84 opened this issue Jul 23, 2024 · 5 comments · Fixed by #42227
Closed

Quarkus throws an IllegalArgumentException on startup if a yaml file is too large #42070

krusc84 opened this issue Jul 23, 2024 · 5 comments · Fixed by #42227
Assignees
Labels
area/config env/windows Impacts Windows machines kind/bug Something isn't working
Milestone

Comments

@krusc84
Copy link

krusc84 commented Jul 23, 2024

Describe the bug

With Quarkus I use a ConfigMapping interface that reads its data from a Yaml file. The Yaml file contains a list with over 2000 entries.

When I start the application I get the following error:
[error]: Build step io.quarkus.deployment.steps.ConfigGenerationBuildStep#generateBuilders threw an exception: java.lang.RuntimeException: java.lang.IllegalArgumentException: UTF8 string too large

Expected behavior

A Quarkus application can be started if a YAML file used by ConfigMapping contains a list with many values.

Actual behavior

A Quarkus application cannot be started if a YAML file used by ConfigMapping contains a list with many values.

How to Reproduce?

Step 1: Generate a Quarkus Application
Step 2: Add quarkus-config-yaml dependency
Step 3: Add yaml file with a list of values. The values in the list should be over 65535 characters in total.
Step 4. Create ConfigMapping interface that contains a list that is read from the Yaml file
Step 5. Start the application

Output of uname -a or ver

Microsoft Windows [Version 10.0.19045.4651]

Output of java -version

openjdk version "17.0.11" 2024-04-16 LTS OpenJDK Runtime Environment Corretto-17.0.11.9.1 (build 17.0.11+9-LTS) OpenJDK 64-Bit Server VM Corretto-17.0.11.9.1 (build 17.0.11+9-LTS, mixed mode, sharing)

Quarkus version or git rev

3.12.3

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.3

Additional information

No response

@krusc84 krusc84 added the kind/bug Something isn't working label Jul 23, 2024
@quarkus-bot quarkus-bot bot added env/windows Impacts Windows machines triage/needs-triage labels Jul 23, 2024
@radcortez
Copy link
Member

I'm able to generate a org.objectweb.asm.MethodTooLargeException as #22027 , but not a java.lang.RuntimeException: java.lang.IllegalArgumentException: UTF8 string too large.

Please, provide us with a reproducer. Thank you!

@radcortez radcortez added the triage/needs-reproducer We are waiting for a reproducer. label Jul 23, 2024
@krusc84
Copy link
Author

krusc84 commented Jul 24, 2024

The error only occurs if the list entries in the yaml file contain umlauts:

code-with-quarkus.zip

@dmlloyd
Copy link
Member

dmlloyd commented Jul 24, 2024

The umlauts aren't the problem, it's more likely that these list entries all get concatenated into one giant string (joined by ,) and that string is too big to represent in a single class constant pool entry (whose limit is 65535 utf8-encoded bytes). The Ä character is two bytes in UTF-8, iirc.

I guess we could work around the issue by breaking giant strings into chunks and merging them with String.concat.

@radcortez radcortez removed the triage/needs-reproducer We are waiting for a reproducer. label Jul 30, 2024
@radcortez
Copy link
Member

Thank you for the reproducer!

Yes, the issue is that we generated a value with all the list elements separated by commas for Collections types. This is / was required by MicroProfile Config, and before, we had support for indexed properties. I believe we don't need that anymore and I removed it: smallrye/smallrye-config#1203

@radcortez radcortez self-assigned this Aug 21, 2024
@dmlloyd
Copy link
Member

dmlloyd commented Aug 26, 2024

Well, I hope you're right.

@quarkus-bot quarkus-bot bot added this to the 3.17 - main milestone Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config env/windows Impacts Windows machines kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants