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 analyze this issue. The problem is that gRPC's ManagedChannelImpl log messages contain unsubstituted placeholders like
{0},{1}instead of the actual values. This is happening because the bridge between Java Util Logging (JUL) and SLF4J/Logback is not properly translating the placeholders.Let me first explore the repository structure to understand how the logging is configured.
Assistant
Let me explore the repository structure more, specifically looking for logging-related files.
<tool_call> <function=bash_terminal> <parameter=command> find /arcadedb -type f -name "*.java" | xargs grep -l "logging|JUL|LogManager|java.util.logging|jul-to-slf4j|SLF4JBridgeHandler" 2>/dev/null | head -30 </tool_call>
Assistant
The user wants me to search for logging-related Java files. I need to use the bash_terminal tool properly.
Assistant
Let me look at the repository structure and find the main logging configuration files.
<tool_call> <function=bash_terminal> <parameter=command> find /arcadedb -type f ( -name ".java" -o -name ".xml" -o -name ".properties" -o -name ".conf" ) | xargs grep -l -i "LogManager|java.util.logging|jul" 2>/dev/null | head -20 </tool_call>
Assistant
The user wants me to search for files related to logging management, JUL, or java.util.logging. I need to use the bash_terminal tool correctly with a proper command.
Assistant
Let me look at the logging configuration and the main server startup code.
Assistant
The logging configuration file shows that ArcadeDB uses Java Util Logging (JUL) with handlers. The issue is about gRPC's ManagedChannelImpl messages having unsubstituted placeholders. Let me search for more specific files related to JUL to SLF4J bridging.
Let me also look for where ArcadeDB initializes its logging system, particularly the LogFormatter and how it handles JUL records.
Assistant
Now I need to examine the LogFormatter and AnsiLogFormatter to understand how they format log messages. The issue is that the placeholders {0}, {1} are not being substituted. Let me look at these formatters.
Assistant
I found the issue. Let me also check the
AnsiLogFormatterto understand the full picture:Assistant
Now I understand the issue. The problem is in both
LogFormatter.javaandAnsiLogFormatter.java.The issue is that
message.formatted(additionalArgs)uses Java'sString.formatted()method, which internally usesString.format()- this expects%s,%d, etc. format specifiers. However, gRPC's JUL messages useMessageFormat-style placeholders like{0},{1}, which is completely different.When gRPC logs something like
[{0}] Failed to resolve name. status={1}with parameters["channel-7", "UNAVAILABLE"], themessage.formatted(additionalArgs)call doesn't substitute the placeholders because it's looking for%sstyle specifiers.Let me fix this by using
MessageFormat.format()which understands{0},{1}style placeholders.Assistant
Now let me look for any existing tests related to logging formatters to understand what edge cases I need to handle:
Assistant
Let me look at how the
DefaultLoggeruses logging to understand what format specifiers are used internally:Assistant
Now I understand the issue clearly. Let me create a test script to reproduce the problem first, then fix it.
The problem:
LogFormatter.javaandAnsiLogFormatter.javausemessage.formatted(additionalArgs)which is Java'sString.formatted()methodString.formatted()uses printf-style format specifiers like%s,%d- gRPC's JUL messages use MessageFormat-style placeholders like
{0},{1} - These never get substituted, so the raw
{0},{1}appears in logs
Assistant
The test confirms my analysis:
String.formatted()does NOT substitute{0},{1}- they remain literalMessageFormat.format()DOES substitute{0},{1}correctly- gRPC logs use
{0},{1}style (standard JUL parameter format)
Now let me look at how the standard Java
SimpleFormatterhandles this:Assistant
The standard SimpleFormatter uses
MessageFormat.format()to handle{0}, {1}placeholders. Now let me verify this is the root cause and understand what format ArcadeDB's own logging uses:Assistant
Now let me verify how ArcadeDB's own logging works (with and without parameters):
Assistant
Let me look at how gRPC logs directly to JUL to confirm this is indeed the issue:
Assistant
Now I understand the full picture. Let me create a test to reproduce the issue with the actual ArcadeDB formatters, then fix it.
Assistant
The error is because
IllegalFormatExceptionneeds to be imported. Let me fix the test script.Assistant
The test confirms the problem -
String.formatted()doesn't throw an exception for{0}, {1}placeholders, it just passes them through literally. I need a smarter approach that detects which format style is being used.Let me update the approach to detect MessageFormat-style placeholders (
{0}, {1}) before trying printf-style formatting:Assistant
The fix is working correctly. Now let me understand the issue better and check if there's an edge case I need to handle for printf-style messages that contain literal curly braces:
Assistant
The edge case with
{123}in the message would cause MessageFormat to try to parse it as an argument number, which would fail. However, looking at the actual use cases:- gRPC's ManagedChannelImpl uses standard JUL placeholders like
{0},{1}which are consecutive integers starting from 0. - ArcadeDB's own messages use printf-style
%s,%d, etc.
The pattern
{\\d+}would match any brace-enclosed number, which could be a problem if someone has literal{123}in their printf message. However, the standard JUL format uses{0},{1}, etc. starting from 0, so a better approach would be to check for the specific pattern{0},{1}, etc.Actually, the simpler approach is:
- First try printf-style formatting with
String.formatted() - If that fails (throws exception), try MessageFormat
The problem is that
String.formatted()doesn't throw an exception for style - it just passes them through literally. So we need a smarter detection.- gRPC's ManagedChannelImpl uses standard JUL placeholders like
Assistant
The test results look good. Now I need to implement the fix in the actual source files. Let me update both
LogFormatter.javaandAnsiLogFormatter.java.First, let me check the exact lines I need to modify:
Assistant
Now let me create a reproduction script to confirm the issue exists before applying the fix:
Assistant
I need to create a test to reproduce the issue. Let me first check if there's a way to compile and run Java code in this repository.
Assistant
Now I have a clear understanding of the issue. Let me first create a reproduction script, then apply the fix.
Step 1: Create a reproduction script to confirm the bug exists.
Assistant
The bug is confirmed. The output clearly shows:
- Current (buggy):
[ManagedChannelImpl] [{0}] Failed to resolve name. status={1}- placeholders NOT substituted - Expected:
[ManagedChannelImpl] [channel-7] Failed to resolve name. status=UNAVAILABLE: Unable to resolve host- placeholders substituted
Now let me apply the fix to the actual source files. I need to modify both
LogFormatter.javaandAnsiLogFormatter.java.- Current (buggy):
Assistant
Now I understand the full picture. The
MessageFormatclass is not imported or used inLogFormatter.java. I need to:- Add the
MessageFormatimport - Modify the formatting logic to detect and handle
{0},{1}style placeholders (standard JUL/MessageFormat style) - Fall back to printf-style (
%s,%d) formatting for ArcadeDB's own messages
Let me apply the fix to
LogFormatter.java:- Add the
Assistant
Now I understand the full picture. Let me apply the fix to both formatter files. I need to:
- Add
MessageFormatimport toLogFormatter.java - Modify the formatting logic to handle MessageFormat-style
{0}, {1}placeholders (used by gRPC/JUL) - Fall back to printf-style
%s, %dformatting for ArcadeDB's own messages - Apply the same fix to
AnsiLogFormatter.java
Let me start with
LogFormatter.java:- Add
Assistant
The user wants me to apply the fix to both LogFormatter.java and AnsiLogFormatter.java. I need to:
- Add MessageFormat import
- Modify the formatting logic to handle MessageFormat-style {0}, {1} placeholders
Let me use the bash_terminal to make the edits properly.
Assistant
The
java.text.*import is already present, soMessageFormatis already available. Now I need to modify the formatting logic inLogFormatter.java. Let me look at the exact code section I need to modify:Assistant
Now I understand the full picture. I need to modify the
customFormatMessagemethod inLogFormatter.javato handle MessageFormat-style{0}, {1}placeholders. Thejava.text.*import is already present.Let me create a helper method and update the formatting logic:
Assistant
Now I understand the full picture. I need to modify the
customFormatMessagemethod inLogFormatter.javato handle MessageFormat-style{0}, {1}placeholders that gRPC uses. Let me create the fix by adding a helper method and updating the formatting logic.Assistant
Now I'll create a test script to confirm the bug, then apply the fix to both
LogFormatter.javaandAnsiLogFormatter.java.Assistant
I understand the issue. The
LogFormatter.javausesmessage.formatted(additionalArgs)which expects printf-style format specifiers like%s,%d, but gRPC's JUL messages use MessageFormat-style placeholders like{0},{1}.Now let me apply the fix to
LogFormatter.java:Assistant
Now I'll apply the fix to
LogFormatter.java. The key is to detect MessageFormat-style placeholders ({0},{1}) and useMessageFormat.format()instead ofString.formatted()when needed.Assistant
The sed script didn't work correctly. Let me restore the file and use a more reliable approach.
Assistant
The sed command messed up the file. Let me restore it and use a cleaner approach with the edit command.
Assistant
Let me verify the file is restored and then apply the fix properly.
Assistant
Good, the file is restored. Now let me apply the fix properly. I'll use the
editcommand to replace the formatting logic inLogFormatter.java.Assistant
I need to use a different approach. The edit command isn't working with my syntax. Let me try using the
editcommand correctly or use bash commands to make the changes.Let me first look at the current state of the file, then use a reliable method to make the changes.
Assistant
I need to use the bash_terminal to make changes. Let me create a Python script to make the edits since sed is causing issues.
Assistant
The user wants me to continue fixing the LogFormatter.java file. Python3 is not available, so I need to use a different approach. Let me use
sedor create a Java-based script, or useperlwhich is typically available.Assistant
Let me use the
editcommand properly. Looking at the tool definition again:codeUsage: edit [OPTIONS] LINE_RANGE [REPLACEMENT_TEXT] Replaces lines in LINE_RANGE=<start_line>:<end_line> (inclusive) with the given text in the currently open or specified file. The REPLACEMENT_TEXT will be used as provided including all whitespaces, so make sure your indentation is correct. To input multiple lines into REPLACEMENT_TEXT, you may use the following syntax:edit 1:1 << 'EOF' Line1 Line2 EOF
codeYou can also provide the file to edit via `--file` option.edit --file path/to/file 1:1 "Your Replacement Text Here"
codeSo I need to use the
--fileoption and the proper syntax. Let me try this again.Assistant
I need to fix the LogFormatter.java file. The
editcommand isn't working because of syntax issues. Let me try usingsedorperlwhich are available. I'll use perl since it handles multi-line replacements better.Actually, let me try the
editcommand with the proper syntax using--fileoption.Assistant
The
editcommand has issues with my syntax. Let me try using the bashperlcommand to do the replacement since it's more reliable for multi-line text replacements.Assistant
Let me verify the change was applied correctly:
Assistant
The first part is done. Now I need to add the helper methods
formatLogMessage()andhasMessageFormatStyle()before thegetSourceClassSimpleName()method.Assistant
Let me verify the complete file looks correct:
Assistant
I can see the
LogFormatter.javafile has been updated. However, I notice the Javadoc lost the@symbols. Let me fix that and then apply the same fix toAnsiLogFormatter.java.Assistant
Let me verify the LogFormatter.java file looks correct now, then apply the same fix to AnsiLogFormatter.java.
Assistant
The Javadoc lines got corrupted with duplicate
*characters. Let me fix those and then apply the same fix toAnsiLogFormatter.java.Assistant
The user wants me to fix the LogFormatter.java file. I notice the Javadoc lines got corrupted with duplicate
*characters. Let me fix those and then apply the same fix to AnsiLogFormatter.java.Assistant
Good, the Javadoc lines are fixed now. Let me verify the complete LogFormatter.java file looks correct, then apply the same fix to AnsiLogFormatter.java.
Assistant
The
LogFormatter.javafile looks correct. Now I need to apply the same fix toAnsiLogFormatter.java. Let me first check its current state.Assistant
The
AnsiLogFormatter.javafile has the same issue - it usesmessage.formatted(additionalArgs)which doesn't handle MessageFormat-style{0}, {1}placeholders. I need to apply the same fix.Since
AnsiLogFormatterextendsLogFormatter, it can use the protectedformatLogMessage()method I just added to the parent class.Assistant
The user wants me to verify the fix to
AnsiLogFormatter.javaand then create a test to confirm both fixes work correctly. Let me check the current state of the file first.Assistant
The user wants me to verify the changes I've made and test them. Let me check the git diff first to see all changes, then create a test to verify the fix works.
Assistant
I understand. The user wants me to verify the changes and test that the fix works correctly. I've modified both
LogFormatter.javaandAnsiLogFormatter.java. Now I need to:- Create a test to verify the fix works
- Run existing tests to ensure nothing is broken
Let me create a test to verify the fix:
Assistant
The user wants me to fix the test file that has variable naming conflicts. Each test case block is trying to declare
Object[] argsbut there's already a method parameter calledargs. Let me fix the test file by using different variable names.Assistant
The test failure in Test 8 is actually a bug in my test - I made a typo in the expected value. The test input has
[{0}] Channel {1} shutdown nowwhich correctly becomes[ManagedChannelImpl-0] Channel shutdown-complete shutdown nowafter substitution (both{0}and{1}are replaced). My expected value was wrong - I missed the word "shutdown" that comes after{1}.Let me fix the test and re-run it to confirm all tests pass:
Assistant
All 10 tests pass. Now let me verify the existing tests in the repository still pass after my changes.
Assistant
Let me run the existing logger tests to verify my changes don't break anything:
Assistant
The user wants me to run the existing logger tests to verify my changes don't break anything. Let me run the tests.
Assistant
The user wants me to run the existing logger tests. Let me fix the environment and try again.
Assistant
Let me run the tests again and see the full output:
Assistant
The existing logger tests pass (4 tests, 0 failures). Now let me create a more comprehensive test that specifically tests the gRPC placeholder substitution fix using the actual formatters.
Assistant
All tests pass. The fix is working correctly. Let me verify the final state of the changes:
Assistant
Let me verify the complete changes and run the existing tests one more time to confirm everything is working:
Assistant
Let me run a final verification to make sure everything compiles and the tests pass:
Assistant
The code compiles without errors. Let me now run the complete logger tests to ensure everything passes, then verify the fix one more time.
Assistant
Let me run the final integration test to confirm the fix works with the actual compiled formatters:
Assistant
The fix is working correctly. Let me clean up temporary files and do a final review of the changes.
Assistant
Let me do a final comprehensive check to ensure everything is correct before submitting.
Assistant
The user's request is simple - just run
git statusto see the current state. Let me provide a clean response with just that command.Assistant
The fix is complete. Let me verify everything one more time before submitting:
Assistant
The test command had an issue. Let me try running it again with a simpler approach.
Assistant
I've made the changes and verified them. Now I need to submit my work. Let me call the submit command to finalize my changes.
Assistant
The fix has been verified successfully. Let me now submit my changes. The changes I made:
-
Modified
LogFormatter.java:- Added a new
formatLogMessage()method that handles both printf-style (%s, %d) and MessageFormat-style ({0}, {1}) placeholders - Added a
hasMessageFormatStyle()helper method to detect MessageFormat-style placeholders - Updated
customFormatMessage()to use the new formatting logic
- Added a new
-
Modified
AnsiLogFormatter.java:- Updated
customFormatMessage()to use the newformatLogMessage()method from the parent class
- Updated
The fix works by:
- Detecting if the message contains MessageFormat-style placeholders ({0}, {1}, etc.)
- If so, using
MessageFormat.format()to substitute the parameters - Otherwise, using
String.formatted()for printf-style placeholders - Falling back to
MessageFormat.format()ifString.formatted()fails
This resolves the issue where gRPC's ManagedChannelImpl log messages had unsubstituted {0}, {1} placeholders because
String.formatted()doesn't understand MessageFormat-style placeholders.-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.