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
Interface
No new interfaces are introduced.
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 using command. 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
Let me start by exploring the repository structure to understand what we're working with.
Assistant
Let me explore the package directory which likely contains the server packaging
Assistant
Let me look at the logging configuration files first
Assistant
Now let me look at the actual log formatter and related files
Assistant
This file shows the issue! The LogFormatter is using
message.formatted(additionalArgs)which uses Java's String.format() style (using %s placeholders). But gRPC's JUL records useMessageFormatstyle placeholders like {0}, {1}.Let me also look at AnsiLogFormatter.
Assistant
formatters use
message.formatted(additionalArgs)which is Java's String.format() style. The issue is:- JUL messages from gRPC use MessageFormat placeholders like {0}, {1}
message.formatted(additionalArgs)uses String.format() placeholders like %s, %d- The placeholders don't match, so the formatter falls back to just outputting the raw template
- Result: we see
{0}and{1}in the logs literally
Let me check where else this is used:
Assistant
Now I understand the issue. Let me check the test files to see what existing behavior is:
Assistant
Let me check how gRPC is being used in the codebase and the way logging is set up:
Assistant
Let me check what the issue mentioned about AppendLogResponseHandler
Assistant
let me write a quick test to reproduce the issue and verify my understanding:
Assistant
The test confirms the issue! Now let me search for other places in the codebase that might use JUL with
%sstyle placeholders to ensure backward compatibility:Assistant
Let me see all the places where logging is done in the codebase that might affect the issue
Assistant
Let me look at the LogManager:
Assistant
Let me look at the test that uses
.formatted(record.getParameters()):Assistant
Let me look at the existing tests to see what they expect for log formatting:
Assistant
Let me see what gRPC version is used in the project:
Assistant
me check the actual implementation of grpc logging
Assistant
let me write a test to reproduce the issue end-to-end:
Assistant
Let me search for code that calls JUL directly with parameters:
Assistant
Let me check what
AnsiCode.formatdoes:Assistant
Now let me understand the issue and design the fix. Let me look at the existing formatters one more time:
Assistant
Let me search more carefully for any code that uses JUL directly with
%splaceholders:Assistant
All the LOGGER.log calls are without format placeholders - they use simple strings. So changing the formatter behavior won't affect these.
Let me check the RaftHAServer too
Assistant
Now let me also see if there's any code that uses JUL with format placeholders anywhere else in the codebase:
Assistant
I have enough context. Let me design and implement the fix:
-
The root cause is in
LogFormatter.customFormatMessage()andAnsiLogFormatter.customFormatMessage(). They useString.formatted()(which expects%s,%d, etc.) but JUL convention usesMessageFormatstyle ({0},{1}, etc.) forLogRecord.getParameters(). -
The fix is to substitute parameters using
MessageFormat.format()while keepingString.formatted()as a fallback for backward compatibility.
Let me first reproduce the issue and confirm my understanding with a test:
-
Assistant
Confirmed the issue. Now let me implement the fix. I'll modify both formatters:
Assistant
Now let me make the fix to LogFormatter. I'll add a static helper method that handles parameter substitution using MessageFormat (the JUL convention) while keeping a fallback to String.format for backward compatibility:
Assistant
Let me make the edit to LogFormatter.java to use MessageFormat.
Assistant
I need to call the bash_terminal tool. Let me make the edit.
Assistant
I need to add the
substituteParametershelper method. Let me add it:Assistant
I see a duplicate of
getSourceClassSimpleName- let me fix this:Assistant
need to fix the duplicate. Let me replace the broken
getSourceClassSimpleNamemethod:Assistant
Hmm, still duplicate. The replace didn't work as expected because the
editcommand replaces the lines I specified, but the existing content was different. Let me see what's happening.Looking at the file:
- Line 92:
protected String getSourceClassSimpleName(final String iSourceClassName) { - Line 93:
protected String getSourceClassSimpleName(final String iSourceClassName) {(duplicate!)
So the original line 93 still has a duplicate. Let me remove line 93.
Actually let me read more carefully. It looks like line 92 is
protected String getSourceClassSimpleName(the correct one) but then line 93 is also the same. Theeditcommand I ran replaced 93:99 with the correct version, but the result still has duplicates. This is strange.Let me look at the file more
- Line 92:
Assistant
still a duplicate line 93. Let me fix it with sed instead:
Assistant
LogFormatter.java looks good. Now let me update AnsiLogFormatter.java to also use the new helper method:
Assistant
edit didn't work correctly. Let me rewrite the entire AnsiLogFormatter.java:
Assistant
Both files look good. Let me verify they compile correctly:
Assistant
Let me try compiling manually to verify the changes compile:
Assistant
Let me try compiling the changed files in isolation to verify syntactic correctness:
Assistant
Both files compile successfully. Now let me write a test to verify the fix works:
Assistant
The fix works correctly! All test cases show the expected output:
- Test 1 (gRPC MessageFormat):
[channel-7] Failed to resolve name. status=UNAVAILABLE: Unable to resolve host- correctly substituted! - Test 2 (%s style):
Test with channel-7 placeholders- still works (backward compat). - Test 3 (no params):
Plain message- works. - Test 4 (empty params):
Empty params [{0}]- no substitution (which is correct since there are no params). - Test 5 (single {0}):
Operation failed: connection refused- correctly substituted.
Now let me run the existing tests to verify the fix doesn't break anything:
- Test 1 (gRPC MessageFormat):
Assistant
Let me check the related tests for the formatter:
Assistant
Let me run the existing tests in the engine module to make sure the fix doesn't break anything:
Assistant
Let me try compiling the engine module to make sure my changes don't break anything:
Assistant
Compilation succeeded. Now let me also test if the test classes compile correctly:
Assistant
Now let me run the relevant test cases for the LoggerTest:
Assistant
All LoggerTest tests pass. Let me also run the AnsiCodeTest to make sure ANSI codes still work:
Assistant
Let me also run a more comprehensive test to verify the fix works in a real scenario:
Assistant
The fix works perfectly! The output now shows the expected substituted values. Let me also verify edge cases:
Assistant
The fix works correctly. Let me analyze the edge cases:
- Edge 1 (null message): This is a pre-existing NPE issue in
AnsiCode.format(), not related to my fix. - Edge 2 (mismatched placeholders): Standard MessageFormat behavior - extras left as-is.
- Edge 3 (no placeholders, params passed): Returns message as-is, params ignored.
- Edge 4 (number format): MessageFormat correctly formatted the number.
- Edge 5 (quoted braces): Standard MessageFormat -
'{is a literal{. - Edge 6 (single quote): Standard MessageFormat quirk -
'inIt'sis interpreted as quote start.
All edge cases behave as expected for the standard JUL
Formatter.formatMessage()behavior. Let me now run the related schema tests to make sure they still pass:- Edge 1 (null message): This is a pre-existing NPE issue in
Assistant
All related tests pass. Let me also search for any other places in the codebase that might have similar issues:
Assistant
Let me also check if there's any other logging-related code that might have similar issues:
Assistant
Let me also check the e2e-ha module to understand the test setup:
Assistant
Let me also look at the slf4j-jdk14 dependency to see if it does any pre-processing:
Assistant
Let me look at the SLF4J to JUL conversion code:
Assistant
The fix is correct for the gRPC case. Let me also verify the actual gRPC source to confirm the issue:
Assistant
Let me look at ManagedChannelImpl:
Assistant
Hmm, ManagedChannelImpl doesn't seem to call MessageFormat directly. Let me check where exactly the "Failed to resolve name" message comes from. Let me grep for it:
Assistant
This is the EXACT location of the issue! Looking at the bytecode:
String [{0}] Failed to resolve name. status={1}- the message with MessageFormat placeholdersLogger.log(Level.WARNING, msg, Object[])- the JUL method that creates a LogRecord with parameters
So gRPC follows the JUL convention exactly: uses MessageFormat placeholders and passes parameters via
LogRecord.parameters. My fix correctly handles this.Let me also verify the
InternalLogId.toString()output to make sure the substitution produces a sensible result:Assistant
The fix is correct. Let me re-verify the final state of both files:
Assistant
Let me also recompile and run the engine module tests to verify everything still works:
Assistant
All 20 tests pass. Let me also run a broader set of tests to make sure I haven't broken anything else. Let me also run any test related to logging:
Assistant
Let me also run the gRPC tests to make sure they still pass:
Assistant
tests pass. Let me also verify that the test from the issue's description (LocalSchemaOrphanIndexLoadTest) still works since it tests the related logging behavior:
Assistant
All 61 logging-related tests pass. Let me also clean up the temporary test files:
Assistant
Let me also verify the final state of the changes one more time:
Assistant
The diff is clean. Let me also run a final reproduction script to confirm the fix works for the exact scenario in the issue:
Assistant
The fix works correctly! The output now shows the substituted values instead of the raw
{0}and{1}placeholders.Let me also clean up the final test file:Let
me clean up the final test file:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.