Bug#491691: gnugk: mysql connection loss
Jan Willamowius
jan at willamowius.de
Mon Jul 21 12:16:09 UTC 2008
Hi,
That patch is already included in GnuGk 2.2.7 and it should work fine
in 2.2.6, too.
Regards,
Jan
misi wrote:
> Package: gnugk
> Version: 2:2.2.6-7
> Severity: normal
>
> This patch solved my problem.
> I had been detecting database connection loss without this patch.
> This is piece of log file where You can see the error.
> This is the error message without the patch
> (This ocours after a day or so, until that time, everything is working fine.)
>
>
> 2008/07/06 09:52:06.078 1 RasSrv.cxx(368) RAS RRQ
> Received
> 2008/07/06 09:52:06.079 2 sqlauth.cxx(237) SQLAUTH
> SQLAliasAuth('00361002460'): query failed (1) - MySQL server has gone
> away
> 2008/07/06 09:52:06.079 4 gkauth.cxx(1503) GKAUTH
> SQLAliasAuth
> auth condition not found for alias '00361002460'
> 2008/07/06 09:52:06.079 2 sqlauth.cxx(237) SQLAUTH
> SQLAliasAuth('BKF_HD00361002460'): query failed (1) - MySQL server has
> gone
> away
> 2008/07/06 09:52:06.079 4 gkauth.cxx(1503) GKAUTH
> SQLAliasAuth
> auth condition not found for alias 'BKF_HD00361002460'
> 2008/07/06 09:52:06.079 2 sqlauth.cxx(237) SQLAUTH
> SQLAliasAuth('default'): query failed (1) - MySQL server has gone away
> 2008/07/06 09:52:06.079 4 gkauth.cxx(1503) GKAUTH
> SQLAliasAuth
> auth condition not found for alias 'default'
> 2008/07/06 09:52:06.079 4 gkauth.cxx(1503) GKAUTH
> AliasAuth
> auth condition not found for alias '00361002460'
> 2008/07/06 09:52:06.079 4 gkauth.cxx(1503) GKAUTH
> AliasAuth
> auth condition not found for alias 'BKF_HD00361002460'
> 2008/07/06 09:52:06.079 4 gkauth.cxx(1503) GKAUTH
> AliasAuth
> auth condition not found for alias 'default'
> 2008/07/06 09:52:06.079 3 gkauth.cxx(927) GKAUTH
> AliasAuth
> RRQ check failed
> 2008/07/06 09:52:06.080 2 RasSrv.cxx(413)
> RRJ|193.224.67.1|00361002460:dialedDigits=BKF_HD00361002460:h323_ID|terminal|securityDenial;
> 2008/07/06 09:52:06.080 3 RasSrv.cxx(250) RAS Send to
> 193.224.67.1:1719
> registrationReject {
> requestSeqNum = 52495
> protocolIdentifier = 0.0.8.2250.0.5
> rejectReason = securityDenial <<null>>
> gatekeeperIdentifier = 7 characters {
> 004e 0049 0049 0046 002d 0047 004b NIIF-GK
> }
> }
>
>
> The key is MySQL server is gone(so this line):
>
> 2008/07/06 09:52:06.079 2 sqlauth.cxx(237) SQLAUTH
> SQLAliasAuth('00361002460'): query failed (1) - MySQL server
> has gone away
>
>
> The patch:
> misi at hal:/tmp$ cat gksql_mysql.cxx.diff
> --- gnugk-2.2.6.orig/gksql_mysql.cxx
> +++ gnugk-2.2.6/gksql_mysql.cxx
> @@ -480,6 +480,11 @@
> }
> mysql_options(conn, MYSQL_OPT_CONNECT_TIMEOUT, (const
> char*)&CONNECT_TIMEOUT);
>
> +#if (MYSQL_VERSION_ID >= 50013)
> + my_bool reconnect = 1; // enable auto-reconnect, older versions
> have it on by default
> + mysql_options(conn, MYSQL_OPT_RECONNECT, &reconnect);
> +#endif
> +
> // connect to the MySQL database, try each host on the list in
> // case of failure
> if (mysql_real_connect(conn, m_host, m_username,
> m_password.IsEmpty() ? (const char*)NULL :
> (const char*)m_password,
>
>
>
> -- System Information:
> Debian Release: lenny/sid
> APT prefers testing
> APT policy: (500, 'testing')
> Architecture: i386 (i686)
>
> Kernel: Linux 2.6.25-2-686 (SMP w/2 CPU cores)
> Locale: LANG=hu_HU.UTF-8, LC_CTYPE=hu_HU.UTF-8 (charmap=ISO-8859-2) (ignored: LC_ALL set to hu_HU)
> Shell: /bin/sh linked to /bin/bash
>
> Versions of packages gnugk depends on:
> ii adduser 3.108 add and remove users and groups
> ii libc6 2.7-10 GNU C Library: Shared libraries
> ii libexpat1 2.0.1-4 XML parsing C library - runtime li
> ii libfbclient2 2.0.4.13130-1.ds1-3 Firebird client library
> ii libgcc1 1:4.3.1-2 GCC support library
> ii libldap-2.4-2 2.4.10-2+lenny1 OpenLDAP libraries
> ii libmysqlclient15off 5.0.51a-9+lenny2 MySQL database client library
> ii libopenh323-1.19.1-d 1.19.1~dfsg-3+b1 H.323 aka VoIP library
> ii libpq5 8.3.3-1 PostgreSQL C client library
> ii libpt-1.11.2 1.11.2-2 Portable Windows Library
> ii libsasl2-2 2.1.22.dfsg1-21 Cyrus SASL - authentication abstra
> ii libsdl1.2debian 1.2.13-2 Simple DirectMedia Layer
> ii libssl0.9.8 0.9.8g-10.1 SSL shared libraries
> ii libstdc++6 4.3.1-2 The GNU Standard C++ Library v3
> ii zlib1g 1:1.2.3.3.dfsg-12 compression library - runtime
>
> gnugk recommends no packages.
>
> -- no debconf information
--
Jan Willamowius, jan at willamowius.de, http://www.gnugk.org/
More information about the Pkg-voip-maintainers
mailing list