Fix stderr leak in Docker ES process detection#140701
Merged
ebarlas merged 3 commits intoelastic:mainfrom Jan 16, 2026
Merged
Conversation
Use cat to read the cmd file instead of input redirection.
9f420ca to
eefc3a0
Compare
Collaborator
|
Hi @ebarlas, I've created a changelog YAML for you. |
Collaborator
|
Pinging @elastic/es-delivery (Team:Delivery) |
ebarlas
added a commit
to ebarlas/elasticsearch
that referenced
this pull request
Jan 16, 2026
Use cat to read the cmd file instead of input redirection
ebarlas
added a commit
to ebarlas/elasticsearch
that referenced
this pull request
Jan 16, 2026
Use cat to read the cmd file instead of input redirection
Collaborator
Contributor
Author
|
Missed the label for 9.2 backport. Doing that via tool. |
Contributor
Author
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
elasticsearchmachine
pushed a commit
that referenced
this pull request
Jan 16, 2026
ebarlas
added a commit
that referenced
this pull request
Jan 16, 2026
This was referenced Jan 17, 2026
Contributor
Author
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
ebarlas
added a commit
to ebarlas/elasticsearch
that referenced
this pull request
Jan 20, 2026
Use cat to read the cmd file instead of input redirection (cherry picked from commit af3eebb)
ebarlas
added a commit
that referenced
this pull request
Jan 20, 2026
spinscale
pushed a commit
to spinscale/elasticsearch
that referenced
this pull request
Jan 21, 2026
Use cat to read the cmd file instead of input redirection
jozala
added a commit
to jozala/elasticsearch
that referenced
this pull request
Jan 22, 2026
Removed muting for multiple Docker-related integration tests in `muted-tests.yml`, as they are likely resolved in elastic#140701 and ready for re-evaluation.
jozala
added a commit
that referenced
this pull request
Jan 23, 2026
…41098) * Unmute DockerTests in muted-tests.yml Removed muting for multiple Docker-related integration tests in `muted-tests.yml`, as they are likely resolved in #140701 and ready for re-evaluation. * Refactor authentication retry logic in ServerUtils Removed unnecessary boolean flag for retrying on authentication failure * Fix Docker log dumps Fixed the problem with running `docker logs null` after test failure. The problem was caused by calling the `removeContainer()` before `dumpDebug()` because `dumpDebug()` is called from the @rule on the base class and `removeContainer()` from @after method on the child class. * Fix conditional logic in ServerUtils for cluster health check Adjusted logic to properly set the `started` flag only after a successful cluster health API response. * Make the logging less verbose This warning log with exception was very loud and sometimes hide the real issue. It has been changed to only log the exception message.
jozala
added a commit
to jozala/elasticsearch
that referenced
this pull request
Jan 26, 2026
…astic#141098) * Unmute DockerTests in muted-tests.yml Removed muting for multiple Docker-related integration tests in `muted-tests.yml`, as they are likely resolved in elastic#140701 and ready for re-evaluation. * Refactor authentication retry logic in ServerUtils Removed unnecessary boolean flag for retrying on authentication failure * Fix Docker log dumps Fixed the problem with running `docker logs null` after test failure. The problem was caused by calling the `removeContainer()` before `dumpDebug()` because `dumpDebug()` is called from the @rule on the base class and `removeContainer()` from @after method on the child class. * Fix conditional logic in ServerUtils for cluster health check Adjusted logic to properly set the `started` flag only after a successful cluster health API response. * Make the logging less verbose This warning log with exception was very loud and sometimes hide the real issue. It has been changed to only log the exception message. (cherry picked from commit bb91f1e) # Conflicts: # muted-tests.yml
jozala
added a commit
to jozala/elasticsearch
that referenced
this pull request
Jan 26, 2026
…astic#141098) * Unmute DockerTests in muted-tests.yml Removed muting for multiple Docker-related integration tests in `muted-tests.yml`, as they are likely resolved in elastic#140701 and ready for re-evaluation. * Refactor authentication retry logic in ServerUtils Removed unnecessary boolean flag for retrying on authentication failure * Fix Docker log dumps Fixed the problem with running `docker logs null` after test failure. The problem was caused by calling the `removeContainer()` before `dumpDebug()` because `dumpDebug()` is called from the @rule on the base class and `removeContainer()` from @after method on the child class. * Fix conditional logic in ServerUtils for cluster health check Adjusted logic to properly set the `started` flag only after a successful cluster health API response. * Make the logging less verbose This warning log with exception was very loud and sometimes hide the real issue. It has been changed to only log the exception message. (cherry picked from commit bb91f1e) # Conflicts: # muted-tests.yml
jozala
added a commit
to jozala/elasticsearch
that referenced
this pull request
Jan 26, 2026
…astic#141098) * Unmute DockerTests in muted-tests.yml Removed muting for multiple Docker-related integration tests in `muted-tests.yml`, as they are likely resolved in elastic#140701 and ready for re-evaluation. * Refactor authentication retry logic in ServerUtils Removed unnecessary boolean flag for retrying on authentication failure * Fix Docker log dumps Fixed the problem with running `docker logs null` after test failure. The problem was caused by calling the `removeContainer()` before `dumpDebug()` because `dumpDebug()` is called from the @rule on the base class and `removeContainer()` from @after method on the child class. * Fix conditional logic in ServerUtils for cluster health check Adjusted logic to properly set the `started` flag only after a successful cluster health API response. * Make the logging less verbose This warning log with exception was very loud and sometimes hide the real issue. It has been changed to only log the exception message. (cherry picked from commit bb91f1e) # Conflicts: # muted-tests.yml
jozala
added a commit
to jozala/elasticsearch
that referenced
this pull request
Jan 26, 2026
…astic#141098) * Unmute DockerTests in muted-tests.yml Removed muting for multiple Docker-related integration tests in `muted-tests.yml`, as they are likely resolved in elastic#140701 and ready for re-evaluation. * Refactor authentication retry logic in ServerUtils Removed unnecessary boolean flag for retrying on authentication failure * Fix Docker log dumps Fixed the problem with running `docker logs null` after test failure. The problem was caused by calling the `removeContainer()` before `dumpDebug()` because `dumpDebug()` is called from the @rule on the base class and `removeContainer()` from @after method on the child class. * Fix conditional logic in ServerUtils for cluster health check Adjusted logic to properly set the `started` flag only after a successful cluster health API response. * Make the logging less verbose This warning log with exception was very loud and sometimes hide the real issue. It has been changed to only log the exception message. (cherry picked from commit bb91f1e) # Conflicts: # muted-tests.yml
elasticsearchmachine
pushed a commit
that referenced
this pull request
Jan 26, 2026
…41098) (#141293) * Unmute DockerTests in muted-tests.yml Removed muting for multiple Docker-related integration tests in `muted-tests.yml`, as they are likely resolved in #140701 and ready for re-evaluation. * Refactor authentication retry logic in ServerUtils Removed unnecessary boolean flag for retrying on authentication failure * Fix Docker log dumps Fixed the problem with running `docker logs null` after test failure. The problem was caused by calling the `removeContainer()` before `dumpDebug()` because `dumpDebug()` is called from the @rule on the base class and `removeContainer()` from @after method on the child class. * Fix conditional logic in ServerUtils for cluster health check Adjusted logic to properly set the `started` flag only after a successful cluster health API response. * Make the logging less verbose This warning log with exception was very loud and sometimes hide the real issue. It has been changed to only log the exception message. (cherry picked from commit bb91f1e) # Conflicts: # muted-tests.yml
elasticsearchmachine
pushed a commit
that referenced
this pull request
Jan 26, 2026
…41098) (#141294) * Unmute DockerTests in muted-tests.yml Removed muting for multiple Docker-related integration tests in `muted-tests.yml`, as they are likely resolved in #140701 and ready for re-evaluation. * Refactor authentication retry logic in ServerUtils Removed unnecessary boolean flag for retrying on authentication failure * Fix Docker log dumps Fixed the problem with running `docker logs null` after test failure. The problem was caused by calling the `removeContainer()` before `dumpDebug()` because `dumpDebug()` is called from the @rule on the base class and `removeContainer()` from @after method on the child class. * Fix conditional logic in ServerUtils for cluster health check Adjusted logic to properly set the `started` flag only after a successful cluster health API response. * Make the logging less verbose This warning log with exception was very loud and sometimes hide the real issue. It has been changed to only log the exception message. (cherry picked from commit bb91f1e) # Conflicts: # muted-tests.yml
elasticsearchmachine
pushed a commit
that referenced
this pull request
Jan 26, 2026
…41098) (#141295) * Unmute DockerTests in muted-tests.yml Removed muting for multiple Docker-related integration tests in `muted-tests.yml`, as they are likely resolved in #140701 and ready for re-evaluation. * Refactor authentication retry logic in ServerUtils Removed unnecessary boolean flag for retrying on authentication failure * Fix Docker log dumps Fixed the problem with running `docker logs null` after test failure. The problem was caused by calling the `removeContainer()` before `dumpDebug()` because `dumpDebug()` is called from the @rule on the base class and `removeContainer()` from @after method on the child class. * Fix conditional logic in ServerUtils for cluster health check Adjusted logic to properly set the `started` flag only after a successful cluster health API response. * Make the logging less verbose This warning log with exception was very loud and sometimes hide the real issue. It has been changed to only log the exception message. (cherry picked from commit bb91f1e) # Conflicts: # muted-tests.yml
elasticsearchmachine
pushed a commit
that referenced
this pull request
Jan 26, 2026
…41098) (#141296) * Unmute DockerTests in muted-tests.yml Removed muting for multiple Docker-related integration tests in `muted-tests.yml`, as they are likely resolved in #140701 and ready for re-evaluation. * Refactor authentication retry logic in ServerUtils Removed unnecessary boolean flag for retrying on authentication failure * Fix Docker log dumps Fixed the problem with running `docker logs null` after test failure. The problem was caused by calling the `removeContainer()` before `dumpDebug()` because `dumpDebug()` is called from the @rule on the base class and `removeContainer()` from @after method on the child class. * Fix conditional logic in ServerUtils for cluster health check Adjusted logic to properly set the `started` flag only after a successful cluster health API response. * Make the logging less verbose This warning log with exception was very loud and sometimes hide the real issue. It has been changed to only log the exception message. (cherry picked from commit bb91f1e) # Conflicts: # muted-tests.yml
This was referenced Jan 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a bug in the Docker packaging test infrastructure where bash error messages leak into process detection output, causing the wait loop to exit early with a false positive.
This bug is related to the following issues, but could also relate to previously muted docker tests:
The Problem
Test
test072RunEsAsDifferentUserAndGroupwas failing periodically because thecertsdirectory wasn't found - but the real issue was that Elasticsearch never started at all.The Clue
The test logs showed something suspicious:
The script found a Java process (PID 95), but it subsequently failed to read
/proc/95/cmdline. Bash printed an error, and the script returned0processes found.But then the test immediately proceeded as if ES had started. Why?
The Bug
The wait loop checks:
The error message
bash: line 1: ...contains"1". This matched the check, causing the loop to exit after 4 seconds instead of waiting 45.Root Cause
The script uses input redirection:
cmdline=$(tr "\0" " " < /proc/$pid/cmdline 2>/dev/null)When the file doesn't exist, bash opens it and prints the error. The
2>/dev/nullonly applies totr, not to bash's redirection. Withdocker exec --tty, stderr mixes into the output.The Fix
Use
catinstead:cmdline=$(cat /proc/$pid/cmdline 2>/dev/null | tr "\0" " ")Now
catopens the file, so its2>/dev/nullproperly suppresses the error.