Skip to content

Commit 28c1494

Browse files
committed
aws_msk_iam: Improve AWS MSK IAM authentication error logging
Signed-off-by: Arbin <[email protected]>
1 parent bbc9841 commit 28c1494

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/aws/flb_aws_msk_iam.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -572,9 +572,12 @@ static void oauthbearer_token_refresh_cb(rd_kafka_t *rk,
572572
/* Generate payload */
573573
payload = build_msk_iam_payload(config, host, creds);
574574
if (!payload) {
575-
flb_error("[aws_msk_iam] failed to generate MSK IAM payload");
575+
flb_error("[aws_msk_iam] failed to generate authentication token. "
576+
"Possible causes: 1) Invalid AWS credentials, "
577+
"2) Missing IAM permissions for kafka-cluster:Connect, "
578+
"3) Incorrect region configuration (%s)", config->region);
576579
flb_aws_credentials_destroy(creds);
577-
rd_kafka_oauthbearer_set_token_failure(rk, "payload generation failed");
580+
rd_kafka_oauthbearer_set_token_failure(rk, "authentication token generation failed");
578581
return;
579582
}
580583

@@ -603,7 +606,7 @@ static void oauthbearer_token_refresh_cb(rd_kafka_t *rk,
603606
rd_kafka_oauthbearer_set_token_failure(rk, errstr);
604607
}
605608
else {
606-
flb_info("[aws_msk_iam] OAuth bearer token refreshed");
609+
flb_debug("[aws_msk_iam] OAuth bearer token refreshed successfully");
607610
}
608611

609612
if (payload) {

0 commit comments

Comments
 (0)