Substrate - finalized is zero - substrate

2021-04-11 00:57:24 ✨ Imported #21 (0x5294…9b0d)
2021-04-11 00:57:25 💤 Idle (0 peers), best: #21 (0x5294…9b0d), finalized #0 (0xd6bc…1466), ⬇ 0 ⬆ 0
2021-04-11 00:57:30 🙌 Starting consensus session on top of parent 0x52948c20547a22e572dff573fa64aa37321a96e3b3b46c1b6fb4494a7ae19b0d
2021-04-11 00:57:30 🎁 Prepared block for proposing at 22 [hash: 0xdddef9d6170c36580077eda654a7d33ce3c4cf8621693862aa0643cd25345bfc; parent_hash: 0x5294…9b0d; extrinsics (1): [0xacae…0b4e]]
2021-04-11 00:57:30 🔖 Pre-sealed block for proposal at 22. Hash now 0xe713cbd09829abacd48ad7e9ebb8f4e3f3d76cf86ed39f9cac50fa82ffa8fc15, previously 0xdddef9d6170c36580077eda654a7d33ce3c4cf8621693862aa0643cd25345bfc.
2021-04-11 00:57:30 ✨ Imported #22 (0xe713…fc15)
2021-04-11 00:57:30 💤 Idle (0 peers), best: #22 (0xe713…fc15), finalized #0 (0xd6bc…1466), ⬇ 0 ⬆ 0
2021-04-11 00:57:35 💤 Idle (0 peers), best: #22 (0xe713…fc15), finalized #0 (0xd6bc…1466), ⬇ 0 ⬆ 0
2021-04-11 00:57:36 🙌 Starting consensus session on top of parent 0xe713cbd09829abacd48ad7e9ebb8f4e3f3d76cf86ed39f9cac50fa82ffa8fc15
2021-04-11 00:57:36 🎁 Prepared block for proposing at 23 [hash: 0xb2906c6a7f3be192846e32af9ea51622c46a7205618c69b1f2ce870bc0cd1f95; parent_hash: 0xe713…fc15; extrinsics (1): [0xd4c9…2f72]]
2021-04-11 00:57:36 🔖 Pre-sealed block for proposal at 23. Hash now 0x26ca84b6e0e22a8ade2ee767267655b0b1123495a4172fe7d5f001d86dc1d669, previously 0xb2906c6a7f3be192846e32af9ea51622c46a7205618c69b1f2ce870bc0cd1f95.
2021-04-11 00:57:36 ✨ Imported #23 (0x26ca…d669)
2021-04-11 00:57:40 💤 Idle (0 peers), best: #23 (0x26ca…d669), finalized #0 (0xd6bc…1466), ⬇ 0 ⬆ 0
2021-04-11 00:57:42 🙌 Starting consensus session on top of parent 0x26ca84b6e0e22a8ade2ee767267655b0b1123495a4172fe7d5f001d86dc1d669
2021-04-11 00:57:42 🎁 Prepared block for proposing at 24 [hash: 0x234b5ec82eba845b7a7774dbec0e1d7062266459d4db8ed21047fb6b26726d64; parent_hash: 0x26ca…d669; extrinsics (1): [0x8354…9d72]]
2021-04-11 00:57:42 🔖 Pre-sealed block for proposal at 24. Hash now 0x4018329d3d0fbbfeb1ef0bbd470f34326d617c84c852b56c19382b000343149a, previously 0x234b5ec82eba845b7a7774dbec0e1d7062266459d4db8ed21047fb6b26726d64.
2021-04-11 00:57:42 ✨ Imported #24 (0x4018…149a)
2021-04-11 00:57:45 💤 Idle (0 peers), best: #24 (0x4018…149a), finalized #0 (0xd6bc…1466), ⬇ 0 ⬆ 0
Following this tutorial, I deploy a single node in local(custom pallet_aura and pallet_grandpa in GenesisConfig). best is right, but finalized is always #0. Any ideas on this?
ps: substrate version: 3.0

you need at least two nodes to get finalization. Deploy Bob and it will work ;).

Related

NSManagedObjectContext Heap Buffer Overflow

I've been tracking down an occasional crash in my app, which comes from an EXC_BAD_ACCESS KERN_PROTECTION_FAILURE, and I finally found something that it could be by using the Address Sanitizer. Unfortunately, I have no idea what the ASan output is telling me.
I've set up my Core Data stack based on this tutorial's stack. The ASan warning warning shows up here:
func mergeChanges(from transactions: [NSPersistentHistoryTransaction]) {
let context = viewContext
context.perform {
for transaction in transactions {
let note = transaction.objectIDNotification()
context.mergeChanges(fromContextDidSave: note) // heap buffer overflow!
try? self.storeHistoryToken(transaction.token)
}
}
}
I don't know what I could do to fix this code, since it seems pretty simple. It does happen when there's a lot of data being imported to Core Data through Batch Insertion Requests.
The output of the sanitizer into the debug terminal looks like this:
==59326==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6280004dbcff at pc 0x00010c71c8bd bp 0x7ff7b724b9d0 sp 0x7ff7b724b190
READ of size 15360 at 0x6280004dbcff thread T0
#0 0x10c71c8bc in wrap_memcpy+0x16c (libclang_rt.asan_iossim_dynamic.dylib:x86_64+0x1b8bc)
#1 0x7ff804aafd81 in fetchResultSetReallocCurrentRow+0x206 (CoreData:x86_64+0x1f2d81)
#2 0x7ff804a80dce in -[NSSQLiteConnection fetchResultSet:usingFetchPlan:]+0x317 (CoreData:x86_64+0x1c3dce)
#3 0x7ff804ab0ed1 in newFetchedRowsForFetchPlan_MT+0x471 (CoreData:x86_64+0x1f3ed1)
#4 0x7ff804bb0807 in _executeObjectFaultRequest+0x307 (CoreData:x86_64+0x2f3807)
#5 0x7ff804bb26e7 in _executeNewRowValuesForObjectFaultRequest+0xb6 (CoreData:x86_64+0x2f56e7)
#6 0x7ff804abe237 in -[NSSQLObjectFaultRequestContext executeRequestCore:]+0x14 (CoreData:x86_64+0x201237)
#7 0x7ff80491f370 in -[NSSQLStoreRequestContext executeRequestUsingConnection:]+0x1b0 (CoreData:x86_64+0x62370)
#8 0x7ff8049debfa in __52-[NSSQLDefaultConnectionManager handleStoreRequest:]_block_invoke+0x37 (CoreData:x86_64+0x121bfa)
#9 0x7ff804a729ca in __37-[NSSQLiteConnection performAndWait:]_block_invoke+0x1b (CoreData:x86_64+0x1b59ca)
#10 0x1123d2f5a in _dispatch_client_callout+0x7 (libdispatch.dylib:x86_64+0x4f5a)
#11 0x1123e4d71 in _dispatch_lane_barrier_sync_invoke_and_complete+0x83 (libdispatch.dylib:x86_64+0x16d71)
#12 0x7ff804a723d2 in -[NSSQLiteConnection performAndWait:]+0x8e (CoreData:x86_64+0x1b53d2)
#13 0x7ff8049deb13 in -[NSSQLDefaultConnectionManager handleStoreRequest:]+0xe3 (CoreData:x86_64+0x121b13)
#14 0x7ff804b68065 in -[NSSQLCoreDispatchManager routeStoreRequest:]+0x10e (CoreData:x86_64+0x2ab065)
#15 0x7ff804a32fd4 in -[NSSQLCore dispatchRequest:withRetries:]+0x84 (CoreData:x86_64+0x175fd4)
#16 0x7ff804a33ec3 in -[NSSQLCore newValuesForObjectWithID:withContext:error:]+0x137 (CoreData:x86_64+0x176ec3)
#17 0x7ff8049f8858 in __95-[NSPersistentStoreCoordinator(_NSInternalMethods) newValuesForObjectWithID:withContext:error:]_block_invoke+0x5b (CoreData:x86_64+0x13b858)
#18 0x7ff8049e64e6 in -[NSPersistentStoreCoordinator _routeLightweightBlock:toStore:]+0xeb (CoreData:x86_64+0x1294e6)
#19 0x7ff8049f85bd in -[NSPersistentStoreCoordinator(_NSInternalMethods) newValuesForObjectWithID:withContext:error:]+0x15c (CoreData:x86_64+0x13b5bd)
#20 0x7ff80496466f in _PFFaultHandlerLookupRow+0x204 (CoreData:x86_64+0xa766f)
#21 0x7ff804966c69 in _PF_FulfillDeferredFault+0xd6 (CoreData:x86_64+0xa9c69)
#22 0x7ff8049864a6 in _sharedIMPL_pvfk_core+0x8a (CoreData:x86_64+0xc94a6)
#23 0x7ff804976326 in _PF_Handler_Public_GetProperty+0xed (CoreData:x86_64+0xb9326)
#24 0x7ff800b9e985 in -[NSFunctionExpression expressionValueWithObject:context:]+0x6c2 (Foundation:x86_64+0x4a0985)
#25 0x7ff800b58fda in -[NSComparisonPredicate evaluateWithObject:substitutionVariables:]+0x146 (Foundation:x86_64+0x45afda)
#26 0x7ff800b5c0c0 in -[NSCompoundPredicateOperator evaluatePredicates:withObject:substitutionVariables:]+0x116 (Foundation:x86_64+0x45e0c0)
#27 0x7ff800b5ba14 in -[NSCompoundPredicate evaluateWithObject:substitutionVariables:]+0x109 (Foundation:x86_64+0x45da14)
#28 0x7ff804a18812 in -[NSFetchedResultsController _preprocessUpdatedObjects:insertsInfo:deletesInfo:updatesInfo:sectionsWithDeletes:newSectionNames:treatAsRefreshes:]+0x1f0 (CoreData:x86_64+0x15b812)
#29 0x7ff804a19c48 in __82-[NSFetchedResultsController(PrivateMethods) _core_managedObjectContextDidChange:]_block_invoke+0x7d7 (CoreData:x86_64+0x15cc48)
#30 0x7ff8049a0112 in developerSubmittedBlockToNSManagedObjectContextPerform+0x96 (CoreData:x86_64+0xe3112)
#31 0x7ff80499fffc in -[NSManagedObjectContext performBlockAndWait:]+0xc4 (CoreData:x86_64+0xe2ffc)
#32 0x7ff804a1945e in -[NSFetchedResultsController _core_managedObjectContextDidChange:]+0x6d (CoreData:x86_64+0x15c45e)
#33 0x7ff80035964a in __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__+0x88 (CoreFoundation:x86_64+0x5664a)
#34 0x7ff800359580 in ___CFXRegistrationPost_block_invoke+0x55 (CoreFoundation:x86_64+0x56580)
#35 0x7ff80AddressSanitizer report breakpoint hit. Use 'thread info -s' to get extended information about the report.
(lldb) thread info -s
thread #1: tid = 0x1361ef, 0x000000010c751210 libclang_rt.asan_iossim_dynamic.dylib`__asan::AsanDie(), queue = 'SQLQueue 0x613000128340 for MyAppModel.sqlite', stop reason = Heap buffer overflow
{
"access_size": 15360,
"access_type": 0,
"address": 108301900430591,
"description": "heap-buffer-overflow",
"instrumentation_class": "AddressSanitizer",
"pc": 4503750845,
"stop_type": "fatal_error"
}
Can anyone help me make sense of this?

How to determine for how long a thread was stuck in crash?

When inspecting a vmcore using crash tool, how to determine for how long a thread was stuck?
Here is an example:
How do I determine for how this thread has been waiting for the percpu reference counter to switch to atomic mode?
PID: 10637 TASK: ffffa035b3d0a080 CPU: 7 COMMAND: "md66_raid10"
#0 [ffffa035b2363c08] __schedule at ffffffffb616ab17
#1 [ffffa035b2363c90] schedule at ffffffffb616b019
#2 [ffffa035b2363ca0] percpu_ref_switch_to_atomic_sync at ffffffffb5d7af15
#3 [ffffa035b2363ce8] set_in_sync at ffffffffb5f8d6a7
#4 [ffffa035b2363d10] md_check_recovery at ffffffffb5f95fd7
#5 [ffffa035b2363d30] md_check_recovery at ffffffffb5f96368
#6 [ffffa035b2363d40] raid10d at ffffffffc093bc45 [raid10]
#7 [ffffa035b2363e50] md_thread at ffffffffb5f8cc3d
#8 [ffffa035b2363ec8] kthread at ffffffffb5ac1f81
#9 [ffffa035b2363f50] ret_from_fork_nospec_begin at ffffffffb6177c1d

Mage registry key "_singleton/Mage_Core_Model_Domainpolicy" already exists

