[MXS-661] Log fills with 'Length (0) is 0 or query string allocation failed' Created: 2016-04-04  Updated: 2018-01-15  Resolved: 2016-04-05

Status: Closed
Project: MariaDB MaxScale
Component/s: schemarouter
Affects Version/s: 1.4.1
Fix Version/s: 1.4.2

Type: Bug Priority: Major
Reporter: Stefan Schüller Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None
Environment:

3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u4 x86_64 GNU/Linux


Issue Links:
Duplicate
is duplicated by MXS-668 Error when parsing query Closed

 Description   

/var/log/maxscale/maxscale1.log fills up with the following:

2016-04-04 14:58:51   error  : Length (0) is 0 or query string allocation failed ((nil)). Buffer is 5 bytes.
2016-04-04 14:58:51   error  : Unable to parse query, out of resources?
2016-04-04 14:58:58   error  : Length (0) is 0 or query string allocation failed ((nil)). Buffer is 5 bytes.
2016-04-04 14:58:58   error  : Unable to parse query, out of resources?
2016-04-04 14:58:59   error  : Length (0) is 0 or query string allocation failed ((nil)). Buffer is 5 bytes.
2016-04-04 14:58:59   error  : Unable to parse query, out of resources?
2016-04-04 14:58:59   error  : Length (0) is 0 or query string allocation failed ((nil)). Buffer is 5 bytes.
2016-04-04 14:58:59   error  : Unable to parse query, out of resources?
2016-04-04 14:59:00   error  : Length (0) is 0 or query string allocation failed ((nil)). Buffer is 5 bytes.
2016-04-04 14:59:00   error  : Unable to parse query, out of resources?
2016-04-04 14:59:00   error  : Length (0) is 0 or query string allocation failed ((nil)). Buffer is 5 bytes.
2016-04-04 14:59:00   error  : Unable to parse query, out of resources?

Current config:

[maxscale]
threads=4
 
[Debug_Interface]
type=service
router=debugcli
 
[Debug_Listener]
type=listener
service=Debug_Interface
protocol=telnetd
address=0.0.0.0
port=4442
 
[CLI]
type=service
router=cli
 
[CLI_Listener]
type=listener
service=CLI
protocol=maxscaled
address=0.0.0.0
port=6603
 
[DB_Listener]
type=listener
service=DB_RW
protocol=MySQLClient
address=0.0.0.0
port=3306
socket=/var/run/maxscale/maxscale.sock
 
[DB_RW]
type=service
router=schemarouter
servers=galera_1,galera_2,galera_3,Local_DB
user=root
passwd=password
auth_connect_timeout=28800
auth_read_timeout=28800
auth_write_timeout=28800
enable_root_user=1
weightby=myweight
ignore_databases_regex=.*
max_sescmd_history=5
 
[Local_DB]
type=server
address=127.0.0.1
port=3307
protocol=MySQLBackend
myweight=50
 
[galera_1]
type=server
address=galeratest1.intern
port=3306
protocol=MySQLBackend
myweight=10
 
[galera_2]
type=server
address=galeratest2.intern
port=3306
protocol=MySQLBackend
myweight=20
 
[galera_3]
type=server
address=galeratest3.intern
port=3306
protocol=MySQLBackend
myweight=10
 
[Galera_Monitor]
type=monitor
module=galeramon
disable_master_failback=1
servers=galera_1, galera_2, galera_3
monitor_interval=10000
user=root
passwd=password



 Comments   
Comment by Johan Wikman [ 2016-04-04 ]

Would you be able to figure out what the query is?

Comment by Stefan Schüller [ 2016-04-04 ]

I added a query log but it's empty. However I did notice that these errors come in bursts of 6 every 10 seconds. In my config the monitor_interval is also 10 seconds.

EDIT: Changing monitor_interval to 20 seconds had no effect. The error is still every 10 seconds. There is a php loop script running that I think establishes a connection every 10 seconds but the query log is empty.

EDIT2: The Issues is triggered by using mysql_ping 'http://php.net/manual/en/function.mysql-ping.php' . The script example will trigger the error. However mysql ping is deprecated and I believe Maxscale does not support 'Automatic reconnection' which is disabled by default in MySQL >= 5.0.3.

Comment by markus makela [ 2016-04-04 ]

This is most likely caused by trying to parse a non-COM_QUERY packet.

Comment by markus makela [ 2016-04-05 ]

Fixed in commit f834b4f5224ce482f697d6b337d65ea7efd3f47b.

The cause was the parsing of non-COM_QUERY packets.

Comment by Timofey Turenko [ 2016-04-20 ]

test added to 'sharding' test (added calls of 'mysql_ping() and checking logs for errors)

Generated at Thu Feb 08 04:00:59 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.