diff --git a/server/modules/authenticator/GSSAPI/GSSAPIAuth/gssapi_auth.c b/server/modules/authenticator/GSSAPI/GSSAPIAuth/gssapi_auth.c index d3407a2a4..180b30a89 100644 --- a/server/modules/authenticator/GSSAPI/GSSAPIAuth/gssapi_auth.c +++ b/server/modules/authenticator/GSSAPI/GSSAPIAuth/gssapi_auth.c @@ -601,8 +601,16 @@ int gssapi_auth_load_users(SERV_LISTENER *listener) if (serviceGetUser(listener->service, &user, &pw) && (pw = decrypt_password(pw))) { + bool no_active_servers = true; + for (SERVER_REF *servers = listener->service->dbref; servers; servers = servers->next) { + if (!SERVER_REF_IS_ACTIVE(servers) || !SERVER_IS_ACTIVE(servers->server)) + { + continue; + } + + no_active_servers = false; MYSQL *mysql = mysql_init(NULL); if (mxs_mysql_real_connect(mysql, servers->server, user, pw)) @@ -645,6 +653,11 @@ int gssapi_auth_load_users(SERV_LISTENER *listener) } MXS_FREE(pw); + + if (no_active_servers) + { + rval = MXS_AUTH_LOADUSERS_OK; + } } return rval; diff --git a/server/modules/authenticator/MySQLAuth/dbusers.c b/server/modules/authenticator/MySQLAuth/dbusers.c index a2acf87b2..63f0eeb42 100644 --- a/server/modules/authenticator/MySQLAuth/dbusers.c +++ b/server/modules/authenticator/MySQLAuth/dbusers.c @@ -855,15 +855,18 @@ static int get_users(SERV_LISTENER *listener, bool skip_local) SERVER_REF *server = service->dbref; int total_users = -1; + bool no_active_servers = true; for (server = service->dbref; !service->svc_do_shutdown && server; server = server->next) { - if (skip_local && server_is_mxs_service(server->server)) + if (!SERVER_REF_IS_ACTIVE(server) || !SERVER_IS_ACTIVE(server->server) || + (skip_local && server_is_mxs_service(server->server))) { - total_users = 0; continue; } + no_active_servers = false; + MYSQL *con = gw_mysql_init(); if (con) { @@ -897,7 +900,12 @@ static int get_users(SERV_LISTENER *listener, bool skip_local) MXS_FREE(dpwd); - if (server == NULL && total_users == -1) + if (no_active_servers) + { + // This service has no servers or all servers are local MaxScale services + total_users = 0; + } + else if (server == NULL && total_users == -1) { MXS_ERROR("Unable to get user data from backend database for service [%s]." " Failed to connect to any of the backend databases.", service->name);