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

With logging, java.util.MissingFormatArgumentException: Format specifier '%%' #23769

Closed
dmlloyd opened this issue Feb 16, 2022 · 5 comments
Closed
Labels

Comments

@dmlloyd
Copy link
Member

dmlloyd commented Feb 16, 2022

Describe the bug

When logging a message, an exception like the following is thrown:

java.util.MissingFormatArgumentException: Format specifier '%%'
Listening for transport dt_socket at address: 4004
	at org.wildfly.common.format.Printf.formatDirect(Printf.java:452)
	at org.jboss.logmanager.formatters.ColorPrintf.formatDirect(ColorPrintf.java:45)
	at org.wildfly.common.format.Printf.format(Printf.java:98)
	at org.jboss.logmanager.formatters.ColorPatternFormatter.formatMessage(ColorPatternFormatter.java:141)
	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.ColorPatternFormatter$ColorStep.render(ColorPatternFormatter.java:160)
	at org.jboss.logmanager.formatters.MultistepFormatter.format(MultistepFormatter.java:86)
	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.doPublish(QuarkusDelayedHandler.java:80)
	at org.jboss.logmanager.ExtHandler.publish(ExtHandler.java:66)
	at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:334)
	at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:341)
	at org.jboss.logmanager.Logger.logRaw(Logger.java:750)
	at org.jboss.logmanager.Logger.log(Logger.java:708)
	at org.jboss.logging.JBossLogManagerLogger.doLogf(JBossLogManagerLogger.java:53)
	at org.jboss.logging.Logger.infof(Logger.java:1125)
        ... (more stuff)

This happens when logging a message whose format string contains the string %% after all printf format specifiers (i.e. a %% is the last % sequence in the string).

Workaround

To work around this issue, an extra argument can be given to the log method (for example, add , null to the end of the arguments to the log method). This argument will be ignored but it will allow the check to pass.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

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

No response

Additional information

No response

@dmlloyd dmlloyd added the kind/bug Something isn't working label Feb 16, 2022
@maxandersen
Copy link
Member

from chat: "updating org.wildfly.common:wildfly-common to 1.5.4.Final-format-002 will fix it, once the artifact propagates (takes about 24 hours)"

@quarkus-bot
Copy link

quarkus-bot bot commented Feb 16, 2022

@AkMo3
Copy link
Contributor

AkMo3 commented Feb 16, 2022

Hey @dmlloyd, I looking to contribute to this project, and this issue seems to be an easy starting point. Can you please let me know how can I reproduce it?

@dmlloyd
Copy link
Member Author

dmlloyd commented Feb 16, 2022

Hey @dmlloyd, I looking to contribute to this project, and this issue seems to be an easy starting point. Can you please let me know how can I reproduce it?

I'm glad you're interested! Unfortunately I've already fixed the problem - it was indeed an easy fix. (It's in a dependent component, and due to the way our Nexus instance works, the component won't find its way to the upstream Maven servers until tomorrow, which is why there's no PR yet). You might consider hanging out on the Zulip chat though if you're interested in contributing; it's a pretty high-volume project so things come up all the time.

geoand added a commit to geoand/quarkus that referenced this issue Mar 20, 2023
ryanemerson added a commit to ryanemerson/infinispan that referenced this issue Mar 30, 2023
Upgrade to wildfly-common version with fix for native compilation

quarkusio/quarkus#23769

Align version dependencies with Quarkus
ryanemerson added a commit to ryanemerson/infinispan that referenced this issue Apr 3, 2023
- Upgrade to wildfly-common version with fix for native compilation

quarkusio/quarkus#23769

- Align version dependencies with Quarkus
- Fix Checkstyle failures
wburns pushed a commit to infinispan/infinispan that referenced this issue Apr 3, 2023
- Upgrade to wildfly-common version with fix for native compilation

quarkusio/quarkus#23769

- Align version dependencies with Quarkus
- Fix Checkstyle failures
@dmlloyd dmlloyd closed this as completed May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants