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

1032 Can't find record in log_conversion #17988

Open
tsteur opened this issue Sep 12, 2021 · 2 comments
Open

1032 Can't find record in log_conversion #17988

tsteur opened this issue Sep 12, 2021 · 2 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc.

Comments

@tsteur
Copy link
Member

tsteur commented Sep 12, 2021

See error below

[2021-09-05 12:27:14] piwik.DEBUG: SELECT /*+ MAX_EXECUTION_TIME(7200000) / / sites 1 / / 2021-09-04,2021-09-05 / / UserCountry / / trigger = CronArchive / log_conversion.idgoal AS idgoal, log_conversion.location_country AS location_country, log_conversion.location_region AS location_region, log_conversion.location_city AS location_city, count() AS 1, count(distinct log_conversion.idvisit) AS 3, ROUND(SUM(log_conversion.revenue),2) AS 2, ROUND(SUM(log_conversion.revenue_subtotal),2) AS 4, ROUND(SUM(log_conversion.revenue_tax),2) AS 5, ROUND(SUM(log_conversion.revenue_shipping),2) AS 6, ROUND(SUM(log_conversion.revenue_discount),2) AS 7, SUM(log_conversion.items) AS 8 FROM log_conversion AS log_conversion WHERE log_conversion.server_time >= ? AND log_conversion.server_time <= ? AND log_conversion.idsite IN (?) GROUP BY log_conversion.idgoal, log_conversion.location_country,
log_conversion.location_region, log_conversion.location_city [] {"class":"UserCountry","request_id":"27169"}

[2021-09-05 12:27:15] piwik.ERROR: Uncaught exception in API: PDOException: SQLSTATE[HY000]: General error: 1032 Can't find record in 'log_conversion' in /libs/Zend/Db/Statement/Pdo.php:233 Stack trace: #0 /libs/Zend/Db/Statement/Pdo.php(233): PDOStatement->execute() #1 /libs/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array) #2 /libs/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array) #3 /libs/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT /+ MAX...', Array) #4 /core/Db/Adapter/Pdo/Mysql.php(335): Zend_Db_Adapter_Pdo_Abstract->query('SELECT /+ MAX...', Array) #5 [internal function]: Piwik\Db\Adapter\Pdo\Mysql->query('SELECT /+ MAX...', Array) #6 /core/DataAccess/ArchivingDbAdapter.php(59): call_user_func_array(Array, Array) #7 /core/DataAccess/LogAggregator.php(1100): Piwik\DataAccess\ArchivingDbAdapter->query(
'SELECT /
+ MAX...', Array) #8 /plugins/UserCountry/Archiver.php(131): Piwik\DataAccess\LogAggregator->queryConversionsByDimension(Array) #9 /plugins/UserCountry/Archiver.php(51): Piwik\Plugins\UserCountry\Archiver->aggregateFromConversions() #10 /core/Plugin/Archiver.php(89): Piwik\Plugins\UserCountry\Archiver->aggregateDayReport() #11 /core/ArchiveProcessor/PluginsArchiver.php(164): Piwik\Plugin\Archiver->callAggregateDayReport() #12 /core/ArchiveProcessor/Loader.php(218): Piwik\ArchiveProcessor\PluginsArchiver->callAggregateAllPlugins('10007', '1144', false) #13 /core/ArchiveProcessor/Loader.php(158): Piwik\ArchiveProcessor\Loader->prepareAllPluginsArchive('10007', '1144')

Happend around 4 times in 2 months. The log_conversion table exists and has around 150K entries (2.5MB).

Ran optimize table log_conversion for now, will see if that helps (likely not).

I will comment again should this happen more often, putting in backlog for now.

@tsteur tsteur added the Bug For errors / faults / flaws / inconsistencies etc. label Sep 12, 2021
@tsteur tsteur added this to the Backlog (Help wanted) milestone Sep 12, 2021
@Starker3
Copy link
Contributor

A similar issue reported by an On-Premise customer:
2021-09-01 8:18:46 11 [ERROR] mysqld: Can't find record in 'matomo_archive_blob_2021_09' 2021-09-01 8:18:46 11 [Warning] Slave SQL: Could not execute Delete_rows_v1 event on table matomo.matomo_archive_blob_2021_09; Can't find record in 'matomo_archive_blob_2021_09', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.000155, end_log_pos 1346502, Gtid 0-840-74984528, Internal MariaDB error code: 1032

MariaDB 10.4.12 with Master-Master replication

Not sure if its related to the issue reported here.

@samjf
Copy link
Contributor

samjf commented May 17, 2022

This still appears to occur. I recently got the following stack trace with the error:

ERROR: Uncaught exception in API: PDOException: SQLSTATE[HY000]: General error: 1032 Can't find record in 'log_conversion' in <root>/libs/Zend/Db/Statement/Pdo.php:233 Stack trace: 
#0 <root>/libs/Zend/Db/Statement/Pdo.php(233): PDOStatement->execute() 
#1 <root>/libs/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array) 
#2 <root>/libs/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array) 
#3 <root>/libs/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT /*+ MAX...', Array) 
#4 <root>/core/Db/Adapter/Pdo/Mysql.php(314): Zend_Db_Adapter_Pdo_Abstract->query('SELECT /*+ MAX...', Array) 
#5 [internal function]: Piwik\Db\Adapter\Pdo\Mysql->query('SELECT /*+ MAX...' Array) 
#6 <root>/core/DataAccess/ArchivingDbAdapter.php(121): call_user_func_array(Array, Array) 
#7 [internal function]: Piwik\DataAccess\ArchivingDbAdapter->callFunction('query', 'SELECT /*+ MAX.
..', Array) 
#8 <root>/core/DataAccess/ArchivingDbAdapter.php(60): call_user_func_array(Array, Array) #9,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

3 participants