[Mod_log_sql] [error] mysql_query returned (1)

elodieuse at gmail.com elodieuse at gmail.com
Mon May 10 07:32:15 EDT 2010


Greetings,

I have several errors from the module mod_log_sql. And sometimes, i have 
a big error which fridge all the requests on Apache.

With "LogLevel warn" :

[13:22:58] root@****:~$  tail -f /var/log/httpd/error.log
[Mon May 10 13:23:06 2010] [error] mysql_query returned (1)
[Mon May 10 13:23:06 2010] [notice] db reconnect successful
[Mon May 10 13:23:07 2010] [error] mysql_query returned (1)
[Mon May 10 13:23:07 2010] [notice] db reconnect successful
[Mon May 10 13:23:07 2010] [error] mysql_query returned (1)
[Mon May 10 13:23:07 2010] [notice] db reconnect successful
[Mon May 10 13:23:07 2010] [error] mysql_query returned (1)
[Mon May 10 13:23:07 2010] [notice] db reconnect successful
........ (etc)

and sometimes :
Mon May 10 12:12:47 2010] [error] mod_log_sql_mysql: database connection 
error: mysql error: Lost connection to MySQL server at 'reading initial 
communication packet', system error: 0
Mon May 10 12:12:47 2010] [error] reconnect failed, unable to reach 
database. SQL logging stopped until child regains a db connection.
Mon May 10 12:12:47 2010] [error] log entries are being preserved in 
/usr/local/httpd/logs/mod_log_sql-preserve



And with "LogLevel debug" :

[Mon May 10 13:18:17 2010] [debug] mod_log_sql.c(1045): mod_log_sql: 
access string: insert  into apache 
(agent,request_args,bytes_sent,request_file,request_protocol,remote_host,id,remote_logname,machine_id,request_method,child_pid,server_port,referer,request_line,time_stamp,status,request_duration,request_time,request_uri,remote_user,virtual_host) 
values ('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; 
SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; InfoPath.2; .NET CLR 
3.5.30729; OfficeLiveConnector.1.3; OfficeLivePatch.0.0; .NET CLR 
3.0.30729)','?do=babblebox','3648','/home/httpd/m/i/c/mick/www.rpgillusion.net/game/index.php','HTTP/1.0','80.214.253.69','S at frebylxL0AAG8SH4sAAAAH',NULL,'web01','GET','28434','80','http://www.rpgillusion.net/game/index.php','GET 
/game/index.php?do=babblebox 
HTTP/1.0','1273490297','200','0','[10/May/2010:13:18:17 
+0200]','/game/index.php','-','www.rpgillusion.net')
[Mon May 10 13:18:17 2010] [error] mysql_query returned (1)
[Mon May 10 13:18:17 2010] [debug] mod_log_sql_mysql.c(54): HOST: 
'sql.franceserv.fr' PORT: '3306' DB: 'franceserv-db10' USER: 'root' 
SOCKET: '/var/run/mysqld/mysql.sock'
[Mon May 10 13:18:17 2010] [notice] db reconnect successful
[Mon May 10 13:18:17 2010] [debug] mod_log_sql.c(1045): mod_log_sql: 
access string: insert  into apache 
(agent,request_args,bytes_sent,request_file,request_protocol,remote_host,id,remote_logname,machine_id,request_method,child_pid,server_port,referer,request_line,time_stamp,status,request_duration,request_time,request_uri,remote_user,virtual_host) 
values ('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET 
CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 
3.5.21022)','?do=babblebox','3648','/home/httpd/m/i/c/mick/www.rpgillusion.net/game/index.php','HTTP/1.1','193.202.78.126','S at frebylxL0AAG8SH4wAAAAG',NULL,'web01','GET','28434','80','http://www.rpgillusion.net/game/index.php','GET 
/game/index.php?do=babblebox 
HTTP/1.1','1273490297','200','0','[10/May/2010:13:18:17 
+0200]','/game/index.php','-','www.rpgillusion.net')
[Mon May 10 13:18:17 2010] [error] mysql_query returned (1)
[Mon May 10 13:18:17 2010] [debug] mod_log_sql_mysql.c(54): HOST: 
'sql.franceserv.fr' PORT: '3306' DB: 'franceserv-db10' USER: 'root' 
SOCKET: '/var/run/mysqld/mysql.sock'
[Mon May 10 13:18:17 2010] [notice] db reconnect successful
..... (etc)

My config is :

LoadModule log_sql_module modules/mod_log_sql.so
LoadModule log_sql_mysql_module modules/mod_log_sql_mysql.so
LogSQLLoginInfo 
mysql://root:********************@sql.franceserv.fr/franceserv-db10
LogSQLDBParam socketfile /var/run/mysqld/mysql.sock
#LogSQLCreateTables on
#LogSQLMassVirtualHosting On
LogSQLMachineID web01
LogSQLTransferLogFormat AabfHhIlMmPpRrSsTtUuV
LogSQLRequestAccept .html .htm .php
LogSQLTransferLogTable apache
LogSQLCookieLogTable cookie
LogSQLHeadersInLogTable headers_in
LogSQLHeadersOutLogTable headers_out
LogSQLNotesLogTable notes
LogSQLRequestIgnore statistics.html bluedot.jpg root.exe cmd.exe default.ida

And my SQL table :

mysql> describe apache;
+------------------+----------------------+------+-----+---------+-------+
| Field            | Type                 | Null | Key | Default | Extra |
+------------------+----------------------+------+-----+---------+-------+
| id               | char(19)             | YES  |     | NULL    |       |
| agent            | varchar(255)         | YES  |     | NULL    |       |
| bytes_sent       | int(10) unsigned     | YES  |     | NULL    |       |
| child_pid        | smallint(5) unsigned | YES  |     | NULL    |       |
| machine_id       | varchar(25)          | YES  |     | NULL    |       |
| request_file     | varchar(255)         | YES  |     | NULL    |       |
| referer          | varchar(255)         | YES  |     | NULL    |       |
| remote_host      | varchar(50)          | YES  |     | NULL    |       |
| remote_logname   | varchar(50)          | YES  |     | NULL    |       |
| remote_user      | varchar(50)          | YES  |     | NULL    |       |
| request_duration | smallint(5) unsigned | YES  |     | NULL    |       |
| request_line     | varchar(255)         | YES  |     | NULL    |       |
| request_method   | varchar(10)          | YES  |     | NULL    |       |
| request_protocol | varchar(10)          | YES  |     | NULL    |       |
| request_time     | char(28)             | YES  |     | NULL    |       |
| request_uri      | varchar(255)         | YES  |     | NULL    |       |
| request_args     | varchar(255)         | YES  |     | NULL    |       |
| server_port      | smallint(5) unsigned | YES  |     | NULL    |       |
| ssl_cipher       | varchar(25)          | YES  |     | NULL    |       |
| ssl_keysize      | smallint(5) unsigned | YES  |     | NULL    |       |
| ssl_maxkeysize   | smallint(5) unsigned | YES  |     | NULL    |       |
| status           | smallint(5) unsigned | YES  |     | NULL    |       |
| time_stamp       | int(10) unsigned     | YES  |     | NULL    |       |
| virtual_host     | varchar(255)         | YES  |     | NULL    |       |
+------------------+----------------------+------+-----+---------+-------+

If i execute etch sql query by the hand, it's work correctly in PhpMyAdmin.

Someone could you help me please ?
Thanks so much :)


More information about the Mod_log_sql mailing list