From 225e18414557522f3af1b605c3aacb77ff8f226c Mon Sep 17 00:00:00 2001 From: Zhihong Lin Date: Thu, 12 Dec 2024 12:31:41 -0500 Subject: [PATCH] Add error code logging for bad credental requests --- src/aws/flb_aws_credentials_http.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/aws/flb_aws_credentials_http.c b/src/aws/flb_aws_credentials_http.c index a609758b9e6..3e85b6f81b0 100644 --- a/src/aws/flb_aws_credentials_http.c +++ b/src/aws/flb_aws_credentials_http.c @@ -463,6 +463,10 @@ static int http_credentials_request(struct flb_aws_provider_http if (!c || c->resp.status != 200) { flb_debug("[aws_credentials] http credentials request failed"); if (c) { + if (c->resp.payload_size > 0) { + flb_aws_print_error_code(c->resp.payload, c->resp.payload_size, + "ContainerCredentialsLocalServer"); + } flb_http_client_destroy(c); } if (auth_token) {