From: Tatsuo Ishii Date: Sun, 30 Aug 2020 02:35:14 +0000 (+0900) Subject: Display more informative error message in authentication process. X-Git-Tag: V3_6_23~9 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=3dbb8083eefe3cbee295d9b489175891ff257aa0;p=pgpool2.git Display more informative error message in authentication process. When backends offers mistakenly different authentication methods, pgpool just showed: "unable to read message length" "message length (%d) in slot %d does not match with slot 0(%d)", length, i, length0))); because pool_read_message_length() called ereport(ERROR) in this case. Actually the caller pool_do_auth() prepared more informative message: ereport(ERROR, (errmsg("invalid authentication packet from backend"), errdetail("failed to get the authentication packet length"), errhint("This is likely caused by the inconsistency of auth method among DB nodes. \ Please check the previous error messages (hint: length field) \ from pool_read_message_length and recheck the pg_hba.conf settings."))); Change ereport(ERROR) to ereport(LOG) in pool_read_message_length() so that the informative message actually shows up. --- diff --git a/src/auth/pool_auth.c b/src/auth/pool_auth.c index cb37c0aea..7042bb14d 100644 --- a/src/auth/pool_auth.c +++ b/src/auth/pool_auth.c @@ -1130,10 +1130,12 @@ int pool_read_message_length(POOL_CONNECTION_POOL *cp) errdetail("slot: %d length: %d", i, length))); if (length != length0) - ereport(ERROR, - (errmsg("unable to read message length"), - errdetail("message length (%d) in slot %d does not match with slot 0(%d)", length, i, length0))); - + { + ereport(LOG, + (errmsg("unable to read message length"), + errdetail("message length (%d) in slot %d does not match with slot 0(%d)", length, i, length0))); + return -1; + } } if (length0 < 0)