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

Auto-archiving of reports broken since Matomo 3.12.0 #15123

Closed
khromov opened this issue Nov 6, 2019 · 8 comments
Closed

Auto-archiving of reports broken since Matomo 3.12.0 #15123

khromov opened this issue Nov 6, 2019 · 8 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@khromov
Copy link

khromov commented Nov 6, 2019

Seems to be some issue with MySQL:

The error is:

SQLSTATE[HY000]: General error: 1665 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT

Full error:

INFO [2019-11-06 17:09:51] 14902  - pre-processing all visits
ERROR [2019-11-06 17:09:52] 14902  Got invalid response from API request: ?module=API&method=API.get&idSite=11&period=day&date=last5&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:14893:"SQLSTATE[HY000]: General error: 1665 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED. #0 /var/www/xxx.khromov.se/htdocs/libs/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array) #1 /var/www/xxx.khromov.se/htdocs/libs/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array) #2 /var/www/xxx.khromov.se/htdocs/libs/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO piw...', Array
...
@khromov
Copy link
Author

khromov commented Nov 6, 2019

Resolved by setting binlog-format=mixed in /etc/mysql/my.cnf, although I feel like Matomo should warn users about this somehow.

@tsteur
Copy link
Member

tsteur commented Nov 6, 2019

@khromov just to understand things better: any particular reason you were using statement and not for example row?

