[MXS-1677] "Query could not be parsed" errors Created: 2018-02-20  Updated: 2018-03-12  Resolved: 2018-03-12

Status: Closed
Project: MariaDB MaxScale
Component/s: Core
Affects Version/s: 2.2
Fix Version/s: 2.2.3

Type: Bug Priority: Major
Reporter: Kathryn Sizemore Assignee: markus makela
Resolution: Fixed Votes: 1
Labels: None

Attachments: File maxscale.cnf    
Issue Links:
Relates
relates to MXS-1329 Using filters with SSL and keep alive... Closed

 Description   

Not using filters or SSL. Not the same as MXS-1329.
See attachment for maxscale.cnf file with redaction.

Receiving the following error:

2018-02-20 23:32:26 error : (452) [qc_sqlite] The provided buffer does not contain a COM_QUERY, but a COM_QUIT.
2018-02-20 23:32:26 error : (452) [qc_sqlite] The query could not be parsed. Response not valid.
2018-02-20 23:33:16 error : (514) [qc_sqlite] The provided buffer does not contain a COM_QUERY, but a COM_QUIT.
2018-02-20 23:33:16 error : (514) [qc_sqlite] The query could not be parsed. Response not valid.
2018-02-20 23:33:17 error : (512) [qc_sqlite] The provided buffer does not contain a COM_QUERY, but a COM_QUIT.
2018-02-20 23:33:17 error : (512) [qc_sqlite] The query could not be parsed. Response not valid.
2018-02-20 23:33:22 error : (528) [qc_sqlite] The provided buffer does not contain a COM_QUERY, but a COM_QUIT.
2018-02-20 23:33:22 error : (528) [qc_sqlite] The query could not be parsed. Response not valid.
2018-02-20 23:34:05 error : (584) [qc_sqlite] The provided buffer does not contain a COM_QUERY, but a COM_QUIT.
2018-02-20 23:34:05 error : (584) [qc_sqlite] The query could not be parsed. Response not valid.
2018-02-20 23:34:14 error : (592) [qc_sqlite] The provided buffer does not contain a COM_QUERY, but a COM_QUIT.
2018-02-20 23:34:14 error : (592) [qc_sqlite] The query could not be parsed. Response not valid.
2018-02-20 23:34:50 error : (637) [qc_sqlite] The provided buffer does not contain a COM_QUERY, but a COM_QUIT.
2018-02-20 23:34:50 error : (637) [qc_sqlite] The query could not be parsed. Response not valid.
2018-02-20 23:35:01 error : (654) [qc_sqlite] The provided buffer does not contain a COM_QUERY, but a COM_QUIT.
2018-02-20 23:35:01 error : (654) [qc_sqlite] The query could not be parsed. Response not valid.
2018-02-20 23:35:09 error : (668) [qc_sqlite] The provided buffer does not contain a COM_QUERY, but a COM_QUIT.
2018-02-20 23:35:09 error : (668) [qc_sqlite] The query could not be parsed. Response not valid.
2018-02-20 23:35:25 error : (687) [qc_sqlite] The provided buffer does not contain a COM_QUERY, but a COM_QUIT.
2018-02-20 23:35:25 error : (687) [qc_sqlite] The query could not be parsed. Response not valid.
2018-02-20 23:35:54 error : (721) [qc_sqlite] The provided buffer does not contain a COM_QUERY, but a COM_QUIT.
2018-02-20 23:35:54 error : (721) [qc_sqlite] The query could not be parsed. Response not valid.



 Comments   
Comment by Dipti Joshi (Inactive) [ 2018-02-23 ]

Please post your query here ksizemor

Comment by Kathryn Sizemore [ 2018-02-24 ]

Here's what I've pulled from the mysql general log. These queries are being run when the errors above appear. During that short period MaxScale also stops responding and the website locks up.

START TRANSACTION;
INSERT INTO `catalogsearch_query` (`query_text`, `popularity`, `store_id`, `is_active`, `is_processed`, `updated_at`, `ip_address`) VALUES ('Blackhawk!', '1', '1', '0', '0', '2018-02-24 01:34:49', '12.69.234.140');
COMMIT;

START TRANSACTION;
UPDATE `catalogsearch_query` SET `query_text` = 'Blackhawk!', `popularity` = '1', `store_id` = '1', `is_active` = '1', `is_processed` = '0', `updated_at` = '2018-02-24 01:34:49', `ip_address` = '12.69.234.140' WHERE (query_id='470135');
COMMIT;

START TRANSACTION;
UPDATE `catalogsearch_query` SET `query_text` = 'Blackhawk!', `num_results` = '0', `popularity` = '1', `store_id` = '1', `is_active` = '1', `is_processed` = '1', `updated_at` = '2018-02-24 01:34:49', `ip_address` = '12.69.234.140' WHERE (query_id='470135');
COMMIT;

