quarkus: LogManager error of type FORMAT_FAILURE: Formatting error
Describe the bug
When starting a Quarkus 3.2.4 based app, the following is printed even before the Quarkus banner:
LogManager error of type FORMAT_FAILURE: Formatting error
java.lang.IllegalArgumentException: can't parse argument number:
at java.base/java.text.MessageFormat.makeFormat(MessageFormat.java:1454)
at java.base/java.text.MessageFormat.applyPattern(MessageFormat.java:492)
at java.base/java.text.MessageFormat.<init>(MessageFormat.java:371)
at java.base/java.text.MessageFormat.format(MessageFormat.java:860)
at org.jboss.logmanager.ExtFormatter.formatMessageLegacy(ExtFormatter.java:107)
at org.jboss.logmanager.ExtFormatter.formatMessage(ExtFormatter.java:70)
at org.jboss.logmanager.formatters.Formatters$16.renderRaw(Formatters.java:781)
at org.jboss.logmanager.formatters.Formatters$JustifyingFormatStep.render(Formatters.java:221)
at org.jboss.logmanager.formatters.MultistepFormatter.format(MultistepFormatter.java:86)
at io.quarkus.runtime.logging.BannerFormatter.format(BannerFormatter.java:56)
at org.jboss.logmanager.ExtFormatter.format(ExtFormatter.java:32)
at org.jboss.logmanager.handlers.WriterHandler.doPublish(WriterHandler.java:43)
at org.jboss.logmanager.ExtHandler.publish(ExtHandler.java:66)
at org.jboss.logmanager.ExtHandler.publishToNestedHandlers(ExtHandler.java:97)
at io.quarkus.bootstrap.logging.QuarkusDelayedHandler.activate(QuarkusDelayedHandler.java:292)
at io.quarkus.bootstrap.logging.QuarkusDelayedHandler.setHandlers(QuarkusDelayedHandler.java:189)
at io.quarkus.runtime.logging.LoggingSetupRecorder.initializeLogging(LoggingSetupRecorder.java:269)
at io.quarkus.deployment.steps.LoggingResourceProcessor$setupLoggingRuntimeInit1899082837.deploy_0(Unknown Source)
at io.quarkus.deployment.steps.LoggingResourceProcessor$setupLoggingRuntimeInit1899082837.deploy(Unknown Source)
at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
at io.quarkus.runtime.Application.start(Application.java:101)
at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:111)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
at io.quarkus.runner.GeneratedMain.main(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:61)
at io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:32)
Caused by: java.lang.NumberFormatException: For input string: ""
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
at java.base/java.lang.Integer.parseInt(Integer.java:678)
at java.base/java.lang.Integer.parseInt(Integer.java:786)
at java.base/java.text.MessageFormat.makeFormat(MessageFormat.java:1452)
... 31 more
__ ____ __ _____ ___ __ ____ ______
--/ __ \/ / / / _ | / _ \/ //_/ / / / __/
-/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
17:55:21 WARN <> [io.qu.op.ru.ex.ot.LateBoundBatchSpanProcessor] (main) No BatchSpanProcessor delegate specified, no action taken.
...normal app startup continues...
Debugging this reveals that the following message is passed to org.jboss.logmanager.ExtFormatter.formatMessage method:
VertxTracer delegate not set. Will not submit this trace. SpanKind: {}; Request: {}; Operation:{}.
…the logRecord passed to the method is an ExtLogRecord with formatStyle attribute being MESSAGE_FORMAT. Obviously indexes in the placeholders are missing for that formatStyle.
Expected behavior
No formatting exceptions in the early log.
Actual behavior
Like described
How to Reproduce?
Well, the opentelemetry extension is obviously a must, but I haven’t established a recipy yet. It might even be a race since some services report this exception and some don’t but are otherwise very similarly configured.
Output of uname -a or ver
openjdk version “17.0.7” 2023-04-18 LTS OpenJDK Runtime Environment (Red_Hat-17.0.7.0.7-1.el9_1) (build 17.0.7+7-LTS) OpenJDK 64-Bit Server VM (Red_Hat-17.0.7.0.7-1.el9_1) (build 17.0.7+7-LTS, mixed mode, sharing)
Output of java -version
openjdk version “17.0.7” 2023-04-18 LTS OpenJDK Runtime Environment (Red_Hat-17.0.7.0.7-1.el9_1) (build 17.0.7+7-LTS) OpenJDK 64-Bit Server VM (Red_Hat-17.0.7.0.7-1.el9_1) (build 17.0.7+7-LTS, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
3.2.4
Build tool (ie. output of mvnw --version or gradlew --version)
Apache Maven 3.9.4 (dfbb324ad4a7c8fb0bf182e6d91b0ae20e3d2dd9) Maven home: /home/peter/JavaApps/apache-maven-3 Java version: 17.0.8, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-17-openjdk-17.0.8.0.7-1.fc38.x86_64 Default locale: en_US, platform encoding: UTF-8 OS name: “linux”, version: “6.4.12-200.fc38.x86_64”, arch: “amd64”, family: “unix”
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 10 months ago
- Reactions: 1
- Comments: 24 (20 by maintainers)
Commits related to this issue
- Fix invalid logging pattern Closes: #35614 — committed to geoand/quarkus by geoand 10 months ago
- Merge pull request #35740 from geoand/#35614 Fix invalid logging pattern — committed to quarkusio/quarkus by famod 10 months ago
- Fix invalid logging pattern Closes: #35614 (cherry picked from commit f2a2516f4df0e2e76f6bab3d40895b5a3fcf093f) — committed to aloubyansky/quarkus by geoand 10 months ago
https://github.com/quarkusio/quarkus/pull/35740 takes care of it