@mattab wonder if we should recommend row (in case we haven't done this yet on an FAQ).

In general: Matomo should already catch the error and workaround this for statement in https://github.com/matomo-org/matomo/blob/3.12.0/core/Db/TransactionLevel.php#L53-L62 (we even have a comment re catching this error statement). @khromov is there any chance you could send us the full stack trace?

@manusfreedom
Copy link

I think we got the problem, because our Matomo is connected to a MariaDB Galera Cluster and the binlog_format is ROW and we can't change:
https://mariadb.com/kb/en/library/mariadb-galera-cluster-known-limitations/

@manusfreedom
Copy link

INFO [2019-11-07 15:16:48] 123809 Error: Got invalid response from API request: ?module=API&method=API.get&idSite=12&period=day&date=last12&format=php&trigger=archivephp. Response was 'Thu Nov 7 16:16:46 2019 (124058): Warning opcache.file_cache must be a full path of accessible directory. a:2:{s:6:"result";s:5:"error";s:7:"message";s:13138:"Mysqli prepare error: MySQL server has gone away - in plugin Goals #0 /home/mysite.com/public_html/core/ArchiveProcessor/Loader.php(127): Piwik\ArchiveProcessor\PluginsArchiver->callAggregateAllPlugins(455, '0', false) #1 /home/mysite.com/public_html/core/ArchiveProcessor/Loader.php(77): Piwik\ArchiveProcessor\Loader->prepareAllPluginsArchive(455, '0') #2 /home/mysite.com/public_html/core/ArchiveProcessor/Loader.php(63): Piwik\ArchiveProcessor\Loader->prepareArchiveImpl('VisitsSummary') #3 /home/mysite.com/public_html/core/Context.php(75): Piwik\ArchiveProcessor\Loader->Piwik\ArchiveProcessor\{closure}() #4 /home/mysite.com/public_html/core/ArchiveProcessor/Loader.php(64): Piwik\Context::changeIdSite(12, Object(Closure)) #5 /home/mysite.com/public_html/core/Archive.php(867): Piwik\ArchiveProcessor\Loader->prepareArchive('VisitsSummary') #6 /home/mysite.com/public_html/core/Archive.php(677): Piwik\Archive->prepareArchive(Array, Object(Piwik\Site), Object(Piwik\Period\Day)) #7 /home/mysite.com/public_html/core/Archive.php(620): Piwik\Archive->cacheArchiveIdsAfterLaunching(Array, Array) #8 /home/mysite.com/public_html/core/Archive.php(549): Piwik\Archive->getArchiveIds(Array) #9 /home/mysite.com/public_html/core/Archive.php(303): Piwik\Archive->get(Array, 'numeric') #10 /home/mysite.com/public_html/plugins/VisitsSummary/API.php(36): Piwik\Archive->getDataTableFromNumeric(Array) #11 [internal function]: Piwik\Plugins\VisitsSummary\API->get('12', 'day', 'last12', false, Array) #12 /home/mysite.com/public_html/core/API/Proxy.php(237): call_user_func_array(Array, Array) #13 /home/mysite.com/public_html/core/Context.php(28): Piwik\API\Proxy->Piwik\API\{closure}() #14 /home/mysite.com/public_html/core/API/Proxy.php(328): Piwik\Context::executeWithQueryParameters(Array, Object(Closure)) #15 /home/mysite.com/public_html/plugins/API/API.php(435): Piwik\API\Proxy->call('\\Piwik\\Plugins\\...', 'get', Array) #16 [internal function]: Piwik\Plugins\API\API->get('12', 'day', 'last12', false, Array) #17 /home/mysite.com/public_html/core/API/Proxy.php(237): call_user_func_array(Array, Array) #18 /home/mysite.com/public_html/core/Context.php(28): Piwik\API\Proxy->Piwik\API\{closure}() #19 /home/mysite.com/public_html/core/API/Proxy.php(328): Piwik\Context::executeWithQueryParameters(Array, Object(Closure)) #20 /home/mysite.com/public_html/core/API/Request.php(265): Piwik\API\Proxy->call('\\Piwik\\Plugins\\...', 'get', Array) #21 /home/mysite.com/public_html/plugins/API/Controller.php(41): Piwik\API\Request->process() #22 [internal function]: Piwik\Plugins\API\Controller->index() #23 /home/mysite.com/public_html/core/FrontController.php(589): call_user_func_array(Array, Array) #24 /home/mysite.com/public_html/core/FrontController.php(165): Piwik\FrontController->doDispatch('API', false, Array) #25 /home/mysite.com/public_html/core/dispatch.php(34): Piwik\FrontController->dispatch() #26 /home/mysite.com/public_html/index.php(29): require_once('/home/mysite.co...') #27 /home/mysite.com/public_html/core/CliMulti/RequestCommand.php(79): require_once('/home/mysite.co...') #28 /home/mysite.com/public_html/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(257): Piwik\CliMulti\RequestCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #29 /home/mysite.com/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php(874): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #30 /home/mysite.com/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php(195): Symfony\Component\Console\Application->doRunCommand(Object(Piwik\CliMulti\RequestCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #31 [internal function]: Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #32 /home/mysite.com/public_html/core/Console.php(103): call_user_func(Array, Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #33 /home/mysite.com/public_html/core/Access.php(639): Piwik\Console->Piwik\{closure}() #34 /home/mysite.com/public_html/core/Console.php(104): Piwik\Access::doAsSuperUser(Object(Closure)) #35 /home/mysite.com/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php(126): Piwik\Console->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #36 /home/mysite.com/public_html/console(29): Symfony\Component\Console\Application->run() #37 {main}, caused by: Mysqli prepare error: MySQL server has gone away #0 /home/mysite.com/public_html/libs/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('CREATE TEMPORAR...') #1 /home/mysite.com/public_html/libs/Zend/Db/Adapter/Mysqli.php(417): Zend_Db_Statement->__construct(Object(Piwik\Db\Adapter\Mysqli), 'CREATE TEMPORAR...') #2 /home/mysite.com/public_html/lib INFO [2019-11-07 15:16:48] 123809 Error: Empty or invalid response '' for website id 12, Time elapsed: 1.905s, skipping

@tsteur
Copy link
Member

tsteur commented Nov 7, 2019

@manusfreedom MySQL server has gone away seems like a different issue? https://matomo.org/faq/troubleshooting/faq_183/

@manusfreedom
Copy link

@tsteur The problem comes with 3.12.0 update and nothing has change on our infrastructure and all https://matomo.org/faq/troubleshooting/faq_183/ is already respected.

@manens
Copy link

manens commented Dec 22, 2019

Same issue here with Galera, 3.13 do not work 3.11 is ok.

@mattab
Copy link
Member

mattab commented Jan 21, 2020

Can you please create a new issue with the full error message you're getting?

There are a few different error messages in this issue already (which seem not related to Matomo?) so will be better to tackle them separately. Thanks!

@mattab mattab closed this as completed Jan 21, 2020
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

5 participants