diff --git a/server/core/config.c b/server/core/config.c index c0113d001..acf133a92 100644 --- a/server/core/config.c +++ b/server/core/config.c @@ -898,7 +898,7 @@ process_config_context(CONFIG_CONTEXT *context) s = strtok_r(NULL, ",", &lasts); } } - else if (servers == NULL && !isInternalService(router)) + else if (servers == NULL && !isInternalService(router) && strcmp(router,"binlogrouter")) { LOGIF(LE, (skygw_log_write_flush( LOGFILE_ERROR, diff --git a/server/core/dbusers.c b/server/core/dbusers.c index 93eaa618f..5b9416fff 100644 --- a/server/core/dbusers.c +++ b/server/core/dbusers.c @@ -2406,15 +2406,21 @@ bool check_service_permissions(SERVICE* service) if(mysql_real_connect(mysql,server->server->name,user,dpasswd,NULL,server->server->port,NULL,0) == NULL) { + int my_errno = mysql_errno(mysql); + skygw_log_write(LE,"%s: Error: Failed to connect to server %s(%s:%d) when" - " checking authentication user credentials and permissions.", + " checking authentication user credentials and permissions: %d %s", service->name, server->server->unique_name, server->server->name, - server->server->port); + server->server->port, + my_errno, + mysql_error(mysql)); mysql_close(mysql); free(dpasswd); - return false; + + /** We don't know enough about user permissions */ + return my_errno != ER_ACCESS_DENIED_ERROR; } if(mysql_query(mysql,"SELECT user, host, password,Select_priv FROM mysql.user limit 1") != 0) @@ -2424,6 +2430,7 @@ bool check_service_permissions(SERVICE* service) skygw_log_write(LE,"%s: Error: User '%s' is missing SELECT privileges" " on mysql.user table. MySQL error message: %s", service->name,user,mysql_error(mysql)); + rval = false; } else { @@ -2431,7 +2438,6 @@ bool check_service_permissions(SERVICE* service) " MySQL error message: %s", service->name,mysql_error(mysql)); } - rval = false; } else { @@ -2442,9 +2448,8 @@ bool check_service_permissions(SERVICE* service) service->name,mysql_error(mysql)); mysql_close(mysql); free(dpasswd); - return false; + return true; } - mysql_free_result(res); } if(mysql_query(mysql,"SELECT user, host, db FROM mysql.db limit 1") != 0) @@ -2453,13 +2458,13 @@ bool check_service_permissions(SERVICE* service) { skygw_log_write(LE,"%s: Error: User '%s' is missing SELECT privileges on mysql.db table. MySQL error message: %s", service->name,user,mysql_error(mysql)); + rval = false; } else { skygw_log_write(LE,"%s: Error: Failed to query from mysql.db table. MySQL error message: %s", service->name,mysql_error(mysql)); } - rval = false; } else { @@ -2467,7 +2472,6 @@ bool check_service_permissions(SERVICE* service) { skygw_log_write(LE,"%s: Error: Result retrieval failed when checking for permissions to the mysql.db table: %s", service->name,mysql_error(mysql)); - rval = false; } else { diff --git a/server/core/service.c b/server/core/service.c index a281db608..bc534f6b7 100644 --- a/server/core/service.c +++ b/server/core/service.c @@ -235,11 +235,11 @@ GWPROTOCOL *funcs; { LOGIF(LE, (skygw_log_write_flush( LOGFILE_ERROR, - "Error : Unable to load users from %s:%d for " - "service %s.", + "Error : Unable to load users for " + "service %s listening at %s:%d.", + service->name, (port->address == NULL ? "0.0.0.0" : port->address), - port->port, - service->name))); + port->port))); { /* Try loading authentication data from file cache */