Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Product with SKU "a long sku***" does not exist #14409

Closed
forwells opened this issue Mar 28, 2018 · 14 comments
Closed

Product with SKU "a long sku***" does not exist #14409

forwells opened this issue Mar 28, 2018 · 14 comments
Labels
Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@forwells
Copy link

add one configurable product to a new category

Preconditions

  1. magento2.2.2
  2. php7.0.28
    3.mysql5.7

Steps to reproduce

  1. Add a configuration product with a SKU greater than 70 characters
  2. Configure the product based on two different attributes in the configuration options.
  3. save the products

Expected result

  1. save it successfully

Actual result

qq 20180328154847
2.
it throw NoSuchEntityException

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Mar 28, 2018
@forwells
Copy link
Author

this is my system log
[2018-03-28 07:34:27] main.CRITICAL: Exception message: Product with SKU "R5/BODY WAVE HAIR 3PCS&4X4 LACE CLOSURE-10"10"10"&10"-Middle part" does not exist
Trace: #0 F:\rebecca\vendor\magento\module-catalog-inventory\Model\StockRegistry.php(171): Magento\CatalogInventory\Model\StockRegistry->resolveProductId('R5/BODY WAVE HA...')
#1 F:\rebecca\vendor\magento\module-catalog-inventory\Observer\SaveInventoryDataObserver.php(110): Magento\CatalogInventory\Model\StockRegistry->updateStockItemBySku('R5/BODY WAVE HA...', Object(Magento\CatalogInventory\Model\Adminhtml\Stock\Item))
#2 F:\rebecca\vendor\magento\framework\Event\Invoker\InvokerDefault.php(72): Magento\CatalogInventory\Observer\SaveInventoryDataObserver->execute(Object(Magento\Framework\Event\Observer))
#3 F:\rebecca\vendor\magento\framework\Event\Invoker\InvokerDefault.php(60): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(Object(Magento\CatalogInventory\Observer\SaveInventoryDataObserver), Object(Magento\Framework\Event\Observer))
#4 F:\rebecca\vendor\magento\framework\Event\Manager.php(66): Magento\Framework\Event\Invoker\InvokerDefault->dispatch(Array, Object(Magento\Framework\Event\Observer))
#5 F:\rebecca\generated\code\Magento\Framework\Event\Manager\Proxy.php(95): Magento\Framework\Event\Manager->dispatch('catalog_product...', Array)
#6 F:\rebecca\vendor\magento\framework\Model\AbstractModel.php(818): Magento\Framework\Event\Manager\Proxy->dispatch('catalog_product...', Array)
#7 F:\rebecca\vendor\magento\module-catalog\Model\Product.php(928): Magento\Framework\Model\AbstractModel->afterSave()
#8 F:\rebecca\generated\code\Magento\Catalog\Model\Product\Interceptor.php(362): Magento\Catalog\Model\Product->afterSave()
#9 F:\rebecca\vendor\magento\framework\EntityManager\Observer\AfterEntitySave.php(34): Magento\Catalog\Model\Product\Interceptor->afterSave()
#10 F:\rebecca\vendor\magento\framework\Event\Invoker\InvokerDefault.php(72): Magento\Framework\EntityManager\Observer\AfterEntitySave->execute(Object(Magento\Framework\Event\Observer))
#11 F:\rebecca\vendor\magento\framework\Event\Invoker\InvokerDefault.php(60): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(Object(Magento\Framework\EntityManager\Observer\AfterEntitySave), Object(Magento\Framework\Event\Observer))
#12 F:\rebecca\vendor\magento\framework\Event\Manager.php(66): Magento\Framework\Event\Invoker\InvokerDefault->dispatch(Array, Object(Magento\Framework\Event\Observer))
#13 F:\rebecca\generated\code\Magento\Framework\Event\Manager\Proxy.php(95): Magento\Framework\Event\Manager->dispatch('magento_catalog...', Array)
#14 F:\rebecca\vendor\magento\framework\EntityManager\EventManager.php(52): Magento\Framework\Event\Manager\Proxy->dispatch('magento_catalog...', Array)
#15 F:\rebecca\vendor\magento\framework\EntityManager\Operation\Create.php(123): Magento\Framework\EntityManager\EventManager->dispatchEntityEvent('Magento\Catalog...', 'save_after', Array)
#16 F:\rebecca\vendor\magento\framework\EntityManager\EntityManager.php(96): Magento\Framework\EntityManager\Operation\Create->execute(Object(Magento\Catalog\Model\Product\Interceptor), Array)
#17 F:\rebecca\vendor\magento\module-catalog\Model\ResourceModel\Product.php(626): Magento\Framework\EntityManager\EntityManager->save(Object(Magento\Catalog\Model\Product\Interceptor))
#18 F:\rebecca\vendor\magento\framework\Interception\Interceptor.php(58): Magento\Catalog\Model\ResourceModel\Product->save(Object(Magento\Catalog\Model\Product\Interceptor))
#19 F:\rebecca\vendor\magento\framework\Interception\Interceptor.php(138): Magento\Catalog\Model\ResourceModel\Product\Interceptor->___callParent('save', Array)
#20 F:\rebecca\vendor\magento\module-catalog-search\Model\Indexer\Fulltext\Plugin\Product.php(51): Magento\Catalog\Model\ResourceModel\Product\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Catalog\Model\Product\Interceptor))
#21 F:\rebecca\vendor\magento\module-catalog-search\Model\Indexer\Fulltext\Plugin\Product.php(24): Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Product->addCommitCallback(Object(Magento\Catalog\Model\ResourceModel\Product\Interceptor), Object(Closure), Object(Magento\Catalog\Model\Product\Interceptor))
#22 F:\rebecca\vendor\magento\framework\Interception\Interceptor.php(135): Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Product->aroundSave(Object(Magento\Catalog\Model\ResourceModel\Product\Interceptor), Object(Closure), Object(Magento\Catalog\Model\Product\Interceptor))
#23 F:\rebecca\vendor\magento\framework\App\Cache\FlushCacheByTags.php(68): Magento\Catalog\Model\ResourceModel\Product\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Catalog\Model\Product\Interceptor))
#24 F:\rebecca\vendor\magento\framework\Interception\Interceptor.php(135): Magento\Framework\App\Cache\FlushCacheByTags->aroundSave(Object(Magento\Catalog\Model\ResourceModel\Product\Interceptor), Object(Closure), Object(Magento\Catalog\Model\Product\Interceptor))
#25 F:\rebecca\vendor\magento\framework\Interception\Interceptor.php(153): Magento\Catalog\Model\ResourceModel\Product\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Catalog\Model\Product\Interceptor))
#26 F:\rebecca\generated\code\Magento\Catalog\Model\ResourceModel\Product\Interceptor.php(273): Magento\Catalog\Model\ResourceModel\Product\Interceptor->___callPlugins('save', Array, Array)
#27 F:\rebecca\vendor\magento\framework\Model\AbstractModel.php(647): Magento\Catalog\Model\ResourceModel\Product\Interceptor->save(Object(Magento\Catalog\Model\Product\Interceptor))
#28 F:\rebecca\generated\code\Magento\Catalog\Model\Product\Interceptor.php(2429): Magento\Framework\Model\AbstractModel->save()
#29 F:\rebecca\vendor\magento\module-configurable-product\Model\Product\VariationHandler.php(107): Magento\Catalog\Model\Product\Interceptor->save()
#30 F:\rebecca\vendor\magento\module-configurable-product\Controller\Adminhtml\Product\Initialization\Helper\Plugin\Configurable.php(142): Magento\ConfigurableProduct\Model\Product\VariationHandler->generateSimpleProducts(Object(Magento\Catalog\Model\Product\Interceptor), Array)
#31 F:\rebecca\vendor\magento\module-configurable-product\Controller\Adminhtml\Product\Initialization\Helper\Plugin\Configurable.php(110): Magento\ConfigurableProduct\Controller\Adminhtml\Product\Initialization\Helper\Plugin\Configurable->setLinkedProducts(Object(Magento\Catalog\Model\Product\Interceptor), Object(Magento\Catalog\Api\Data\ProductExtension))
#32 F:\rebecca\vendor\magento\framework\Interception\Interceptor.php(146): Magento\ConfigurableProduct\Controller\Adminhtml\Product\Initialization\Helper\Plugin\Configurable->afterInitialize(Object(Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper\Interceptor), Object(Magento\Catalog\Model\Product\Interceptor), Object(Magento\Catalog\Model\Product\Interceptor))
#33 F:\rebecca\vendor\magento\framework\Interception\Interceptor.php(153): Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Catalog\Model\Product\Interceptor))
#34 F:\rebecca\generated\code\Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper\Interceptor.php(39): Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper\Interceptor->___callPlugins('initialize', Array, Array)
#35 F:\rebecca\vendor\magento\module-catalog\Controller\Adminhtml\Product\Save.php(101): Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper\Interceptor->initialize(Object(Magento\Catalog\Model\Product\Interceptor))
#36 F:\rebecca\generated\code\Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor.php(24): Magento\Catalog\Controller\Adminhtml\Product\Save->execute()
#37 F:\rebecca\vendor\magento\framework\App\Action\Action.php(107): Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->execute()
#38 F:\rebecca\vendor\magento\module-backend\App\AbstractAction.php(229): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#39 F:\rebecca\vendor\magento\framework\Interception\Interceptor.php(58): Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http))
#40 F:\rebecca\vendor\magento\framework\Interception\Interceptor.php(138): Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->___callParent('dispatch', Array)
#41 F:\rebecca\vendor\magento\module-backend\App\Action\Plugin\Authentication.php(143): Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))
#42 F:\rebecca\vendor\magento\framework\Interception\Interceptor.php(135): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#43 F:\rebecca\vendor\magento\framework\Interception\Interceptor.php(153): Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))
#44 F:\rebecca\generated\code\Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor.php(39): Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->___callPlugins('dispatch', Array, NULL)
#45 F:\rebecca\vendor\magento\framework\App\FrontController.php(55): Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#46 F:\rebecca\vendor\magento\framework\Interception\Interceptor.php(58): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#47 F:\rebecca\vendor\magento\framework\Interception\Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#48 F:\rebecca\vendor\magento\framework\Interception\Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))
#49 F:\rebecca\generated\code\Magento\Framework\App\FrontController\Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#50 F:\rebecca\vendor\magento\framework\App\Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#51 F:\rebecca\generated\code\Magento\Framework\App\Http\Interceptor.php(24): Magento\Framework\App\Http->launch()
#52 F:\rebecca\vendor\magento\framework\App\Bootstrap.php(256): Magento\Framework\App\Http\Interceptor->launch()
#53 F:\rebecca\index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#54 {main} [] []

@forwells
Copy link
Author

forwells commented Mar 28, 2018

I hope someone can help me,thanks!

@orlangur
Copy link
Contributor

How do you do

Add a configuration product with a SKU greater than 70 characters

if there is a 64 characters validation

class="validate-length maximum-length-64

?

@forwells
Copy link
Author

forwells commented Mar 28, 2018

@orlangur
now I have set the Sku max_text_length to 255,
but the problem still exists,
image

@orlangur
Copy link
Contributor

It does not work this way. If you customized your Magento instance so that you have longer SKU than in core, something may break and you must fix it on your own.

@forwells
Copy link
Author

forwells commented Mar 28, 2018

@orlangur
I was just trying. Now that I have recovered the core, but the problem still exists. I have found that this issue may be a question of attributes. Will a long SKU cause unpredictable problems during product preservation?

I change it ,because I found a similar problem solution in an issue.
this :#11953

@magento-engcom-team
Copy link
Contributor

Hello @dearmatta. Thanks for reporting. In fact Your issue was actual but in some other aspect. So You create a configuration for Your Configurable Product and there appear Simple variations with SKU longer than 64 characters (f.e. by default those SKUs are having been created by adding definite characters to Your Configurable Product name ( not SKU but name), which actually is allowed to have more than 64 characters). Then after You try to save the product You should see not the error massage You've mentioned but the validation messages near the configuration SKUs saying that the SKU can not have more than 64 characters. Why we say Your issue "was actual" but not "is actual" is because in 2.3.0 version it is no more reproducible. Everything works there just as expected. But in any version You used You would be forced to have Your product SKUs contain no more than 64 characters.

@magento-engcom-team magento-engcom-team added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release and removed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release labels Mar 28, 2018
@forwells
Copy link
Author

@magento-engcom-team Yes,you are right ! it is this problem. I have solved that in magento2.2.2

@arijit-de93
Copy link

I am getting the same problem in Magento 2.2.2

@ssmadsen
Copy link

@magento-engcom-team
I reproduced this issue in Magento 2.3.0.

Saving my configurations in my Configurable Products throws the "Sku is longer than 64......" error.

@carb0nknight
Copy link

I realize this thread is closed and incredibly old, but I'm currently getting this error in a brand new 2.3.5-p1 environment
Screen Shot 2020-05-27 at 2 54 25 PM
.

@kensiummohit
Copy link

I'm seeing this in 2.3.5-p2 while saving product in store view scope.

@ivanaugustobd
Copy link

Something about vendor/magento/module-catalog-inventory/Model/StockRegistry.php:194 fired by the catalog_product_save_after event, which is strange because at that point we are creating a product so it makes sense that no id is found; the question is why it is checking such a thing

@paulmestereaga
Copy link

having the same issue as @carb0nknight in Magento ver. 2.4.6-p3
Saving a configurable product which has generated configurations with SKU longer than 64 chars. Error is
The Product with the "CN01-Extra White-White-Satinated white safety glass-Square Silver" SKU doesn't exist.

image

Checking the product is saved with sku CN01-Extra White-White-Satinated white safety glass-Square . So I think because it's longer than 64 chars sku is trimmed, but during save Magento\CatalogInventory\Model\StockRegistry->updateStockItemBySku() receives the full sku not the trimmed one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

9 participants