SELECT `main_table`.* FROM `m_searchsphinx_synonym` AS `main_table` WHERE (FIND_IN_SET('Blackhawk!', synonyms));

SELECT `main_table`.* FROM `m_searchsphinx_stopword` AS `main_table` WHERE (`word` = 'Blackhawk!') AND (`store` = '1');

START TRANSACTION;
UPDATE `catalogsearch_query` SET `query_text` = 'Blackhawk!', `num_results` = '0', `popularity` = '1', `store_id` = '1', `is_active` = '1', `is_processed` = '1', `updated_at` = '2018-02-24 01:34:49', `ip_address` = '12.69.234.140' WHERE (query_id='470135');
COMMIT;

SELECT `core_url_rewrite`.* FROM `core_url_rewrite` WHERE (request_path IN ('catalogsearch/ajax/suggest/?q=blackhawk!','catalogsearch/ajax/suggest?q=Blackhawk!', 'catalogsearch/ajax/suggest/', 'catalogsearch/ajax/suggest')) AND (store_id IN(0, 1));

SELECT `main_table`.* FROM `m_searchlandingpage` AS `main_table` WHERE (`query_text` = 'Blackhawk!') AND (`is_active` = '1') AND (EXISTS (SELECT * FROM `m_searchlandingpage_store`
AS `page_store_table`
WHERE main_table.page_id = page_store_table.page_id
AND page_store_table.store_id in (0, '1')));

SELECT `catalogsearch_query`.* FROM `catalogsearch_query` WHERE (store_id = '1') AND (query_text = 'Blackhawk!') UNION ALL (SELECT `catalogsearch_query`.* FROM `catalogsearch_query` WHERE (store_id = '1') AND (synonym_for = 'Blackhawk!')) ORDER BY `synonym_for` ASC LIMIT 1;

SELECT DISTINCT IFNULL(synonym_for, query_text) AS `query`, `main_table`.`num_results`, `main_table`.* FROM `catalogsearch_query` AS `main_table` WHERE (num_results > 0 AND display_in_terms = 1 AND query_text LIKE 'Blackhawk!%') AND (store_id = 1) ORDER BY `popularity` DESC;

Comment by Kathryn Sizemore [ 2018-02-24 ]

I have rolled back to MaxScale 2.1 where it works fine. This started immediately after updating to 2.2.

Comment by markus makela [ 2018-02-24 ]

This appears to be triggered by a closed connection after a temporary table is created.

Comment by markus makela [ 2018-02-24 ]

To be more precise, the error message is triggered by the creation of a temporary table. We haven't been able to reproduce the lockup that you've described.

Comment by Todd Stoffel (Inactive) [ 2018-02-24 ]

I have looked at Kathryn's system and examined her general query log. Of the queries she listed above, only the SELECT statements are working. The UPDATE and INSERT statements never make it through MaxScale to the database. MaxScale is not parsing these correctly and never sends them to MariaDB. This causes her website to hang waiting for a reply.

She is using the Magento E-Commerce framework version 1.9 without any changes to the core. This problem surfaced as a result of the upgrade to MaxScale 2.2.

While her example involves a website, I do not believe the source of the query matters. They are properly formed queries and MaxScale should understand them regardless of her application.

This is only the case when the use of a special character is included in the string.

As you can see from her notes above, all of her WRITE statements are wrapped in START TRANSACTION/COMMIT. I don't know if that is related or not but it's worth noting.

When a search is performed using a keyword without a special character (example: "Yahoo"), a result IS returned by MariaDB and MaxScale logs these TWO errors:

[qc_sqlite] The query could not be parsed. Response not valid.
[qc_sqlite] The provided buffer does not contain a COM_QUERY, but a COM_QUIT.

But, when a special character is added to the query (example: "Yahoo!"), a result is NOT returned by MariaDB and MaxScale hangs on the first error:

[qc_sqlite] The query could not be parsed. Response not valid.

Comment by Johan Wikman [ 2018-02-24 ]

There has to be some sofar unknown component affecting the result. Namely, those insert/update transactions are handled just fine when executed using mysql tool.

Comment by Johan Wikman [ 2018-02-24 ]

toddstoffel Which operating system is used?

Would it be possible to get the full MaxScale log?

Comment by markus makela [ 2018-02-24 ]

Please try if it works when only the master server is configured for the readwritesplit service. If this works, it would suggest that a SELECT to a temporary table is done and the returned error causes problem on the client end.

Comment by Todd Stoffel (Inactive) [ 2018-02-24 ]

@Johan, the MaxScale node is running on CentOS 7 and the two MariaDB nodes are running on Ubuntu 16.04.4 LTS

Comment by markus makela [ 2018-03-06 ]

ksizemor and toddstoffel: As the query parsing errors have been fixed, could you create a separate issue for any other problems? This way we can have one bug report per issue.

Comment by markus makela [ 2018-03-12 ]

Closing as fixed as the bug that the issue describes was fixed. If you still have other problems, please open separate issues for them.

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