I'm running into a problem on our backend part of Magento (/admin). It throws up an error:
Mage registry key "_singleton/Mage_Core_Model_Domainpolicy" already exists
It creates a report with the following content:
a:5:{i:0;s:74:"Mage registry key "_singleton/Mage_Core_Model_Domainpolicy" already exists";i:1;s:1693:"#0 /home/kfrijters/domains/wijnmaat.nl/public_html/app/Mage.php(224): Mage::throwException('Mage registry k...')
1 /home/kfrijters/domains/wijnmaat.nl/public_html/app/Mage.php(478): Mage::register('_singleton/Mage...', false)
2 /home/kfrijters/domains/wijnmaat.nl/public_html/app/code/core/Mage/Core/Model/App.php(1336): Mage::getSingleton('Mage_Core_Model...')
3 /home/kfrijters/domains/wijnmaat.nl/public_html/app/Mage.php(449): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
4 /home/kfrijters/domains/wijnmaat.nl/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(528): Mage::dispatchEvent('controller_acti...', Array)
5 /home/kfrijters/domains/wijnmaat.nl/public_html/app/code/core/Mage/Adminhtml/Controller/Action.php(160): Mage_Core_Controller_Varien_Action->preDispatch()
6 /home/kfrijters/domains/wijnmaat.nl/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(408): Mage_Adminhtml_Controller_Action->preDispatch()
7 /home/kfrijters/domains/wijnmaat.nl/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('login')
8 /home/kfrijters/domains/wijnmaat.nl/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
9 /home/kfrijters/domains/wijnmaat.nl/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
10 /home/kfrijters/domains/wijnmaat.nl/public_html/app/Mage.php(685): Mage_Core_Model_App->run(Array)
11 /home/kfrijters/domains/wijnmaat.nl/public_html/index.php(87): Mage::run('', 'store')
12 {main}";s:3:"url";s:6:"/admin";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:5:"admin";}
Does anyone know how to resolve this?

Magento reindexing issue

We are using magento enterprise version. Sometimes products are missing and they are coming back during reindexing. Can you tell us what might caused disappearing products?
This happen twice a week or so.
Also when we reindexing, we are getting following error, and we need to reindex again. Please let us know how we can fix reindexing error?
Catalog product price index process unknown error:
exception 'PDOException' with message 'SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction' in /var/www/mysite/public_html/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /var/www/mysite/public_html/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /var/www/mysite/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /var/www/mysite/public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /var/www/mysite/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 /var/www/mysite/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('UPDATE `catalog...', Array)
#5 /var/www/mysite/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('UPDATE `catalog...', Array)
#6 /var/www/mysite/public_html/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Product/Price.php(88): Varien_Db_Adapter_Pdo_Mysql->query('UPDATE `catalog...')
#7 /var/www/mysite/public_html/app/code/core/Mage/CatalogRule/Model/Rule/Product/Price.php(80): Mage_CatalogRule_Model_Resource_Rule_Product_Price->applyPriceRuleT oIndexTable(Object(Varien_Db_Select), Array, 'i.entity_id', 'i.customer_grou...', 'i.website_id', Array, 'wd.website_date')
#8 /var/www/mysite/public_html/app/code/core/Mage/CatalogRule/Model/Observer.php(254): Mage_CatalogRule_Model_Rule_Product_Price->applyPriceRuleToIndexTable(Object(Varien_Db_Select), Array, 'i.entity_id', 'i.customer_grou...', 'i.website_id', Array, 'wd.website_date')
#9 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1338): Mage_CatalogRule_Model_Observer->prepareCatalogProductPriceIndexTable(Object(Varien_Event_Observer))
#10 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_CatalogRule_Model_Observer), 'prepareCatalogP...', Object(Varien_Event_Observer))
#11 /var/www/mysite/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('prepare_catalog...', Array)
#12 /var/www/mysite/public_html/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php(304): Mage::dispatchEvent('prepare_catalog...', Array)
#13 /var/www/mysite/public_html/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php(120): Mage_Catalog_Model_Resource_Product_Indexer_Price_Default->_prepareFinalPriceData()
#14 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Action/Product/Price/Refresh.php(75): Mage_Catalog_Model_Resource_Product_Indexer_Price_Default->reindexAll()
#15 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Action/Product/Price/Refresh.php(49): Enterprise_Catalog_Model_Index_Action_Product_Price_Refresh->_reindexAll()
#16 /var/www/mysite/public_html/app/code/core/Enterprise/Mview/Model/Client.php(109): Enterprise_Catalog_Model_Index_Action_Product_Price_Refresh->execute()
#17 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Observer/Price.php(129): Enterprise_Mview_Model_Client->execute('enterprise_cata...')
#18 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1338): Enterprise_Catalog_Model_Index_Observer_Price->processShellProductReindexEvent(Object(Varien_Event_Observer))
#19 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Enterprise_Catalog_Model_Index_Observer_Price), 'processShellPro...', Object(Varien_Event_Observer))
#20 /var/www/mysite/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('catalog_product...', Array)
#21 /var/www/mysite/public_html/shell/indexer.php(167): Mage::dispatchEvent('catalog_product...')
#22 /var/www/mysite/public_html/shell/indexer.php(212): Mage_Shell_Compiler->run()
#23 {main}
Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction' in /var/www/mysite/public_html/lib/Zend/Db/Statement/Pdo.php:234
Stack trace:
#0 /var/www/mysite/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/mysite/public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /var/www/mysite/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /var/www/mysite/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('UPDATE `catalog...', Array)
#4 /var/www/mysite/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('UPDATE `catalog...', Array)
#5 /var/www/mysite/public_html/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Product/Price.php(88): Varien_Db_Adapter_Pdo_Mysql->query('UPDATE `catalog...')
#6 /var/www/mysite/public_html/app/code/core/Mage/CatalogRule/Model/Rule/Product/Price.php(80): Mage_CatalogRule_Model_Resource_Rule_Product_Price->applyPriceRuleToIndexTable(Object(Varien_Db_Select), Array, 'i.entity_id', 'i.customer_grou...', 'i.website_id', Array, 'wd.website_date')
#7 /var/www/mysite/public_html/app/code/core/Mage/CatalogRule/Model/Observer.php(254): Mage_CatalogRule_Model_Rule_Product_Price->applyPriceRuleToIndexTable(Object(Varien_Db_Select), Array, 'i.entity_id', 'i.customer_grou...', 'i.website_id',Array, 'wd.website_date')
#8 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1338): Mage_CatalogRule_Model_Observer->prepareCatalogProductPriceIndexTable(Object(Varien_Event_Observer))
#9 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_CatalogRule_Model_Observer), 'prepareCatalogP...', Object(Varien_Event_Observer))
#10 /var/www/mysite/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('prepare_catalog...', Array)
#11 /var/www/mysite/public_html/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php(304): Mage::dispatchEvent('prepare_catalog...', Array)
#12 /var/www/mysite/public_html/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php(120): Mage_Catalog_Model_Resource_Product_Indexer_Price_Default->_prepareFinalPriceData()
#13 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Action/Product/Price/Refresh.php(75): Mage_Catalog_Model_Resource_Product_Indexer_Price_Default->reindexAll()
#14 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Action/Product/Price/Refresh.php(49): Enterprise_Catalog_Model_Index_Action_Product_Price_Refresh->_reindexAll()
#15 /var/www/mysite/public_html/app/code/core/Enterprise/Mview/Model/Client.php(109): Enterprise_Catalog_Model_Index_Action_Product_Price_Refresh->execute()
#16 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Observer/Price.php(129): Enterprise_Mview_Model_Client->execute('enterprise_cata...')
#17 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1338): Enterprise_Catalog_Model_Index_Observer_Price->processShellProductReindexEvent(Object(Varien_Event_Observer))
#18 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Enterprise_Catalog_Model_Index_Observer_Price), 'processShellPro...', Object(Varien_Event_Observer))
#19 /var/www/mysite/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('catalog_product...', Array)
#20 /var/www/mysite/public_html/shell/indexer.php(167): Mage::dispatchEvent('catalog_product...')
#21 /var/www/mysite/public_html/shell/indexer.php(212): Mage_Shell_Compiler->run()
#22 {main}
Next exception 'Enterprise_Index_Model_Action_Exception' with message 'SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction' in /var/www/mysite/public_html/app/code/core/Enterprise/Cat
alog/Model/Index/Action/Product/Price/Refresh.php:54
Stack trace:
#0 /var/www/mysite/public_html/app/code/core/Enterprise/Mview/Model/Client.php(109) : Enterprise_Catalog_Model_Index_Action_Product_Price_Refresh->execute()
#1 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Observer/Price.php(129): Enterprise_Mview_Model_Client->execute('enterprise_cata...')
#2 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1338): Enterprise_Catalog_Model_Index_Observer_Price->processShellProductReindexEvent(Object(Varien_Event_Observer))
#3 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Enterprise_Catalog_Model_Index_Observer_Price), 'processShellPro...', Object(Varien_Event_Observer))
#4 /var/www/mysite/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('catalog_product...', Array)
#5 /var/www/mysite/public_html/shell/indexer.php(167): Mage::dispatchEvent('catalog_product...')
#6 /var/www/mysite/public_html/shell/indexer.php(212): Mage_Shell_Compiler->run()
#7 {main}
Category URL Rewrites index was rebuilt successfully
Product URL Rewrites index was rebuilt successfully
URL Redirects index was rebuilt successfully
Catalog Category/Product Index index process unknown error:exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mysite.catalog_category_product_index_tmp' doesn't exist' in /var/www/mysite/public_html/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /var/www/mysite/public_html/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /var/www/mysite/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /var/www/mysite/public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /var/www/mysite/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 /var/www/mysite/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT IGNORE I...', Array)
#5 /var/www/mysite/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('INSERT IGNORE I...', Array)
#6 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Action/Catalog/Category/Product/Refresh.php(747): Varien_Db_Adapter_Pdo_Mysql->query('INSERT IGNORE I...')
#7 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Action/Catalog/Category/Product/Refresh.php(396): Enterprise_Catalog_Model_Index_Action_Catalog_Category_Product_Refresh->_reindexAnchorCategories(Object(Mana_Seo_Rewrite_Store))
#8 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Action/Catalog/Category/Product/Refresh.php(170): Enterprise_Catalog_Model_Index_Action_Catalog_Category_Product_Refresh->_reindex()
#9 /var/www/mysite/public_html/app/code/core/Enterprise/Mview/Model/Client.php(109): Enterprise_Catalog_Model_Index_Action_Catalog_Category_Product_Refresh->execute()
#10 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Observer/Category/Product.php(158): Enterprise_Mview_Model_Client->execute('enterprise_cata...')
#11 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1338): Enterprise_Catalog_Model_Index_Observer_Category_Product->processShellCategoryProductReindexEvent(Object(Varien_Event_Observer))
#12 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Enterprise_Catalog_Model_Index_Observer_Category_Product), 'processShellCat...', Object(Varien_Event_Observer))
#13 /var/www/mysite/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('catalog_categor...', Array)
#14 /var/www/mysite/public_html/shell/indexer.php(167): Mage::dispatchEvent('catalog_categor...')
#15 /var/www/mysite/public_html/shell/indexer.php(212): Mage_Shell_Compiler->run()
#16 {main}
Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42S02]: Basetable or view not found: 1146 Table 'mysite.catalog_category_product_index_tmp' doesn't exist' in /var/www/mysite/public_html/lib/Zend/Db/Statement/Pdo.php:234
Stack trace:
#0 /var/www/mysite/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/mysite/public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /var/www/mysite/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /var/www/mysite/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT IGNORE I...', Array)
#4 /var/www/mysite/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('INSERT IGNORE I...', Array)
#5 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Action/Catalog/Category/Product/Refresh.php(747): Varien_Db_Adapter_Pdo_Mysql->query('INSERT IGNORE I...')
#6 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Action/Catalog/Category/Product/Refresh.php(396): Enterprise_Catalog_Model_Index_Action_Catalog_Category_Product_Refresh->_reindexAnchorCategories(Object(Mana_Seo_Rewrite_Store))
#7 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Action/Catalog/Category/Product/Refresh.php(170): Enterprise_Catalog_Model_Index_Action_Catalog_Category_Product_Refresh->_reindex()
#8 /var/www/mysite/public_html/app/code/core/Enterprise/Mview/Model/Client.php(109): Enterprise_Catalog_Model_Index_Action_Catalog_Category_Product_Refresh->execute()
#9 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Observer/Category/Product.php(158): Enterprise_Mview_Model_Client->execute('enterprise_cata...')
#10 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1338): Enterprise_Catalog_Model_Index_Observer_Category_Product->processShellCategoryProductReindexEvent(Object(Varien_Event_Observer))
#11 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Enterprise_Catalog_Model_Index_Observer_Category_Product), 'processShellCat...', Object(Varien_Event_Observer))
#12 /var/www/mysite/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('catalog_categor...', Array)
#13 /var/www/mysite/public_html/shell/indexer.php(167): Mage::dispatchEvent('catalog_categor...')
#14 /var/www/mysite/public_html/shell/indexer.php(212): Mage_Shell_Compiler->run()
#15 {main}
Next exception 'Enterprise_Index_Model_Action_Exception' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mysite.catalog_category_product_index_tmp' doesn't exist' in /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Action/Catalog/Category/Product/Refresh.php:175
Stack trace:
#0 /var/www/mysite/public_html/app/code/core/Enterprise/Mview/Model/Client.php(109): Enterprise_Catalog_Model_Index_Action_Catalog_Category_Product_Refresh->execute()
#1 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Observer/Category/Product.php(158): Enterprise_Mview_Model_Client->execute('enterprise_cata...')
#2 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1338): Enterprise_Catalog_Model_Index_Observer_Category_Product->processShellCategoryProductReindexEvent(Object(Varien_Event_Observer))
#3 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Enterprise_Catalog_Model_Index_Observer_Category_Product), 'processShellCat...', Object(Varien_Event_Observer))
#4 /var/www/mysite/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('catalog_categor...', Array)
#5 /var/www/mysite/public_html/shell/indexer.php(167): Mage::dispatchEvent('catalog_categor...')
#6 /var/www/mysite/public_html/shell/indexer.php(212): Mage_Shell_Compiler->run()
#7 {main}
Catalog Search Index index was rebuilt successfully
Product Attributes index was rebuilt successfully
SEO URL Rewrites (MANAdev) index was rebuilt successfully
Tag Aggregation Data index was rebuilt successfully
SEO Schemas (MANAdev) index was rebuilt successfully
Default Values (MANAdev) index was rebuilt successfully
One thing is to set your indexer to run manually previous to reindexing to be sure that an edit in the backend is not putting a lock that can be released and then blocks the indexation process. You neet to set back indexer to their running state afterward.
Need further details :
1. Which Magento enterprise version(Looks like partial indexing is running)?.
Are there any additional scripts developed that are not in sync with other Magento cron script.
Do these issues exist even if you flush Cache and Full Page cache
Where are tmp tables created with your Magento setup.
Look at this :
exception : Base table or view not found: 1146 Table 'mysite.catalog_category_pro
duct_index_tmp' doesn't exist' in /var/www/mysite/public_html/app/code/core/Enterpr
ise/Catalog/Model/Index/Action/Catalog/Category/Product/Refresh.php:175
So make sure there is no resource constraint and priviledges are in place for tmp table creation.
I think the solution is much simpler. As you can see a deadlock is occuring. I think this is a performance issue, do you use a dedicated database server? If yes or not, what hardware does your server use? Additionally, How often do you reindex?

Magento Reindex Product Flat error

Sice last week the procduct flat index is broken. All other reindexer are working.
Exception:
Product Flat Data index process unknown error:
exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1005 Can't create table 'magento.#sql-37aa_425' (errno: 121)' in /var/www/vhosts/httpdocs/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /var/www/vhosts/httpdocs/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /var/www/vhosts/httpdocs/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /var/www/vhosts/httpdocs/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /var/www/vhosts/httpdocs/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 /var/www/vhosts/httpdocs/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('ALTER TABLE `ca...', Array)
#5 /var/www/vhosts/httpdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php(389): Zend_Db_Adapter_Pdo_Abstract->query('ALTER TABLE `ca...', Array)
#6 /var/www/vhosts/httpdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php(327): Varien_Db_Adapter_Pdo_Mysql->query('ALTER TABLE `ca...')
#7 /var/www/vhosts/httpdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php(2548): Varien_Db_Adapter_Pdo_Mysql->raw_query('ALTER TABLE `ca...')
#8 /var/www/vhosts/httpdocs/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php(806): Varien_Db_Adapter_Pdo_Mysql->addForeignKey('FK_CAT_PRD_FLAT...', 'catalog_product...', 'entity_id', 'catalog_product...', 'entity_id', 'CASCADE', 'CASCADE')
#9 /var/www/vhosts/httpdocs/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php(125): Mage_Catalog_Model_Resource_Product_Flat_Indexer->prepareFlatTable(2)
#10 /var/www/vhosts/httpdocs/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php(115): Mage_Catalog_Model_Resource_Product_Flat_Indexer->rebuild('2')
#11 /var/www/vhosts/httpdocs/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php(73): Mage_Catalog_Model_Resource_Product_Flat_Indexer->rebuild(NULL)
#12 /var/www/vhosts/httpdocs/app/code/core/Mage/Catalog/Model/Product/Indexer/Flat.php(303): Mage_Catalog_Model_Product_Flat_Indexer->rebuild()
#13 /var/www/vhosts/httpdocs/app/code/core/Mage/Index/Model/Process.php(166): Mage_Catalog_Model_Product_Indexer_Flat->reindexAll()
#14 /var/www/vhosts/httpdocs/app/code/core/Mage/Index/Model/Process.php(194): Mage_Index_Model_Process->reindexAll()
#15 /var/www/vhosts/httpdocs/shell/indexer.php(158): Mage_Index_Model_Process->reindexEverything()
#16 /var/www/vhosts/httpdocs/shell/indexer.php(198): Mage_Shell_Compiler->run()
#17 {main}
if googled a lot about this topic. I had made a lot of tries like altering tables or delete product flat tables. Nothing seems to work.
I tried also the magento database repair tool. Same exception.
Could anyone help me to fix this?
Thanks
The last time I had a reindexing issue, I added this to my mysql config file (/etc/my.cnf)
key_buffer = 512M
max_allowed_packet = 64M
table_cache = 512
sort_buffer_size = 4m
read_buffer_size = 4m
read_rnd_buffer_size = 2m
myisam_sort_buffer_size = 64m
tmp_table_size = 128m
query_cache_size = 96m
query_cache_type = 1
thread_cache_size = 8
max_connections = 400
wait_timeout = 300
You may also need to delete a lock file in magento/var/locks/
read more # http://www.magentocommerce.com/boards/viewthread/36225/

Resources