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
Document that Matomo won’t work with a MySQL load balancer such as ProxySQL unless... #15113
Comments
Maybe related to #15108 Which DB adapter are you using? Do you know if it's PDO or MySQLI? What's your MySQL version? And do you know if your MySQL user has |
This environment is a little bit more complicated. it uses a 3 node Percona XtraDB Cluster based on mysql 5.5. in between a proxysql mysql loadbalancer. The DB user on Percona side have ALL PRIVILEGES on the Matomo DB.
This should normally not be the case as LOAD DATA INFILE should not be used and other method need to be used instead. Was something changed in this release regarding this? |
You can disable I don't think we changed anything related to that. It might be just that the message is now logged. AFAIK Matomo always tries to use load data infile and then falls back to regular insert if it's not available. By setting above config it will know directly it's not going to work... As for the temporary tables: Do you know if that's maybe an issue with the proxysql mysql loadbalancer? |
Thx,
The error messages when using segments of missing table are still there. |
Could you maybe double check that? Temporary tables are usually bound to a connection/session. Not sure how the loadbalancer works and whether one connection for example would always go to the same DB? The option error I cannot reproduce when load data infile is disabled. Are you familiar with PHP? If so, could you check what query it generates in https://github.com/matomo-org/matomo/blob/3.12.0/core/Db/BatchInsert.php#L41 by eg adding |
Yes, i am very familiar with PHP,
I don't know why this is executed this way?
i have one master db that is used for writes. all other db's are normally only used for reads. its master-master replication, so everything is up2date. |
That query should work. Not sure why it fails for you. The
In Matomo have you configured a reader DB? |
no. proxysql is handling this. matomo have only one normal DB configuration.
|
this error message is just in the System Check |
That would likely be the issue. I'd recommend you disable this behaviour and instead use the reader configuration in Matomo https://matomo.org/faq/how-to-install/faq_35746/ |
Hi, |
The issue now extended to all pages (not only when Segments are used. means the application is now unusable. Any other suggestion what I can check? |
#14919 |
@mstenz what I was meaning Matomo won't run well if you use proxysql for handling this. We do support in the application to configure one reader since the latest release see previously pasted link on how to configure it. Matomo will have random issues if you configure this on proxysql or something similar. @mattab probably need to document this in our FAQ and also our long guide that we don't support MySQL proxies that send read queries to a reader. Instead they need to configure a reader in the Matomo app. |
I have fixed this now with configuring proxysql to only use the writer node hostgroup (that contains only one writer) when the user is the Matomo db user. Still i do not really understand why this issue now is introduced with version 3.12? |
It would be related to temporary tables where it would likely create a temporary table on your writer, insert the data on the writer, but then tries to read the data from a reader where the temp table wouldn't exist. Even if it technically worked before, I doubt your Matomo was reporting 100% correct numbers since if there's just a small delay it would potentially create multiple visits/actions for the same visit, etc. Potentially archive data multiple times etc. |
Found this commit which introduced the Problem: |
@mstenz we will document it in an FAQ. As said, Matomo never supported something like proxysql to begin with and likely you would have gotten wrong data on occasion or even regularly. As mentioned in the other issue #15130 (comment) you can disable this behaviour for now using |
@mattab would maybe put this into the requirements just so it's clear as users might not search for it etc. In https://matomo.org/docs/requirements/ could change
and add afterwards something like this:
|
Now documented in https://matomo.org/docs/requirements/#mysql-user-requirements Thanks for your feedback @mstenz |
I receive a lot of these error messages when using Segments.
These type of tables does not exist (and I do not remember any similar one of them existed before). Here one example error message:
I don't have a cron setup, just normal browser archiving.
Any Idea what might be wrong?
The text was updated successfully, but these errors were encountered: