Open cataglyphis opened 1 year ago
Hi @cataglyphis .
It seems that the client (strapi cms) is trying to set sql_require_primary_key=OFF
while Aurora doesn't support modifying it (note that sql_require_primary_key=OFF
is the default anyway).
Why are you creating an issue for ProxySQL other than because "can not start when using proxysql" ?
Is this a proxysql issue? a strapi cms issue? A misconfiguration from your end?
Hi @cataglyphis . It seems that the client (strapi cms) is trying to set
sql_require_primary_key=OFF
while Aurora doesn't support modifying it (note thatsql_require_primary_key=OFF
is the default anyway). Why are you creating an issue for ProxySQL other than because "can not start when using proxysql" ? Is this a proxysql issue? a strapi cms issue? A misconfiguration from your end?
Yes, I understand your questions. But when i change the host address to aurora instance (bypass ProxySQL), then strapi cms can work again. This confused me.
I understand your confusion, but I think you first need to answer this question: why strapi cms tries to set sql_require_primary_key
when connecting to proxysql?
I understand your confusion, but I think you first need to answer this question: why strapi cms tries to set
sql_require_primary_key
when connecting to proxysql?
I will post this issue in strapi repo and hope this can be resolved. Thanks 🙏
I understand your confusion, but I think you first need to answer this question: why strapi cms tries to set
sql_require_primary_key
when connecting to proxysql?
I compare the result of sql command. If set sql_require_primary_key=0
failed, all other sql commands will failed too when using ProxySQL. But with Aurora, the other sql commands can still run successfully even though set sql_require_primary_key=0
failed.
ProxySQL:
MySQL cms@13.57.xx.xx:cms> select version() as version;
1 row in set
Time: 0.179s
MySQL cms@13.57.xx.xx:cms> select version()
1 row in set
Time: 0.179s
MySQL cms@13.57.xx.xx:cms> set session sql_require_primary_key=0;
Query OK, 0 rows affected
Time: 0.172s
MySQL cms@13.57.xx.xx:cms> select version()
(1235, "This version of MySQL doesn't yet support 'Modifying this variable at the session level'")
MySQL cms@13.57.xx.xx:cms> select version()
(1235, "This version of MySQL doesn't yet support 'Modifying this variable at the session level'")
MySQL cms@13.57.xx.xx:cms> select version()
(1235, "This version of MySQL doesn't yet support 'Modifying this variable at the session level'")
MySQL cms@13.57.xx.xx:cms> select version()
(1235, "This version of MySQL doesn't yet support 'Modifying this variable at the session level'")
MySQL cms@13.57.xx.xx:cms>
Aurora:
MySQL cms@13.57.xx.xx:cms> select version()
1 row in set
Time: 0.167s
MySQL cms@13.57.xx.xx:cms> set session sql_require_primary_key=0;
(1235, "This version of MySQL doesn't yet support 'Modifying this variable at the session level'")
MySQL cms@13.57.xx.xx:cms> select version()
1 row in set
Time: 0.160s
MySQL cms@13.57.xx.xx:cms> select version()
1 row in set
Time: 0.169s
MySQL cms@13.57.xx.xx:cms> select version()
1 row in set
Time: 0.163s
Hi @cataglyphis .
Ok, from the above output it seems that strapi cms executes that command no matter the backend, but if executed through proxysql it then fails to make progress.
You can create a query rule to filter this query. Something like the following (adjust rule_id
and other columns if needed):
INSERT INTO mysql_query_rules (rule_id, active, match_pattern, OK_msg) VALUES
(1,1,'^SET.*sql_require_primary_key', '');
LOAD MYSQL QUERY RULES TO RUNTIME;
We need a better way to handle this issue transparently without the need for a query rules. Please do not close this issue yet. Thanks
Just an FYI in case anyone stumbles across this. AFAIK, from Aurora version 3.03(8.0.26 compat) you should be able to set sql_require_primary_key
on writers and readers(kinda redundant on readers since they are always innodb_read_only
in Aurora), provided the user running set has the session_variables_admin dynamic privilege.
Its nice insurance, but prob not best for a client to be automatically trying to set a "restricted" session variable by default on connect.
Strapi cms service can not start when using proxysql, but when we change the MySQL endpoint to
pre-us-instance-1.cp22vumu2eah.us-west-1.rds.amazonaws.com
, everything worked well. It looks that strapi service want to set session variable, but failed.MySQL Servers:
Aurora Config:
MySQL User:
Server Status:
pre-us-instance-1
is the writer instance, andpre-us-instance-1-us-west-1b
is the reader instance.Proxy Rules: