-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Running indexer:reindex catalog_category_product fails due to limit 500 #8018
Comments
I confirm that bug on 2.1.3 In brief: the splitted SQLs for reindex are very wrong, but the original request is good. In deep: My categories are not deeper than 4. All have "is_anchor" = 1 Root Category (is anchor) I have about 60000 products in "Category 1" , with the anchor function. On my project, i coded a module that can do research by categories. And some of the skus were not found after that. Magento\Catalog\Model\Indexer\Category\Product\Action\Full
$this->reindex() is in
I dig through reindexAnchorCategories :
Here is the Original SQL, BEFORE, splitted by range:
It gives me 116048 entry. It is splitted in 13 requests. The last is:
The 13 only have 6500 entries on total. The splitting is incorrect. So just for testing purpose, i changed the function in AbstractAction
It corrected the reindex (and was way much faster). So i putted it in Full.php
But i know it's not the proper correction. The split is there to handle way much more products and categories than i have. I do not have the time right know to go deeper in the debug, maybe in few weeks |
I can confirm this is a defect in 2.1.3. After indexing the table catalog_category_product_index is limited to a maximum of 500 rows per category_id, except for the root category. For example, if on my database I execute the command
|
I can confirm this bug. Will describe the problem as it appears when indexing. The problem is that The While looping through the limited select queries, the method /**
* Calculate batch size for select.
*
* @param Select $select
* @return int
*/
private function calculateBatchSize(Select $select)
{
$wrapperSelect = $this->connection->select();
$wrapperSelect->from(
$select,
[
new \Zend_Db_Expr('MAX(' . $this->rangeFieldAlias . ') as max'),
new \Zend_Db_Expr('COUNT(*) as cnt')
]
);
$row = $this->connection->fetchRow($wrapperSelect);
$this->minValue = $row['max'];
return intval($row['cnt']);
Notice the |
As @pravalitera suggested I subclassed Magento\Catalog\Model\Indexer\Category\Product\Action\Full and overrode isRangingNeeded(), returning false. This fixes the index. |
@dnadle I did the same, but I would like for the bug to be fixed. Without query limiting this will quickly become a problem on large catalogs. Here is my patch for anyone interested:
EDIT: Actually, I patched and did not override. |
@siment I would love for the bug to be fixed but I've learned not to hold my breath... |
I can confirm this bug in Magento CE 2.1.3. Changing |
Seems to be a duplicate of #7968 |
@caesarcxiv Thanks for reporting this issue. |
Guys. To override follow below post |
I can confirm this bug is also in Magento CE 2.1.4. |
Also confirmed on Magento CE 2.1.4 It looks like this is being fixed in MAGETWO-62616, can someone confirm if this is correct? @maksek: This is high priority bug and should be released in the next bugfix release (2.1.7 I believe?). Thanks! |
I concur with @hostep Confirmed problem in CE 2.1.5. None of the product counts are accurate and missing products in catalogus while they appear correct in the backend. We are losing an client because of this and we are already looking for alternative eCommerce products |
@SinisterGlitch Be glad that everything is correct in your backend: i have so many product that the javascript is always hanging, and i can't open the product listing anymore. If only it was the only problem we were facing... But yeah, let's sell Magento 2 to every customers and dig our own grave -_- A good alternative : Magento 1.9 . Faster, easier to customize, a lot of help on internet ;) |
Hi, Can anyone create a noob friendly steps? Step by Step? I have this problem. I understand it. But not very familiar with Magento modules. Regards, |
For the lazy (or backwards lazy, like myself...) |
…uct fails due to limit 500 #8018
I would like to work on it |
I really, really hope that Magento 2.2 changes this workflow system to something that actually fixes bugs in patch releases. If anyone involved in the engineering of this product think this is a reasonable and sane workflow currently, you're smacked out of your head. I hit problem after problem in 2.1.x, including severe regressions in 2.1.8, and almost every single issue has been fixed for months and months in dev branch, and any relevant issues closed. Absolutely insane. |
Please do me a favor and edit your message... I have upset clients due to this massive bug that has been around for (9+) months! Clients don't see Magento as the source of issues but they see us as the source of all evil. |
@magento-engcom-team |
in a few days. next week |
Completely agree with all of these comments. As an enterprise user I would expect a much greater level of support. We have implemented a workaround for this issue. We ran into another bug: run your catalog product indexer while a page is uncached. visit the page while the indexer is running and if you hit it at the right time... boom! .. the page is cached with "sorry no products found" . We are working on a workaround on this too (to not cache pages with no results) but magento states this is intended behavior.... what???? Issue is that while the index is running there catalog returns results. They are working on a "stable index" but gave no eta due to the major refactor. Don't get me wrong I see the benefits in mage 2 but core issues like this that have no eta to a stable fix have me questioning why it was ever released as "stable" |
@itg-ddanielson IMHO the problem is not with the software. The software is very (perhaps overly) complex, but it is a large enterprise piece of software so is to be expected. It's mostly well structured and coded, and for the most part does an excellent job. |
@magento-engcom-team @okorshenko Can you please confirm that not fixing the issue in a stable release 2.1.x is the official statement from Magento core team. |
It means they don't care about developpers that, for some on them, support
Magento for 8 years, and made the brand what it is today. Even the
"communty manager" on Twitter does not answer question about 2.0 and 2.1
The release note of 2.2 is incredible. Really, 2.0 and 2.1 should never
have never been sold like a "finished product".
@magento-engcom-team <https://github.com/magento-engcom-team> Guys, really.
You should not spit on people that made what you became... But anyway, i
really hope 2.2 gonna succeed, because the trust in your product is lost in
many. Many. Many companies.
2017-09-25 9:18 GMT+02:00 Tymoteusz Motylewski <notifications@github.com>:
… @magento-engcom-team <https://github.com/magento-engcom-team> @okorshenko
<https://github.com/okorshenko> Can you please confirm that not fixing
the issue in a stable release 2.1.x is the official statement from Magento
core team.
Does it mean that once 2.2 version is released, version 2.0 and 2.1 will
not be supported any more?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8018 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/APqjaDYNVwikbvQ0LgsDrdKkatktk-Sfks5sl1PjgaJpZM4LZL6M>
.
|
FYI the upgrade to 2.2 is not simple if you have any third party modules / custom development. |
@Silarn ...apparently maintaining a stable ecommerce ecosystem is not Magento's concern. Even patch updates have caused problems with third party modules and themes, regardless of whether or not they follow code conventions. Most long time Mage devs are facing whiplash because of Magento's 180 in development process for 2.x. Yeah, it's great that the software is evolving and modernizing quickly, but lack of backwards fixes and the issues introduced with each minor update have really hamstrung any argument for adoption, and put us in the awkward position of building workarounds for every issue that affects larger shops. Given these difficulties and Magento's 'just upgrade' stance, I'm sure I'm not alone in wondering whether it's economically feasible to keep developing for the platform at all. It's not a great sign when every client is already shopping for something else or regressing to 1.x. |
Well, I can understand a major version having some compatibility issues. Most of the issues I've had have been due to the change in serialization. (and typically good third party devs who updated to use the new method but didn't covert the existing data...) There really are some significant improvements. Indexing and compile times are vastly better. But there are a lot of small fixes that have absolutely no reason not to exist in 2.1. And due to its broken nature and the fact that 2.2 is not necessarily a simple upgrade, the indexing improvements absolutely should be backported to 2.1 as well. My team is making the upgrade a priority for this reason, but I seriously doubt all Magento users are going to have the expertise to upgrade quickly. |
Ok. After the 10th critial bug fix... I am staying on 2.1.8 for now. I am trying to port the bugfixes manually from 2.2.0 to 2.1.8 |
I attempted the isRangingNeeded true fix and it didn't help. This was for 2.1.8 |
On EE 2.1.7 and updating isRangingNeeded() to false fixed the problem for us. +1 this is a major issue that needs to be resolved in 2.1.x. |
Everyday I discover something new using Magento this is another one I came across on 2.1.7. |
@magento-engcom-team checking code of 2.2.2 version, it seems that |
@magento-engcom-team, I just reviewed 2.2.3 and it's not there either. Is this complete or no? |
@ccasciotti I think the isRanging() method is in \Magento\Catalog\Model\Indexer\Category\Product\AbstractAction. It may be that the underlying issue was fixed elsewhere. But how are we supposed to know what the fix is, because the commit isn't referenced in this issue? |
@siliconalchemy, I don't believe this to be fixed as I'm experiencing this issue in Magento 2.2.3 Commerce Edition |
This is an issue in 2.2.1, One of my clients has over 5K products and products not being on the website means they lose a lot of money. Im glad i ran into this thread but we wont update the shop until 2.3 because of the mayor changes it is going to have its not worth putting in the time to check the 2.2.3 compability. Bug patches are used in every kind of software. I have over 10 'fix' modules in place to keep their website running. Hoping this will be addressed soon @magento-engcom-team |
@siment thank you, it worked for me with ~250000 product |
Possibly having this on Magento 2.2.0 Planning to use work around: https://github.com/bangerkuwranger/Magento-2.1.3-500-Product-Category-Limit-Bug-Workaround for now. Edit: Can confirm work around fixed problem. |
What is the status of this being corrected in the Magento core? @magento-engcom-team |
Im facing this issue in Magento 2.2.4 - products disappeared after reindex. Pls suggest a solution. Magento is seriously a very bad tool, i made a big mistake, i have gone through several issues. And now this one and no patch and no solution anywhere. Pls suggest a solution to solve this issue. The solution given above doesnt fit for Magento 2.2.4, pls suggest a solution for Magento 2.2.4 version. The folder structure doesn't match with 2.2.4 version. @schizek I request you all - pls suggest a solution - we are stuck and not able to move this through. |
Im facing this issue in Magento 2.2.4 - products disappeared after reindex. Pls suggest a solution. Pls suggest a solution. The solution given above doesnt fit for Magento 2.2.4, pls suggest a solution for Magento 2.2.4 version. The folder structure shown above doesn't match with 2.2.4 version so not able to understand where I have to make changes. And I guess after making the code changes we need to compile as well - Isn't it. I request you all - pls suggest a solution - we are stuck and not able to move this through. @schizek |
@shansari25 They have changed indexing in Magento 2.2.5. Not sure if that fixes it. We did not have any problems anymore after upgrading our clients to Magento 2.2.4. Since the functions changed within that directory i guess they changed this bug. |
@CompactCodeEU But my issue is not resolved, how do I resolve it, the products are totally blank in the frontend and we are not able to find out what to do, looks like there is no other mention of this issue anywhere other than making changes in isRangingNeeded. Pls suggest a solution or a way to solve this issue. |
Add me on skype. Rob.conings. This is not a conversation for here. It seems more like a stackexchange conversation or personal conversation |
@shansari25 @CompactCodeEU
However, in the indexer_state table. the updated time for the following 3 seems not updating when i run reindex command.
===================================================
you can see the top 3 is updated at 5/30, but i did ran re-index commands on 5/31 please let me you if you have any clue. |
The fix of this was not port to magento 2.1.x. |
Preconditions
Steps to reproduce
Expected result
Actual result
Query in error:
INSERT INTO
catalog_category_product_index
(category_id
,product_id
,position
,is_parent
,store_id
,visibility
) SELECTcc
.entity_id
AScategory_id
,ccp
.product_id
,ccp
.position
, 1 ASis_parent
, 1 ASstore_id
, IFNULL(cpvs.value, cpvd.value) ASvisibility
FROMcatalog_category_entity
AScc
INNER JOIN
catalog_category_product
ASccp
ON ccp.category_id = cc.entity_idINNER JOIN
catalog_product_website
AScpw
ON cpw.product_id = ccp.product_idINNER JOIN
catalog_product_entity
AScpe
ON ccp.product_id = cpe.entity_idINNER JOIN
catalog_product_entity_int
AScpsd
ON cpsd.entity_id = cpe.entity_id AND cpsd.store_id = 0 AND cpsd.attribute_id = 94LEFT JOIN
catalog_product_entity_int
AScpss
ON cpss.entity_id = cpe.entity_id AND cpss.attribute_id = cpsd.attribute_id AND cpss.store_id = 1INNER JOIN
catalog_product_entity_int
AScpvd
ON cpvd.entity_id = cpe.entity_id AND cpvd.store_id = 0 AND cpvd.attribute_id = 96LEFT JOIN
catalog_product_entity_int
AScpvs
ON cpvs.entity_id = cpe.entity_id AND cpvs.attribute_id = cpvd.attribute_id AND cpvs.store_id = 1 WHERE (cc.path LIKE '1/2/%') AND (cpw.website_id = '1') AND (IFNULL(cpss.value, cpsd.value) = 1) AND (IFNULL(cpvs.value, cpvd.value) IN (2, 3, 4)) AND (cc
.entity_id
> '1051') ORDER BYcc
.entity_id
ASCLIMIT 500 ON DUPLICATE KEY UPDATE
category_id
= VALUES(category_id
),product_id
= VALUES(product_id
),position
= VALUES(position
),is_parent
= VALUES(is_parent
),store_id
= VALUES(store_id
),visibility
= VALUES(visibility
)Query that successfully rebuilds full index (dropped limit and changed cc.entity_id > 0):
INSERT INTO
catalog_category_product_index
(category_id
,product_id
,position
,is_parent
,store_id
,visibility
) SELECTcc
.entity_id
AScategory_id
,ccp
.product_id
,ccp
.position
, 1 ASis_parent
, 1 ASstore_id
, IFNULL(cpvs.value, cpvd.value) ASvisibility
FROMcatalog_category_entity
AScc
INNER JOIN
catalog_category_product
ASccp
ON ccp.category_id = cc.entity_idINNER JOIN
catalog_product_website
AScpw
ON cpw.product_id = ccp.product_idINNER JOIN
catalog_product_entity
AScpe
ON ccp.product_id = cpe.entity_idINNER JOIN
catalog_product_entity_int
AScpsd
ON cpsd.entity_id = cpe.entity_id AND cpsd.store_id = 0 AND cpsd.attribute_id = 94LEFT JOIN
catalog_product_entity_int
AScpss
ON cpss.entity_id = cpe.entity_id AND cpss.attribute_id = cpsd.attribute_id AND cpss.store_id = 1INNER JOIN
catalog_product_entity_int
AScpvd
ON cpvd.entity_id = cpe.entity_id AND cpvd.store_id = 0 AND cpvd.attribute_id = 96LEFT JOIN
catalog_product_entity_int
AScpvs
ON cpvs.entity_id = cpe.entity_id AND cpvs.attribute_id = cpvd.attribute_id AND cpvs.store_id = 1 WHERE (cc.path LIKE '1/2/%') AND (cpw.website_id = '1') AND (IFNULL(cpss.value, cpsd.value) = 1) AND (IFNULL(cpvs.value, cpvd.value) IN (2, 3, 4)) AND (cc
.entity_id
> '0') ORDER BYcc
.entity_id
ASCON DUPLICATE KEY UPDATE
category_id
= VALUES(category_id
),product_id
= VALUES(product_id
),position
= VALUES(position
),is_parent
= VALUES(is_parent
),store_id
= VALUES(store_id
),visibility
= VALUES(visibility
)The text was updated successfully, but these errors were encountered: