Magento2: Error while reindexing catalogsearch with XDebug enabled: Fatal error: Maximum function nesting level of '200' reached, aborting!

Created on 21 Jun 2016  路  13Comments  路  Source: magento/magento2

Preconditions

Magento 2.1.0-rc3

Steps to reproduce

Have enough products to reach the iterator limit: 7829 in this case.
Run php bin/magento index:reindex

Expected result

Full reindex

Actual result

Changing the setting to xdebug.max_nesting_level=2000 doesn't solve it, but changing it to 10000 does solve it. It seems I have more than 2000 hidden products that don't have to go in the index after each other.

Call Stack:
    0.0002     356320   1. {main}() bin/magento:0
    1.0422   31188872   2. Symfony\Component\Console\Application->run() bin/magento:23
    1.0431   31208592   3. Magento\Framework\Console\Cli->doRun() vendor/symfony/console/Symfony/Component/Console/Application.php:126
    1.0432   31208592   4. Symfony\Component\Console\Application->doRun() vendor/magento/framework/Console/Cli.php:96
    1.0433   31208592   5. Symfony\Component\Console\Application->doRunCommand() vendor/symfony/console/Symfony/Component/Console/Application.php:195
    1.0433   31208592   6. Symfony\Component\Console\Command\Command->run() vendor/symfony/console/Symfony/Component/Console/Application.php:874
    1.0435   31210152   7. Magento\Indexer\Console\Command\IndexerReindexCommand->execute() vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
    4.9601   50399712   8. Magento\Indexer\Model\Indexer->reindexAll() vendor/magento/module-indexer/Console/Command/IndexerReindexCommand.php:57
    4.9803   50710400   9. Magento\CatalogSearch\Model\Indexer\Fulltext->executeFull() vendor/magento/module-indexer/Model/Indexer.php:412
    5.0680   51117272  10. Magento\CatalogSearch\Model\Indexer\IndexerHandler->saveIndex() vendor/magento/module-catalog-search/Model/Indexer/Fulltext.php:111
    5.0680   51117272  11. Magento\Framework\Indexer\SaveHandler\Batch->getItems() vendor/magento/module-catalog-search/Model/Indexer/IndexerHandler.php:95
    5.8359   52583408  12. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/framework/Indexer/SaveHandler/Batch.php:23
    5.8359   52583408  13. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8359   52583408  14. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8359   52583408  15. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8359   52583408  16. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8360   52583408  17. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8360   52583408  18. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8360   52583408  19. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8360   52583408  20. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8360   52583408  21. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8360   52583408  22. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8361   52583408  23. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8361   52583408  24. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8361   52583408  25. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8361   52583408  26. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8361   52583408  27. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8361   52583408  28. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8362   52583408  29. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8362   52583408  30. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8362   52583408  31. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8362   52583408  32. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8362   52583408  33. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8362   52583408  34. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8363   52583408  35. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8363   52583408  36. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8364   52583408  37. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8364   52583408  38. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8364   52583408  39. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8364   52583408  40. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8365   52583408  41. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8365   52583408  42. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8365   52583408  43. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8365   52583408  44. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8365   52583408  45. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8366   52583408  46. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8366   52583408  47. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8366   52583408  48. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8366   52583408  49. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8366   52583408  50. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8366   52583408  51. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8367   52583408  52. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8367   52583408  53. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8367   52583408  54. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8367   52583408  55. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8367   52583408  56. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8368   52583408  57. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8368   52583408  58. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8368   52583408  59. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8368   52583408  60. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8368   52583408  61. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8369   52583408  62. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8369   52583408  63. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8369   52583408  64. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8369   52583408  65. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8369   52583408  66. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8370   52583408  67. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8370   52583408  68. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8370   52583408  69. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8370   52583408  70. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8370   52583408  71. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8370   52583408  72. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8371   52583408  73. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8371   52583408  74. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8371   52583408  75. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8371   52583408  76. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8371   52583408  77. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8372   52583408  78. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8372   52583408  79. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8372   52583408  80. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8372   52583408  81. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8372   52583408  82. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8373   52583408  83. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8373   52583408  84. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8373   52583408  85. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8373   52583408  86. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8373   52583408  87. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8374   52583408  88. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8537   52632288  89. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8537   52632288  90. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8538   52632288  91. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8538   52632288  92. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8538   52632288  93. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8538   52632288  94. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8539   52632288  95. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8539   52632288  96. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8539   52632288  97. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8539   52632288  98. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8539   52632288  99. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8540   52632288 100. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8540   52632288 101. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8540   52632288 102. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8540   52632288 103. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8541   52632288 104. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8541   52632288 105. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8541   52632288 106. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8541   52632288 107. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8541   52632288 108. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8542   52632288 109. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8542   52632288 110. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8542   52632288 111. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8542   52632288 112. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8543   52632288 113. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8543   52632288 114. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8543   52632288 115. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8543   52632288 116. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8543   52632288 117. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8544   52632288 118. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8544   52632288 119. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8544   52632288 120. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8545   52632288 121. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8545   52632288 122. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8545   52632288 123. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8545   52632288 124. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8546   52632288 125. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8546   52632288 126. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8546   52632288 127. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8546   52632288 128. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8547   52632288 129. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8547   52632288 130. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8547   52632288 131. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8547   52632288 132. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8547   52632288 133. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8548   52632288 134. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8548   52632288 135. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8548   52632288 136. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8548   52632288 137. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8549   52894432 138. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8549   52894432 139. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8549   52894432 140. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8549   52894432 141. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8550   52894432 142. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8550   52894432 143. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8550   52894432 144. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8550   52894432 145. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8550   52894432 146. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8551   52894432 147. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8551   52894432 148. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8551   52894432 149. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8551   52894432 150. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8552   52894432 151. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8552   52894432 152. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8552   52894432 153. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8552   52894432 154. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8552   52894432 155. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8553   52894432 156. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8553   52894432 157. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8553   52894432 158. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8553   52894432 159. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8553   52894432 160. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8554   52894432 161. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8554   52894432 162. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8554   52894432 163. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8554   52894432 164. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8555   52894432 165. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8555   52894432 166. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8555   52894432 167. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8555   52894432 168. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8555   52894432 169. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8556   52894432 170. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8556   52894432 171. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8556   52894432 172. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8556   52894432 173. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8557   52894432 174. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8557   52894432 175. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8557   52894432 176. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8557   52894432 177. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8557   52894432 178. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8558   52894432 179. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8558   52894432 180. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8558   52894432 181. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8558   52894432 182. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8558   52894432 183. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8559   52894432 184. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8559   52894432 185. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8559   52894432 186. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8559   52894432 187. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8560   52894432 188. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198
    5.8560   52894432 189. Magento\CatalogSearch\Model\Indexer\Fulltext\Action\DataProvider->getSearchableProducts() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:154
    5.8562   52899544 190. Zend_Db_Adapter_Abstract->fetchAll() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/DataProvider.php:175
    5.8562   52899600 191. Magento\Framework\DB\Adapter\Pdo\Mysql->query() vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php:737
    5.8562   52899600 192. rtrim() vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:504
    5.8562   52899640 193. Zend_Db_Select->__toString() vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:504
    5.8562   52899640 194. Magento\Framework\DB\Select->assemble() vendor/magento/zendframework1/library/Zend/Db/Select.php:1350
    5.8562   52899640 195. Magento\Framework\DB\Select\RendererProxy->render() vendor/magento/framework/DB/Select.php:503
    5.8562   52899640 196. Magento\Framework\DB\Select\SelectRenderer->render() vendor/magento/framework/DB/Select/RendererProxy.php:106
    5.8562   52899640 197. Magento\Framework\DB\Select\ColumnsRenderer->render() vendor/magento/framework/DB/Select/SelectRenderer.php:71
    5.8563   52900072 198. Magento\Framework\DB\Platform\Quote->quoteColumnAs() vendor/magento/framework/DB/Select/ColumnsRenderer.php:56
    5.8563   52900072 199. Magento\Framework\DB\Platform\Quote->quoteIdentifierAs() vendor/magento/framework/DB/Platform/Quote.php:31
    5.8563   52900128 200. Magento\Framework\DB\Platform\Quote->replaceQuoteSymbol() vendor/magento/framework/DB/Platform/Quote.php:66
Cannot Reproduce Format is valid bug report

Most helpful comment

Adding content of this patch what should be valid for app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/IndexIterator.php

--- Model/Indexer/Fulltext/Action/IndexIterator.php
+++ Model/Indexer/Fulltext/Action/IndexIterator.php
@@ -14,6 +14,11 @@ namespace Magento\CatalogSearch\Model\Indexer\Fulltext\Action;
 class IndexIterator implements \Iterator
 {
     /**
+     * Num of products to load form the storage
+     */
+    const LOAD_PRODUCTS_BATCH_SIZE = 1000;
+
+    /**
      * @var \Magento\CatalogSearch\Model\Indexer\Fulltext\Action\DataProvider
      */
     private $dataProvider;
@@ -144,65 +149,89 @@ class IndexIterator implements \Iterator
      */
     public function next()
     {
-        \next($this->products);
-        if (\key($this->products) === null) {
-            // check if storage has more items to process
-            $this->products = $this->dataProvider->getSearchableProducts(
-                $this->storeId,
-                $this->staticFields,
-                $this->productIds,
-                $this->lastProductId
-            );
-
-            if (!count($this->products)) {
-                $this->isValid = false;
-                return;
+        do {
+            \next($this->products);
+            if (\key($this->products) === null) {
+                $this->loadNextProductsBatch();
             }
+            $productData = \current($this->products);
+            $productIndex = $this->getProductIndex($productData);
+        } while (!$productIndex && $this->isValid);

-            $productAttributes = [];
-            $this->productRelations = [];
-            foreach ($this->products as $productData) {
-                $this->lastProductId = $productData['entity_id'];
-                $productAttributes[$productData['entity_id']] = $productData['entity_id'];
-                $productChildren = $this->dataProvider->getProductChildIds(
-                    $productData['entity_id'],
-                    $productData['type_id']
-                );
-                $this->productRelations[$productData['entity_id']] = $productChildren;
-                if ($productChildren) {
-                    foreach ($productChildren as $productChildId) {
-                        $productAttributes[$productChildId] = $productChildId;
-                    }
-                }
-            }
-            \reset($this->products);
+        $index = $this->dataProvider->prepareProductIndex($productIndex, $productData, $this->storeId);

-            $this->productAttributes = $this->dataProvider->getProductAttributes(
-                $this->storeId,
-                $productAttributes,
-                $this->dynamicFields
-            );
+        $this->current = $index;
+        $this->key = $productData['entity_id'];
+    }
+
+    /**
+     * Fetch next batch of products from storage
+     *
+     * @return null
+     */
+    protected function loadNextProductsBatch()
+    {
+        $this->products = $this->dataProvider->getSearchableProducts(
+            $this->storeId,
+            $this->staticFields,
+            $this->productIds,
+            $this->lastProductId,
+            self::LOAD_PRODUCTS_BATCH_SIZE
+        );
+
+        if (!count($this->products)) {
+            $this->isValid = false;
+            return;
         }

-        $productData = \current($this->products);
+        $productAttributes = [];
+        $this->productRelations = [];
+        foreach ($this->products as $productData) {
+            $this->lastProductId = $productData['entity_id'];
+            $productAttributes[$productData['entity_id']] = $productData['entity_id'];
+            $productChildren = $this->dataProvider->getProductChildIds(
+                $productData['entity_id'],
+                $productData['type_id']
+            );
+            $this->productRelations[$productData['entity_id']] = $productChildren;
+            if ($productChildren) {
+                foreach ($productChildren as $productChildId) {
+                    $productAttributes[$productChildId] = $productChildId;
+                }
+            }
+        }
+        \reset($this->products);
+
+        $this->productAttributes = $this->dataProvider->getProductAttributes(
+            $this->storeId,
+            $productAttributes,
+            $this->dynamicFields
+        );
+        return;
+    }

+    /**
+     * Generate products data for indexer
+     *
+     * @param array|boolean $productData
+     * @return array
+     */
+    protected function getProductIndex($productData)
+    {
         if (!isset($this->productAttributes[$productData['entity_id']])) {
-            $this->next();
-            return;
+            return [];
         }

         $productAttr = $this->productAttributes[$productData['entity_id']];
         if (!isset($productAttr[$this->visibility->getId()])
             || !in_array($productAttr[$this->visibility->getId()], $this->allowedVisibility)
         ) {
-            $this->next();
-            return;
+            return [];
         }
         if (!isset($productAttr[$this->status->getId()])
             || !in_array($productAttr[$this->status->getId()], $this->statusIds)
         ) {
-            $this->next();
-            return;
+            return [];
         }

         $productIndex = [$productData['entity_id'] => $productAttr];
@@ -225,14 +254,10 @@ class IndexIterator implements \Iterator
             }
         }
         if ($productChildren !== null && !$hasChildren) {
-            $this->next();
-            return;
+            return [];
         }

-        $index = $this->dataProvider->prepareProductIndex($productIndex, $productData, $this->storeId);
-
-        $this->current = $index;
-        $this->key = $productData['entity_id'];
+        return $productIndex;
     }

     /**

All 13 comments

Hello! To allow us research the issue, please, provide description according to the template.
Please, provide the used version. If the problem is actual for a specific branch, please, specify it and be sure that the latest update was used.

@oserediuk 2.1.0-rc3, other parts are mentioned in the description right?

The problem is that the recursive nature of the method blows up the callstack. It might be better to return false and call the iterator again.

Reproduced in 2.1.0 using php 7.0.7 with xdebug enabled. Disabling xdebug means that the re-indexer works as expected.

@oserediuk How does this need an update?

Getting this with New Relic enabled:

PHP Fatal error:  Aborting! The New Relic imposed maximum PHP function nesting level of '5000' has been reached. This limit is to prevent the PHP execution from catastrophically running out of C-stack frames. If you think this limit is too small, adjust the value of the setting newrelic.special.max_nesting_level in the newrelic.ini file, and restart php. Please file a ticket at https://support.newrelic.com if you need further assistance.  in /data/web/magento2/vendor/magento/framework/Interception/PluginList/PluginList.php on line 264

Getting same issue. Trying to do full reindex from CLI towards Elasticsearch. When Xdebug extension is disabled then it gives

Segmentation fault

with strace last rows:

poll([{fd=15, events=POLLIN|POLLERR|POLLHUP}], 1, 1471228928) = 1 ([{fd=15, revents=POLLIN}])
recvfrom(15, "5.0000\22\0\0\10\006171517\003232\0060.0100\23\0\0\t"..., 482, MSG_DONTWAIT, NULL, NULL) = 482
poll([{fd=15, events=POLLIN|POLLERR|POLLHUP}], 1, 1471228928) = 1 ([{fd=15, revents=POLLIN}])
recvfrom(15, "0.0000\23\0\0\35\006171580\003232\00725.0000\22\0\0"..., 482, MSG_DONTWAIT, NULL, NULL) = 218
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x7ffc31281f78} ---
+++ killed by SIGSEGV +++
Segmentation fault

And it's always the same line

Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator->next() vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/IndexIterator.php:198

Product visibilities on what indexer is crashing on our case:

  • VISIBILITY_NOT_VISIBLE: 1 : total: 15674
  • VISIBILITY_IN_CATALOG: 2 : total: 1
  • VISIBILITY_IN_SEARCH: 3 : total: 0
  • VISIBILITY_BOTH: 4 : total: 2424

I've managed to get it work by patching two files:

(magento/module-catalog-search) Patch_CatalogSearch_FulltextIndexIterator.patch

--- Model/Indexer/Fulltext/Action/IndexIterator.php 2016-12-16 09:50:51.000000000 +0100
+++ Model/Indexer/Fulltext/Action/IndexIterator.php 2016-12-16 11:14:27.000000000 +0100
@@ -139,13 +139,38 @@
         return $this->current;
     }

+    protected $ignoredLastNext = false;
+
+    protected function backtraceCheck($reverseCheck = false)
+    {
+        $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 4);
+        $parentCaller = end($backtrace);
+        $parentParentCaller = prev($backtrace);
+        $parentParentParentCaller = prev($backtrace);
+
+        $checkFlag = $parentCaller['function'] == 'next' && $parentParentCaller['function'] == 'next' && $parentParentParentCaller['function'] == 'next';
+        if ($reverseCheck) {
+            $checkFlag = !$checkFlag;
+        }
+
+        return $checkFlag;
+    }
+
     /**
      * {@inheritDoc}
      */
     public function next()
     {
+        $this->ignoredLastNext = false;
+
         \next($this->products);
         if (\key($this->products) === null) {
+
+            if ($this->backtraceCheck()) {
+                $this->ignoredLastNext = true;
+                return;
+            }
+
             // check if storage has more items to process
             $this->products = $this->dataProvider->getSearchableProducts(
                 $this->storeId,
@@ -161,6 +186,7 @@

             $productAttributes = [];
             $this->productRelations = [];
+
             foreach ($this->products as $productData) {
                 $this->lastProductId = $productData['entity_id'];
                 $productAttributes[$productData['entity_id']] = $productData['entity_id'];
@@ -188,20 +214,37 @@

         if (!isset($this->productAttributes[$productData['entity_id']])) {
             $this->next();
+            if ($this->ignoredLastNext && $this->backtraceCheck(true)) {
+                $this->next();
+            }
             return;
         }

         $productAttr = $this->productAttributes[$productData['entity_id']];
-        if (!isset($productAttr[$this->visibility->getId()])
-            || !in_array($productAttr[$this->visibility->getId()], $this->allowedVisibility)
+        static $visibilityId = null;
+        if (null === $visibilityId) {
+            $visibilityId = $this->visibility->getId();
+        }
+        static $statusId = null;
+        if (null === $statusId) {
+            $statusId = $this->status->getId();
+        }
+        if (!isset($productAttr[$visibilityId])
+            || !in_array($productAttr[$visibilityId], $this->allowedVisibility)
         ) {
             $this->next();
+            if ($this->ignoredLastNext && $this->backtraceCheck(true)) {
+                $this->next();
+            }
             return;
         }
-        if (!isset($productAttr[$this->status->getId()])
-            || !in_array($productAttr[$this->status->getId()], $this->statusIds)
+        if (!isset($productAttr[$statusId])
+            || !in_array($productAttr[$statusId], $this->statusIds)
         ) {
             $this->next();
+            if ($this->ignoredLastNext && $this->backtraceCheck(true)) {
+                $this->next();
+            }
             return;
         }

@@ -213,8 +256,8 @@
             foreach ($productChildren as $productChildId) {
                 if (isset($this->productAttributes[$productChildId])) {
                     $productChildAttr = $this->productAttributes[$productChildId];
-                    if (!isset($productChildAttr[$this->status->getId()])
-                        || !in_array($productChildAttr[$this->status->getId()], $this->statusIds)
+                    if (!isset($productChildAttr[$statusId])
+                        || !in_array($productChildAttr[$statusId], $this->statusIds)
                     ) {
                         continue;
                     }
@@ -226,6 +269,9 @@
         }
         if ($productChildren !== null && !$hasChildren) {
             $this->next();
+            if ($this->ignoredLastNext && $this->backtraceCheck(true)) {
+                $this->next();
+            }
             return;
         }

(magento/framework) Patch_Framework_IndexerSaveHandler_Batch--null-documentname.patch

--- Indexer/SaveHandler/Batch-o.php 2016-12-16 11:05:35.000000000 +0100
+++ Indexer/SaveHandler/Batch.php   2016-12-16 11:05:43.000000000 +0100
@@ -21,6 +21,11 @@
         $i = 0;
         $batch = $items = [];
         foreach ($documents as $documentName => $documentValue) {
+            // PATCH
+            if ($documentName === null) {
+                continue;
+            }
+            //~PATCH
             $batch[$documentName] = $documentValue;
             if (++$i >= $size) {
                 $items[] = $batch;

@oserediuk

When community will get MDVA-2103_EE_2.1.0_v2_composer.patch applied?

Current develop shows same faulty code:
https://github.com/magento/magento2/blob/develop/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/IndexIterator.php

Adding content of this patch what should be valid for app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/IndexIterator.php

--- Model/Indexer/Fulltext/Action/IndexIterator.php
+++ Model/Indexer/Fulltext/Action/IndexIterator.php
@@ -14,6 +14,11 @@ namespace Magento\CatalogSearch\Model\Indexer\Fulltext\Action;
 class IndexIterator implements \Iterator
 {
     /**
+     * Num of products to load form the storage
+     */
+    const LOAD_PRODUCTS_BATCH_SIZE = 1000;
+
+    /**
      * @var \Magento\CatalogSearch\Model\Indexer\Fulltext\Action\DataProvider
      */
     private $dataProvider;
@@ -144,65 +149,89 @@ class IndexIterator implements \Iterator
      */
     public function next()
     {
-        \next($this->products);
-        if (\key($this->products) === null) {
-            // check if storage has more items to process
-            $this->products = $this->dataProvider->getSearchableProducts(
-                $this->storeId,
-                $this->staticFields,
-                $this->productIds,
-                $this->lastProductId
-            );
-
-            if (!count($this->products)) {
-                $this->isValid = false;
-                return;
+        do {
+            \next($this->products);
+            if (\key($this->products) === null) {
+                $this->loadNextProductsBatch();
             }
+            $productData = \current($this->products);
+            $productIndex = $this->getProductIndex($productData);
+        } while (!$productIndex && $this->isValid);

-            $productAttributes = [];
-            $this->productRelations = [];
-            foreach ($this->products as $productData) {
-                $this->lastProductId = $productData['entity_id'];
-                $productAttributes[$productData['entity_id']] = $productData['entity_id'];
-                $productChildren = $this->dataProvider->getProductChildIds(
-                    $productData['entity_id'],
-                    $productData['type_id']
-                );
-                $this->productRelations[$productData['entity_id']] = $productChildren;
-                if ($productChildren) {
-                    foreach ($productChildren as $productChildId) {
-                        $productAttributes[$productChildId] = $productChildId;
-                    }
-                }
-            }
-            \reset($this->products);
+        $index = $this->dataProvider->prepareProductIndex($productIndex, $productData, $this->storeId);

-            $this->productAttributes = $this->dataProvider->getProductAttributes(
-                $this->storeId,
-                $productAttributes,
-                $this->dynamicFields
-            );
+        $this->current = $index;
+        $this->key = $productData['entity_id'];
+    }
+
+    /**
+     * Fetch next batch of products from storage
+     *
+     * @return null
+     */
+    protected function loadNextProductsBatch()
+    {
+        $this->products = $this->dataProvider->getSearchableProducts(
+            $this->storeId,
+            $this->staticFields,
+            $this->productIds,
+            $this->lastProductId,
+            self::LOAD_PRODUCTS_BATCH_SIZE
+        );
+
+        if (!count($this->products)) {
+            $this->isValid = false;
+            return;
         }

-        $productData = \current($this->products);
+        $productAttributes = [];
+        $this->productRelations = [];
+        foreach ($this->products as $productData) {
+            $this->lastProductId = $productData['entity_id'];
+            $productAttributes[$productData['entity_id']] = $productData['entity_id'];
+            $productChildren = $this->dataProvider->getProductChildIds(
+                $productData['entity_id'],
+                $productData['type_id']
+            );
+            $this->productRelations[$productData['entity_id']] = $productChildren;
+            if ($productChildren) {
+                foreach ($productChildren as $productChildId) {
+                    $productAttributes[$productChildId] = $productChildId;
+                }
+            }
+        }
+        \reset($this->products);
+
+        $this->productAttributes = $this->dataProvider->getProductAttributes(
+            $this->storeId,
+            $productAttributes,
+            $this->dynamicFields
+        );
+        return;
+    }

+    /**
+     * Generate products data for indexer
+     *
+     * @param array|boolean $productData
+     * @return array
+     */
+    protected function getProductIndex($productData)
+    {
         if (!isset($this->productAttributes[$productData['entity_id']])) {
-            $this->next();
-            return;
+            return [];
         }

         $productAttr = $this->productAttributes[$productData['entity_id']];
         if (!isset($productAttr[$this->visibility->getId()])
             || !in_array($productAttr[$this->visibility->getId()], $this->allowedVisibility)
         ) {
-            $this->next();
-            return;
+            return [];
         }
         if (!isset($productAttr[$this->status->getId()])
             || !in_array($productAttr[$this->status->getId()], $this->statusIds)
         ) {
-            $this->next();
-            return;
+            return [];
         }

         $productIndex = [$productData['entity_id'] => $productAttr];
@@ -225,14 +254,10 @@ class IndexIterator implements \Iterator
             }
         }
         if ($productChildren !== null && !$hasChildren) {
-            $this->next();
-            return;
+            return [];
         }

-        $index = $this->dataProvider->prepareProductIndex($productIndex, $productData, $this->storeId);
-
-        $this->current = $index;
-        $this->key = $productData['entity_id'];
+        return $productIndex;
     }

     /**

@elvin-vaimo did you do any pull request with this patch or forked repo?
I would try if this patch fixes this issue because i can't reindexing due to error described in this issue

@marcio199226

this was sent by Magento core team for magento/module-catalog-search as a patch ( MDVA-2103_EE_2.1.0_v2_composer.patch ). I would have expected that they would include it.

but seems latest update 0ff69c5cbc85af82cd87371c6fe01718a6e463ac by yaroslav.onischenko says that this is deprecated

@elvin-vaimo thanks but im a newbie on magento 2 how can i apply this patch MDVA-2103_EE_2.1.0_v2_composer.patch ?

Im on 2.1.6 version and o don't have a commit you posted

Thanks in advance i hope with your help i could fix this issue because without it nothing works properly...

@paales, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.
We tested the issue on 2.3.0-dev, 2.1.10, 2.2.1

Was this page helpful?
0 / 5 - 0 ratings