From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Jun 21 10:50:28 2005 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 835EA16A41C for ; Tue, 21 Jun 2005 10:50:28 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4E75C43D55 for ; Tue, 21 Jun 2005 10:50:28 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j5LAoSRS030920 for ; Tue, 21 Jun 2005 10:50:28 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j5LAoSnO030919; Tue, 21 Jun 2005 10:50:28 GMT (envelope-from gnats) Resent-Date: Tue, 21 Jun 2005 10:50:28 GMT Resent-Message-Id: <200506211050.j5LAoSnO030919@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Oliver Dumat Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6604716A41C for ; Tue, 21 Jun 2005 10:47:36 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 28B7843D4C for ; Tue, 21 Jun 2005 10:47:36 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j5LAlZmO012555 for ; Tue, 21 Jun 2005 10:47:35 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id j5LAlZOC012533; Tue, 21 Jun 2005 10:47:35 GMT (envelope-from nobody) Message-Id: <200506211047.j5LAlZOC012533@www.freebsd.org> Date: Tue, 21 Jun 2005 10:47:35 GMT From: Oliver Dumat To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: ports/82476: libnss-mysql does not lookup over tcp to a other database server but it works over the local socket X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2005 10:50:28 -0000 >Number: 82476 >Category: ports >Synopsis: libnss-mysql does not lookup over tcp to a other database server but it works over the local socket >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jun 21 10:50:27 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Oliver Dumat >Release: 5.4-RELEASE >Organization: NetKom GmbH (www.netkom-sachsen.de) >Environment: FreeBSD hal 5.4-RELEASE FreeBSD 5.4-RELEASE #0: Sun May 8 10:21:06 UTC 2005 root@harlow.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: Using libnss-mysql-1.4 for looking up on a database server doesn't work. I verify the following: - no firewall blockes the connection on the database server - mysql on the database server is correctly configured and the permissions for the database and the user are set correctly ( the console mysqlclient works perfectly ) - querying through a socket on the local mysql database works as you can see in the debug log the mysql connection attempts return a NSS_UNAVAIL . maybe it helps: ive tested the same thing on a linux machine (querys adapted to fit the passwd entrys of linux but the same databaseserver and the same database) and it works without problems. i sniffed the connection between my freebsd server and the database server - the connection will established and then reseted from the freebsd machine - no data is exchanged (not even the version from the database server). some debug logs: /var/log/messages: Jun 21 12:19:07 hal id: libnss-mysql: Connection to server 'db.databaseserver.local' failed: Can't connect to MySQL server on 'db.databaseserver.local' (22) libnss-mysql-debug-log: [5159]: _nss_mysql_load_config: ENTER [5159]: _nss_mysql_load_config_file: ENTER [5159]: _nss_mysql_load_config_file: Attempting to load: /etc/libnss-mysql.cfg [5159]: _nss_mysql_load_config_file: fopen() successful [5159]: _nss_mysql_next_key: ENTER [5159]: _nss_mysql_next_key: Found: getpwnam -> SELECT domain,'*',sys_user_id + 2000,webspace,'','0','0','World Wide Web Owner',CONCAT('/www/hostings/',domain),'/bin/false' FROM access WHERE domain='%1$s' LIMIT 1 [5159]: _nss_mysql_next_key: EXIT (TRUE) [5159]: _nss_mysql_next_key: ENTER [5159]: _nss_mysql_next_key: Found: getpwuid -> SELECT domain,'*',sys_user_id + 2000,webspace,'','0','0','World Wide Web Owner',CONCAT('/www/hostings/',domain),'/bin/false' FROM access WHERE sys_user_id + 2000 ='%1$s' LIMIT 1 [5159]: _nss_mysql_next_key: EXIT (TRUE) [5159]: _nss_mysql_next_key: ENTER [5159]: _nss_mysql_next_key: Found: getpwent -> SELECT domain,'*',sys_user_id + 2000,webspace,'','0','0','World Wide Web Owner',CONCAT('/www/hostings/',domain),'/bin/false' FROM access [5159]: _nss_mysql_next_key: EXIT (TRUE) [5159]: _nss_mysql_next_key: ENTER [5159]: _nss_mysql_next_key: Found: getgrnam -> SELECT domain,pass,webspace FROM access WHERE domain='%1$s' LIMIT 1 [5159]: _nss_mysql_next_key: EXIT (TRUE) [5159]: _nss_mysql_next_key: ENTER [5159]: _nss_mysql_next_key: Found: getgrgid -> SELECT groupname,'*',gid FROM groups WHERE gid='%1$u' LIMIT 1 [5159]: _nss_mysql_next_key: EXIT (TRUE) [5159]: _nss_mysql_next_key: ENTER [5159]: _nss_mysql_next_key: Found: getgrent -> SELECT domain,pass,webspace FROM access [5159]: _nss_mysql_next_key: EXIT (TRUE) [5159]: _nss_mysql_next_key: ENTER [5159]: _nss_mysql_next_key: Found: memsbygid -> SELECT domain FROM access WHERE webspace='%1$u' [5159]: _nss_mysql_next_key: EXIT (TRUE) [5159]: _nss_mysql_next_key: ENTER [5159]: _nss_mysql_next_key: Found: gidsbymem -> SELECT webspace FROM access WHERE domain='%1$s' [5159]: _nss_mysql_next_key: EXIT (TRUE) [5159]: _nss_mysql_next_key: ENTER [5159]: _nss_mysql_next_key: Found: host -> db.databaseserver.local [5159]: _nss_mysql_next_key: EXIT (TRUE) [5159]: _nss_mysql_next_key: ENTER [5159]: _nss_mysql_next_key: Found: database -> testdb [5159]: _nss_mysql_next_key: EXIT (TRUE) [5159]: _nss_mysql_next_key: ENTER [5159]: _nss_mysql_next_key: Found: username -> username [5159]: _nss_mysql_next_key: EXIT (TRUE) [5159]: _nss_mysql_next_key: ENTER [5159]: _nss_mysql_next_key: Found: password -> password [5159]: _nss_mysql_next_key: EXIT (TRUE) [5159]: _nss_mysql_next_key: ENTER [5159]: _nss_mysql_next_key: Found: port -> 3306 [5159]: _nss_mysql_next_key: EXIT (TRUE) [5159]: _nss_mysql_next_key: ENTER [5159]: _nss_mysql_next_key: EXIT (FALSE) [5159]: _nss_mysql_load_config_file: EXIT [5159]: _nss_mysql_load_config_file: ENTER [5159]: _nss_mysql_load_config_file: Attempting to load: /etc/libnss-mysql-root.cfg [5159]: _nss_mysql_load_config_file: fopen() successful [5159]: _nss_mysql_next_key: ENTER [5159]: _nss_mysql_next_key: Found: getpwnam -> SELECT domain,'*',sys_user_id + 2000,webspace,'','0','0','1World Wide Web Owner',CONCAT('/www/hostings/',domain),'/bin/false' FROM access WHERE domain='%1$s' LIMIT 1 [5159]: _nss_mysql_next_key: EXIT (TRUE) [5159]: _nss_mysql_next_key: ENTER [5159]: _nss_mysql_next_key: Found: getpwuid -> SELECT domain,'*',sys_user_id + 2000,webspace,'','0','0','2World Wide Web Owner',CONCAT('/www/hostings/',domain),'/bin/false' FROM access WHERE sys_user_id + 2000 ='%1$u' LIMIT 1 [5159]: _nss_mysql_next_key: EXIT (TRUE) [5159]: _nss_mysql_next_key: ENTER [5159]: _nss_mysql_next_key: Found: getpwent -> SELECT domain,'*',sys_user_id + 2000,webspace,'','0','0','3World Wide Web Owner',CONCAT('/www/hostings/',domain),'/bin/false' FROM access [5159]: _nss_mysql_next_key: EXIT (TRUE) [5159]: _nss_mysql_next_key: ENTER [5159]: _nss_mysql_next_key: Found: host -> db.databaseserver.local [5159]: _nss_mysql_next_key: EXIT (TRUE) [5159]: _nss_mysql_next_key: ENTER [5159]: _nss_mysql_next_key: Found: database -> testdb [5159]: _nss_mysql_next_key: EXIT (TRUE) [5159]: _nss_mysql_next_key: ENTER [5159]: _nss_mysql_next_key: Found: username -> username [5159]: _nss_mysql_next_key: EXIT (TRUE) [5159]: _nss_mysql_next_key: ENTER [5159]: _nss_mysql_next_key: Found: password -> password [5159]: _nss_mysql_next_key: EXIT (TRUE) [5159]: _nss_mysql_next_key: ENTER [5159]: _nss_mysql_next_key: Found: port -> 3306 [5159]: _nss_mysql_next_key: EXIT (TRUE) [5159]: _nss_mysql_next_key: ENTER [5159]: _nss_mysql_next_key: EXIT (FALSE) [5159]: _nss_mysql_load_config_file: EXIT [5159]: _nss_mysql_validate_config: ENTER [5159]: _nss_mysql_validate_config: EXIT (TRUE) [5159]: _nss_mysql_load_config: EXIT (NSS_SUCCESS) [5159]: _nss_mysql_init: EXIT (NSS_SUCCESS) [5159]: _nss_mysql_load_config: ENTER [5159]: _nss_mysql_load_config: EXIT (NSS_SUCCESS) [5159]: _nss_mysql_build_query: ENTER [5159]: _nss_mysql_build_query: BYNAME, name = 'username' [5159]: _nss_mysql_escape_string: ENTER [5159]: _nss_mysql_connect_sql: ENTER [5159]: _nss_mysql_check_existing_connection: ENTER [5159]: _nss_mysql_check_existing_connection: EXIT (FALSE) [5159]: _nss_mysql_load_config: ENTER [5159]: _nss_mysql_load_config: EXIT (NSS_SUCCESS) [5159]: _nss_mysql_set_options: ENTER [5159]: _nss_mysql_set_options: EXIT [5159]: _nss_mysql_connect_sql: Connecting to db.databaseserver.local [5159]: _nss_mysql_connect_sql: EXIT (NSS_UNAVAIL) [5159]: _nss_mysql_escape_string: EXIT (NSS_UNAVAIL) [5159]: _nss_mysql_build_query: EXIT (NSS_UNAVAIL) [5159]: _nss_mysql_lookup: EXIT (NSS_UNAVAIL) [5159]: _nss_mysql_getpwnam_r: EXIT (NSS_UNAVAIL) [5159]: _nss_mysql_atexit_handler: ENTER [5159]: _nss_mysql_close_sql: ENTER [5159]: _nss_mysql_close_result: ENTER [5159]: _nss_mysql_close_result: EXIT [5159]: _nss_mysql_close_sql: EXIT (NSS_SUCCESS) [5159]: _nss_mysql_safe_memset: ENTER [5159]: _nss_mysql_safe_memset: EXIT (0x2815ab84) [5159]: _nss_mysql_atexit_handler: EXIT >How-To-Repeat: setup the shiped sample database on a database host (not localhost). i don't have the posibility to try it with another 5.4-RELEASE system so i cant proof that it can repeated on it but i hope ;) >Fix: i dont know where but i think the problem can be located in the context of libmysqlclient12 and maybe libpthread (i assume that but im not sure). >Release-Note: >Audit-Trail: >Unformatted: