Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProxySQL crashed when SET character_set_results = utf8mb3 #4269

Closed
apopercona opened this issue Jun 26, 2023 · 1 comment
Closed

ProxySQL crashed when SET character_set_results = utf8mb3 #4269

apopercona opened this issue Jun 26, 2023 · 1 comment

Comments

@apopercona
Copy link

DESCRIPTION

ProxySQL crashed when SET character_set_results = utf8mb3. It automatically start after crash.

proxysql connection error

mysql> SET character_set_results = utf8mb3 ;
ERROR 2013 (HY000): Lost connection to MySQL server during query
No connection. Trying to reconnect...
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.122.190:6033' (111)
ERROR:
Can't connect to the server

proxysql.log

2023-06-26 10:26:23 MySQL_Session.cpp:6345:handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_COM_QUERY_qpo(): [ERROR] Cannot find charset/collation [utf8mb3]
proxysql: MySQL_Session.cpp:6346: bool MySQL_Session::handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_COM_QUERY_qpo(PtrSize_t*, bool*, bool): Assertion `0' failed.
Error: signal 6:
/usr/bin/proxysql(_Z13crash_handleri+0x2a)[0x5e253a]

HOW TO REPEAT :

Softwares :

shell> cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)

shell> yum list installed | egrep 'percona-server|proxysql'
percona-server-client.x86_64 8.0.33-25.1.el7 @ps-80-release-x86_64
percona-server-shared.x86_64 8.0.33-25.1.el7 @ps-80-release-x86_64
percona-server-shared-compat.x86_64 8.0.33-25.1.el7 @ps-80-release-x86_64
proxysql.x86_64 2.5.3-1 @proxysql_repo

Connect as ProxySQL admin and create the user

shell> mysql -uadmin -padmin -h127.0.0.1 -P6032 --prompt 'ProxySQLAdmin> '

ProxySQLAdmin> INSERT INTO mysql_users(username,password,default_hostgroup) VALUES ('app1','*4AB1BBFA6C98F39747064D14C4D913BCA460A206',11);
ProxySQLAdmin> LOAD MYSQL USERS TO RUNTIME;
ProxySQLAdmin> SAVE MYSQL USERS TO DISK;

Connect to ProxySQL and crash will happen when we execute "SET character_set_results = utf8mb3;"

shell> mysql -uapp1 -pSecret1! -h192.168.122.190 -P6033
[...]
Server version: 5.5.30 (ProxySQL)
[...]
mysql> SET character_set_results = utf8mb3 ;
ERROR 2013 (HY000): Lost connection to MySQL server during query
No connection. Trying to reconnect...
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.122.190:6033' (111)
ERROR:
Can't connect to the server

WORKAROUND : None at the moment

Full log

/var/lib/proxysql/proxysql.log

2023-06-26 10:25:31 [INFO] ProxySQL version 2.5.3-89-g86ce115
2023-06-26 10:25:31 [INFO] Detected OS: Linux c7-190-ha 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
2023-06-26 10:25:31 [INFO] ProxySQL SHA1 checksum: 542ec44d0b4668ffd849ef3cce8ad03224a79463
2023-06-26 10:25:31 [INFO] Starting ProxySQL
2023-06-26 10:25:31 [INFO] Successfully started
2023-06-26 10:25:31 [INFO] Angel process started ProxySQL process 5002
2023-06-26 10:25:31 [INFO] SSL keys/certificates found in datadir (/var/lib/proxysql): loading them.
2023-06-26 10:25:31 [INFO] Loaded built-in SQLite3
Standard ProxySQL MySQL Logger rev. 2.5.0421 -- MySQL_Logger.cpp -- Mon Jun 19 19:55:05 2023
Standard ProxySQL Cluster rev. 0.4.0906 -- ProxySQL_Cluster.cpp -- Mon Jun 19 19:55:05 2023
Standard ProxySQL Statistics rev. 1.4.1027 -- ProxySQL_Statistics.cpp -- Mon Jun 19 19:55:05 2023
Standard ProxySQL HTTP Server Handler rev. 1.4.1031 -- ProxySQL_HTTP_Server.cpp -- Mon Jun 19 19:55:05 2023
2023-06-26 10:25:31 [INFO] Using UUID from database: a3cc9575-9404-429b-89be-deca0f9e0acb
2023-06-26 10:25:31 [INFO] Computed checksum for 'LOAD ADMIN VARIABLES TO RUNTIME' was '0x3A8D4652D65FCE60', with epoch '1687746331'
2023-06-26 10:25:31 [INFO] Computed checksum for 'LOAD MYSQL VARIABLES TO RUNTIME' was '0xAA126AC5C26167ED', with epoch '1687746331'
Standard ProxySQL Admin rev. 2.0.6.0805 -- ProxySQL_Admin.cpp -- Mon Jun 19 19:55:05 2023
2023-06-26 10:25:31 [INFO] ProxySQL SHA1 checksum: 542ec44d0b4668ffd849ef3cce8ad03224a79463
Standard MySQL Threads Handler rev. 0.2.0902 -- MySQL_Thread.cpp -- Mon Jun 19 19:55:05 2023
Standard MySQL Authentication rev. 0.2.0902 -- MySQL_Authentication.cpp -- Mon Jun 19 19:55:05 2023
2023-06-26 10:25:31 [INFO] Computed checksum for 'LOAD MYSQL USERS TO RUNTIME' was '0xDB274C6ED77C4711', with epoch '1687746331'
2023-06-26 10:25:31 [INFO] Dumping mysql_servers_incoming
+--------------+----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| hostgroup_id | hostname | port | gtid_port | weight | status | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
+--------------+----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
+--------------+----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
2023-06-26 10:25:31 [INFO] Dumping mysql_servers LEFT JOIN mysql_servers_incoming
+-------------+--------------+----------+------+
| mem_pointer | hostgroup_id | hostname | port |
+-------------+--------------+----------+------+
+-------------+--------------+----------+------+
2023-06-26 10:25:31 [INFO] Dumping mysql_servers JOIN mysql_servers_incoming
+--------------+----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+-------------+-----------+--------+--------+-------------+-----------------+-------
--------------+---------+----------------+---------+
| hostgroup_id | hostname | port | gtid_port | weight | status | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment | mem_pointer | gtid_port | weight | status | compression | max_connections | max_re
plication_lag | use_ssl | max_latency_ms | comment |
+--------------+----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+-------------+-----------+--------+--------+-------------+-----------------+-------
--------------+---------+----------------+---------+
+--------------+----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+-------------+-----------+--------+--------+-------------+-----------------+-------
--------------+---------+----------------+---------+
2023-06-26 10:25:31 [INFO] New mysql_group_replication_hostgroups table
2023-06-26 10:25:31 [INFO] New mysql_galera_hostgroups table
2023-06-26 10:25:31 [INFO] New mysql_aws_aurora_hostgroups table
2023-06-26 10:25:31 [INFO] New mysql_hostgroup_attributes table
2023-06-26 10:25:31 [INFO] MySQL_HostGroups_Manager::commit() locked for 1ms
2023-06-26 10:25:31 [INFO] Computed checksum for 'LOAD PROXYSQL SERVERS TO RUNTIME' was '0x0000000000000000', with epoch '1687746331'
Standard Query Processor rev. 2.0.6.0805 -- Query_Processor.cpp -- Mon Jun 19 19:55:05 2023
2023-06-26 10:25:31 [INFO] Computed checksum for 'LOAD MYSQL QUERY RULES TO RUNTIME' was '0x0000000000000000', with epoch '1687746331'
In memory Standard Query Cache (SQC) rev. 1.2.0905 -- Query_Cache.cpp -- Mon Jun 19 19:55:05 2023
Standard MySQL Monitor (StdMyMon) rev. 2.0.1226 -- MySQL_Monitor.cpp -- Mon Jun 19 19:55:05 2023
2023-06-26 10:25:31 [INFO] For information about products and services visit: https://proxysql.com/
2023-06-26 10:25:31 [INFO] For online documentation visit: https://proxysql.com/documentation/
2023-06-26 10:25:31 [INFO] For support visit: https://proxysql.com/services/support/
2023-06-26 10:25:31 [INFO] For consultancy visit: https://proxysql.com/services/consulting/
2023-06-26 10:25:31 [INFO] Latest ProxySQL version available: 2.5.3-89-g86ce115
2023-06-26 10:26:23 MySQL_Session.cpp:6345:handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_COM_QUERY_qpo(): [ERROR] Cannot find charset/collation [utf8mb3]
proxysql: MySQL_Session.cpp:6346: bool MySQL_Session::handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_COM_QUERY_qpo(PtrSize_t*, bool*, bool): Assertion `0' failed.
Error: signal 6:
/usr/bin/proxysql(_Z13crash_handleri+0x2a)[0x5e253a]
/lib64/libc.so.6(+0x36400)[0x7fc3033ea400]
/lib64/libc.so.6(gsignal+0x37)[0x7fc3033ea387]
/lib64/libc.so.6(abort+0x148)[0x7fc3033eba78]
/lib64/libc.so.6(+0x2f1a6)[0x7fc3033e31a6]
/lib64/libc.so.6(+0x2f252)[0x7fc3033e3252]
/usr/bin/proxysql(_ZN13MySQL_Session72handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_COM_QUERY_qpoEP10_PtrSize_tPbb+0x383c)[0x6614dc]
/usr/bin/proxysql(_ZN13MySQL_Session20get_pkts_from_clientERbR10_PtrSize_t+0x942)[0x66b682]
/usr/bin/proxysql(_ZN13MySQL_Session7handlerEv+0xa4)[0x66c324]
/usr/bin/proxysql(_ZN12MySQL_Thread20process_all_sessionsEv+0x47c)[0x64c77c]
/usr/bin/proxysql(_ZN12MySQL_Thread3runEv+0x5fa)[0x64d8ea]
/usr/bin/proxysql(_Z24mysql_worker_thread_funcPv+0x6c)[0x5da87c]
/lib64/libpthread.so.0(+0x7ea5)[0x7fc3047d0ea5]
/lib64/libc.so.6(clone+0x6d)[0x7fc3034b296d]
---- /usr/bin/proxysql(_Z13crash_handleri+0x2a) [0x5e253a] : crash_handler(int)
---- /usr/bin/proxysql(_ZN13MySQL_Session20get_pkts_from_clientERbR10_PtrSize_t+0x942) [0x66b682] : MySQL_Session::get_pkts_from_client(bool&, _PtrSize_t&)
---- /usr/bin/proxysql(_ZN13MySQL_Session7handlerEv+0xa4) [0x66c324] : MySQL_Session::handler()
---- /usr/bin/proxysql(_ZN12MySQL_Thread20process_all_sessionsEv+0x47c) [0x64c77c] : MySQL_Thread::process_all_sessions()
---- /usr/bin/proxysql(_ZN12MySQL_Thread3runEv+0x5fa) [0x64d8ea] : MySQL_Thread::run()
---- /usr/bin/proxysql(_Z24mysql_worker_thread_funcPv+0x6c) [0x5da87c] : mysql_worker_thread_func(void*)
To report a crashing bug visit: https://github.com/sysown/proxysql/issues
For support visit: https://proxysql.com/services/support/
2023-06-26 10:26:24 main.cpp:1300:ProxySQL_daemonize_phase3(): [ERROR] ProxySQL crashed. Restarting!
2023-06-26 10:26:24 [INFO] ProxySQL version 2.5.3-89-g86ce115
2023-06-26 10:26:24 [INFO] ProxySQL SHA1 checksum: 542ec44d0b4668ffd849ef3cce8ad03224a79463
2023-06-26 10:26:24 [INFO] Angel process started ProxySQL process 5033
2023-06-26 10:26:24 [INFO] SSL keys/certificates found in datadir (/var/lib/proxysql): loading them.
2023-06-26 10:26:24 [INFO] Loaded built-in SQLite3
Standard ProxySQL MySQL Logger rev. 2.5.0421 -- MySQL_Logger.cpp -- Mon Jun 19 19:55:05 2023
Standard ProxySQL Cluster rev. 0.4.0906 -- ProxySQL_Cluster.cpp -- Mon Jun 19 19:55:05 2023
Standard ProxySQL Statistics rev. 1.4.1027 -- ProxySQL_Statistics.cpp -- Mon Jun 19 19:55:05 2023
Standard ProxySQL HTTP Server Handler rev. 1.4.1031 -- ProxySQL_HTTP_Server.cpp -- Mon Jun 19 19:55:05 2023
2023-06-26 10:26:24 [INFO] Using UUID from database: a3cc9575-9404-429b-89be-deca0f9e0acb
2023-06-26 10:26:24 [INFO] Computed checksum for 'LOAD ADMIN VARIABLES TO RUNTIME' was '0x3A8D4652D65FCE60', with epoch '1687746384'
2023-06-26 10:26:24 [INFO] Computed checksum for 'LOAD MYSQL VARIABLES TO RUNTIME' was '0xAA126AC5C26167ED', with epoch '1687746384'
Standard ProxySQL Admin rev. 2.0.6.0805 -- ProxySQL_Admin.cpp -- Mon Jun 19 19:55:05 2023
2023-06-26 10:26:24 [INFO] ProxySQL SHA1 checksum: 542ec44d0b4668ffd849ef3cce8ad03224a79463
Standard MySQL Threads Handler rev. 0.2.0902 -- MySQL_Thread.cpp -- Mon Jun 19 19:55:05 2023
Standard MySQL Authentication rev. 0.2.0902 -- MySQL_Authentication.cpp -- Mon Jun 19 19:55:05 2023
2023-06-26 10:26:24 [INFO] Computed checksum for 'LOAD MYSQL USERS TO RUNTIME' was '0xDB274C6ED77C4711', with epoch '1687746384'
2023-06-26 10:26:24 [INFO] Dumping mysql_servers_incoming
+--------------+----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| hostgroup_id | hostname | port | gtid_port | weight | status | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
+--------------+----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
+--------------+----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
2023-06-26 10:26:24 [INFO] Dumping mysql_servers LEFT JOIN mysql_servers_incoming
+-------------+--------------+----------+------+
| mem_pointer | hostgroup_id | hostname | port |
+-------------+--------------+----------+------+
+-------------+--------------+----------+------+
2023-06-26 10:26:24 [INFO] Dumping mysql_servers JOIN mysql_servers_incoming
+--------------+----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+-------------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| hostgroup_id | hostname | port | gtid_port | weight | status | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment | mem_pointer | gtid_port | weight | status | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
+--------------+----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+-------------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
+--------------+----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+-------------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
2023-06-26 10:26:24 [INFO] New mysql_group_replication_hostgroups table
2023-06-26 10:26:24 [INFO] New mysql_galera_hostgroups table
2023-06-26 10:26:24 [INFO] New mysql_aws_aurora_hostgroups table
2023-06-26 10:26:24 [INFO] New mysql_hostgroup_attributes table
2023-06-26 10:26:24 [INFO] MySQL_HostGroups_Manager::commit() locked for 1ms
2023-06-26 10:26:24 [INFO] Computed checksum for 'LOAD PROXYSQL SERVERS TO RUNTIME' was '0x0000000000000000', with epoch '1687746384'
Standard Query Processor rev. 2.0.6.0805 -- Query_Processor.cpp -- Mon Jun 19 19:55:05 2023
2023-06-26 10:26:24 [INFO] Computed checksum for 'LOAD MYSQL QUERY RULES TO RUNTIME' was '0x0000000000000000', with epoch '1687746384'
In memory Standard Query Cache (SQC) rev. 1.2.0905 -- Query_Cache.cpp -- Mon Jun 19 19:55:05 2023
Standard MySQL Monitor (StdMyMon) rev. 2.0.1226 -- MySQL_Monitor.cpp -- Mon Jun 19 19:55:05 2023
2023-06-26 10:26:24 [INFO] For information about products and services visit: https://proxysql.com/
2023-06-26 10:26:24 [INFO] For online documentation visit: https://proxysql.com/documentation/
2023-06-26 10:26:24 [INFO] For support visit: https://proxysql.com/services/support/
2023-06-26 10:26:24 [INFO] For consultancy visit: https://proxysql.com/services/consulting/
2023-06-26 10:26:24 [INFO] Latest ProxySQL version available: 2.5.3-89-g86ce115

@apopercona
Copy link
Author

I've got similar result when tested it on proxysql-2.4.8-1 on same CentOS 7 server.

renecannao added a commit that referenced this issue Jun 26, 2023
Fixes issue #4269

proxysql_find_charset_name() converts "utf8mb3" to "utf8".
proxysql_find_charset_collate_names() also remove "mb3" from collation names.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants