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

[#8006] direct stderr to null output when running credential helper #8007

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Smeb
Copy link

@Smeb Smeb commented Dec 29, 2023

Previously, the process stderr would be combined with stdout. This meant that a credential helper which logged to stderr could cause the credential fetching logic to fail.

As described here the protocol only replies on STDOUT, so this should not break any protocol compliant helpers.

fixes: #8006

@Smeb Smeb requested a review from a team as a code owner December 29, 2023 14:17
@eddumelendez
Copy link
Member

@Smeb thanks for your contribution. Just trying to understand a little bit more about, the doc mentions The store command can write error messages to STDOUT but not for the get command, which is used for testcontainers-java. I also tried with a private repo in ECR but didn't get the error. Can you share more about it, please?

@Smeb
Copy link
Author

Smeb commented Mar 28, 2024

Sure - basically the protocol does not expect any protocol specific information on STDERR, and only sends information on STDOUT - so we should not combine STDERR and STDOUT, because in some cases credential helpers can use STDERR for logging.

For us, we have an internal credential helper which writes log messages to STDERR - this works with Docker/Rancher etc as they don't treat STDERR as STDOUT (the behaviour this PR removes). The credential helper does not work when using testcontainers-java because the log messages on STDERR get combined with STDOUT, and then the testcontainer-java tries to read the output and runs into unexpected log messages and crashes.

To deal with this we could either store the messages on stderr and re-emit them, or drop them (the approach taken here). I don't think there's a valid use case where we should treat STDERR as STDOUT when implementing the protocol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: credential-helper stderr is used as stdout
2 participants