ISSUE DESCRIPTION gRPC ManagedChannelImpl log messages contain unsubstituted…
- User
ISSUE DESCRIPTION
gRPC ManagedChannelImpl log messages contain unsubstituted placeholders Affected version: ArcadeDB server 26.4.2 Component: logging — bridge between gRPC's java.util.logging and the server's SLF4J/Logback backend
Summary
Some WARNING messages emitted by gRPC's ManagedChannelImpl are written to the ArcadeDB server log with the original MessageFormat placeholders ({0}, {1}) left literal instead of being substituted with the actual values.
Example
2026-05-21 06:53:11.234 WARNI [ManagedChannelImpl] [{0}] Failed to resolve name. status={1} 2026-05-21 06:53:11.234 WARNI [ManagedChannelImpl] [{0}] Failed to resolve name. status={1}
Expected (illustrative):
WARNI [ManagedChannelImpl] [channel-7] Failed to resolve name. status=UNAVAILABLE: Unable to resolve host vcc-superx-arcadedb-2.…
Root cause (suspected)
gRPC's internal loggers use java.util.logging with MessageFormat-style placeholders. The bridge that forwards JUL records to the ArcadeDB logging backend (SLF4J/Logback) is not translating {0}, {1} parameters into the SLF4J {} style, so the parameter array is dropped and the raw template ends up in the log file. Confirmation: the same logical event is also logged elsewhere (via GrpcLogAppender / AppendLogResponseHandler) with the full formatted message, so the data exists — it's just lost on the ManagedChannelImpl path.
Impact
Low severity but operationally annoying — these log lines carry zero information, so anyone scanning logs for the actual channel and gRPC status gets a stream of [{0}] Failed to resolve name. status={1} that they then have to correlate with neighbouring lines.
Suggested fix
Either:
- Install SLF4JBridgeHandler (org.slf4j:jul-to-slf4j) and ensure it translates JUL LogRecord.parameters via MessageFormat.format(...) before delegating to SLF4J; or
- Configure a JUL Handler for the io.grpc logger that uses a SimpleFormatter-compatible formatter so parameters are substituted before the message reaches the SLF4J side.
Environment
- ArcadeDB 26.4.2, default packaging
- Logs viewed via kubectl logs; same behaviour observed across all 3 HA pods
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can use and to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call ) using or commands. However you don't need to use or before submitting your changes. In fact, only submits currently unstaged changes because it uses to get the changes that need to be submitted. - Assistant
I'll start by exploring the repository to understand its structure and locate the relevant logging code. Let's first get an overview.
- Assistant
Let me look at the gRPC logging interceptor and the general logging setup.
- Assistant
Let me look at the gRPC-related logging code and understand how JUL logs are being bridged to the ArcadeDB logging system.
- Assistant
Let me understand the issue better. The problem is that gRPC's internal loggers use
java.util.loggingwithMessageFormat-style placeholders (like{0},{1}), and when these messages are forwarded to the SLF4J/Logback backend, the parameters aren't substituted.Let me look at the LogManager and understand how logging is set up.
- Assistant
Let me look at the DefaultLogger and see how it handles logging, and then find where gRPC JUL logging is being bridged.
- Assistant
Now let me look at the AnsiLogFormatter to see if it handles the JUL LogRecord parameters:
- Assistant
Now I see the issue. The
AnsiLogFormattertries to usemessage.formatted(additionalArgs)which expectsString.format()-style placeholders (%s,%d, etc.), but gRPC's ManagedChannelImpl usesjava.text.MessageFormat-style placeholders ({0},{1}, etc.). Let me also look at the parentLogFormatter: - Assistant
Now I understand the issue clearly. Both
LogFormatterandAnsiLogFormatterusemessage.formatted(additionalArgs)which expectsString.format()-style%splaceholders. But gRPC's internal loggers usejava.text.MessageFormat-style{0},{1}placeholders. WhenString.formatted()fails withIllegalFormatException, it silently falls back to printing the raw message with unsubstituted placeholders.Let me check if there are any existing tests for this:
- Assistant
Now I have a clear picture of the bug. Let me also check the gRPC module to see if there's any JUL bridge setup:
- Assistant
Let me check if there's a build file (Maven or Gradle) that could give us info about the dependencies.
- Assistant
Let me check the build system and understand the project structure.
- Assistant
Let me check the grpcw module's pom.xml and look at how gRPC logging is configured:
- Assistant
Now I understand the full picture. The problem is in the
LogFormatter(and its subclassAnsiLogFormatter). When gRPC logs a message usingjava.util.loggingwithMessageFormat-style placeholders ({0},{1}), theLogRecordstores:getMessage()="[{0}] Failed to resolve name. status={1}"getParameters()=["channel-7", "UNAVAILABLE: Unable to resolve host..."]
The
LogFormatter.customFormatMessage()tries to domessage.formatted(additionalArgs)which usesString.format()style (%s), and since the message doesn't contain any%s/%dformat specifiers, it throwsIllegalFormatException, and the catch block just appends the raw message with unsubstituted{0},{1}placeholders.Let me first create a test script to reproduce the issue and confirm the bug:
- Assistant
Interesting! So on this Java version,
String.formatted()does NOT throw anIllegalFormatExceptionwhen there are extra arguments. It just outputs the message as-is, ignoring the extra arguments. That's why the raw{0}placeholders show up in the log output - theString.formatted()call succeeds but doesn't substitute anything because{0}is not a valid%s-style format specifier.So the fix is clear: when we have
additionalArgs, we need to detect whether the message usesMessageFormat-style placeholders ({0},{1}, etc.) and useMessageFormat.format()instead ofString.formatted().Let me check what Java version is being used:
- Assistant
Now I understand the problem fully. The fix should be in the
LogFormatter.customFormatMessage()method (and its override inAnsiLogFormatter). WhenadditionalArgsis not null, we should:- First check if the message contains MessageFormat-style placeholders (like
{0},{1}, etc.) - If so, use
MessageFormat.format()to format the message - Otherwise, use the existing
String.formatted()behavior
Let me implement this fix. First, let me open and edit the
LogFormatter.java:Now let me implement the fix. I'll modify both
LogFormatterandAnsiLogFormatterto handleMessageFormat-style placeholders. - First check if the message contains MessageFormat-style placeholders (like
- Assistant
I need to be in the /arcadedb directory.
- Assistant
Now I'll edit
LogFormatter.javato add a helper method that handles bothMessageFormat-style andString.format-style placeholders: - Assistant
Let me use a different approach to edit the file:
- Assistant
Now I need to add the
formatMessageWithArgshelper method. Let me add it after thegetSourceClassSimpleNamemethod: - Assistant
I see there's a duplicate
returnline at lines 95-96. Let me fix that: - Assistant
Good, now the LogFormatter looks correct. Now I need to update AnsiLogFormatter to also use the
formatMessageWithArgshelper method. Let me check its current state and update it: - Assistant
Now I need to update the
AnsiLogFormatter.customFormatMessagemethod to use theformatMessageWithArgshelper method from the parent class: - Assistant
I need to provide the EOF marker.
- Assistant
Now let me verify the changes by looking at both files in their final state:
- Assistant
Now let me write a test to verify the fix works. Let me create a small test program that simulates the issue and verifies the fix:
- Assistant
The fix works correctly:
- Test 1: gRPC MessageFormat-style placeholders are correctly substituted ✓
- Test 2: ArcadeDB String.format-style placeholders still work ✓
- Test 3-4: Null/empty args handled correctly ✓
- Test 5: Escaped braces in MessageFormat work correctly ✓
- Test 6: Another gRPC message works ✓
- Test 7: Missing args leaves placeholder as-is ✓
- Test 8: Curly braces that are NOT MessageFormat placeholders don't get incorrectly treated as MessageFormat ✓
Let me test one more edge case - what if someone has
{0:in a message:The fix works correctly. Let me test one more edge case - what if someone has
{0:in a message: - Assistant
All edge cases work correctly. Now let me run the existing tests to make sure I haven't broken anything:
- Assistant
Let me check if Maven is available and run the existing tests:
- Assistant
Let me run the existing tests for the engine module to ensure nothing is broken:
- Assistant
The test ran successfully (no failures reported). Let me also run the full test suite for the engine module to be thorough:
- Assistant
The full test suite is taking too long. Let me just run the specific LoggerTest and also compile the modified files to check for any compilation issues:
- Assistant
Good, the engine module compiles successfully. Now let me run the LoggerTest to confirm it passes:
- Assistant
All 4 LoggerTest tests pass. Now let me also check if there are any tests related to the gRPC logging interceptor:
- Assistant
The grpcw module can't be compiled on its own because it depends on other modules. That's fine - our changes are in the engine module which compiles and tests pass. Let me verify the complete changes we've made:
- Assistant
The changes look clean and correct. Let me now write a comprehensive test to verify the fix works correctly with the actual LogFormatter class:
- Assistant
All tests pass! The fix works correctly:
- gRPC MessageFormat-style placeholders (
{0},{1}) are now correctly substituted - ArcadeDB String.format-style placeholders (
%s,%d) still work correctly - Both
LogFormatterandAnsiLogFormatterbenefit from the fix sinceAnsiLogFormatterextendsLogFormatterand the helper method is defined in the parent class
Let me now go through the checklist:
- gRPC MessageFormat-style placeholders (
- Assistant
Now let me submit the solution:
- Assistant
Good, the changes are in the right files. Let me submit.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.