cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.3.4 save product error admin

SOLVED

Magento 2.3.4 save product error admin

Hello,

 

I have a strange error on the moment that I want to save a product. I mention that I've migrate data from Magento 1.9 to Magento 2.3.4 (products,categories, etc).

 

[2020-03-06 10:40:45] main.CRITICAL: Exception message: No such entity with id = 3147
Trace: <pre>#1 Magento\Catalog\Model\CategoryRepository->get(3147, 1) called at [generated/code/Magento/Catalog/Model/CategoryRepository/Interceptor.php:37]
#2 Magento\Catalog\Model\CategoryRepository\Interceptor->get(3147, 1) called at [vendor/magento/module-catalog-url-rewrite/Model/Product/CurrentUrlRewritesRegenerator.php:169]
#3 Magento\CatalogUrlRewrite\Model\Product\CurrentUrlRewritesRegenerator->generateAnchor(1, &Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#, &Magento\CatalogUrlRewrite\Model\ObjectRegistry#000000001d2edbb40000000057697e5e#, NULL) called at [vendor/magento/module-catalog-url-rewrite/Model/ProductScopeRewriteGenerator.php:210]
#4 Magento\CatalogUrlRewrite\Model\ProductScopeRewriteGenerator->generateForSpecificStoreView(1, &Magento\CatalogUrlRewrite\Model\ObjectRegistry#000000001d2edbb40000000057697e5e#, &Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#, NULL) called at [vendor/magento/module-catalog-url-rewrite/Model/ProductScopeRewriteGenerator.php:151]
#5 Magento\CatalogUrlRewrite\Model\ProductScopeRewriteGenerator->generateForGlobalScope(&Magento\Catalog\Model\ResourceModel\Category\Collection#000000001d2edc490000000057697e5e#, &Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#, NULL) called at [vendor/magento/module-catalog-url-rewrite/Model/ProductUrlRewriteGenerator.php:171]
#6 Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator->generateForGlobalScope(&Magento\Catalog\Model\ResourceModel\Category\Collection#000000001d2edc490000000057697e5e#, &Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#, NULL) called at [vendor/magento/module-catalog-url-rewrite/Model/ProductUrlRewriteGenerator.php:141]
#7 Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator->generate(&Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#) called at [vendor/magento/module-catalog-url-rewrite/Observer/ProductProcessUrlRewriteSavingObserver.php:71]
#8 Magento\CatalogUrlRewrite\Observer\ProductProcessUrlRewriteSavingObserver->execute(&Magento\Framework\Event\Observer#000000001d2edc610000000057697e5e#) called at [vendor/magento/framework/Event/Invoker/InvokerDefault.php:88]
#9 Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(&Magento\CatalogUrlRewrite\Observer\ProductProcessUrlRewriteSavingObserver#000000001d2edc630000000057697e5e#, &Magento\Framework\Event\Observer#000000001d2edc610000000057697e5e#) called at [vendor/magento/framework/Event/Invoker/InvokerDefault.php:74]
#10 Magento\Framework\Event\Invoker\InvokerDefault->dispatch(array('instance' => 'Magento\CatalogU...', 'name' => 'process_url_rewr...'), &Magento\Framework\Event\Observer#000000001d2edc610000000057697e5e#) called at [vendor/magento/framework/Event/Manager.php:66]
#11 Magento\Framework\Event\Manager->dispatch('catalog_product_...', array('data_object' => &Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#, 'product' => &Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#)) called at [generated/code/Magento/Framework/Event/Manager/Proxy.php:95]
#12 Magento\Framework\Event\Manager\Proxy->dispatch('catalog_product_...', array('data_object' => &Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#, 'product' => &Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#)) called at [vendor/magento/framework/Model/AbstractModel.php:829]
#13 Magento\Framework\Model\AbstractModel->afterSave() called at [vendor/magento/module-catalog/Model/Product.php:969]
#14 Magento\Catalog\Model\Product->afterSave() called at [generated/code/Magento/Catalog/Model/Product/Interceptor.php:349]
#15 Magento\Catalog\Model\Product\Interceptor->afterSave() called at [vendor/magento/framework/EntityManager/Observer/AfterEntitySave.php:34]
#16 Magento\Framework\EntityManager\Observer\AfterEntitySave->execute(&Magento\Framework\Event\Observer#000000001d2edc2f0000000057697e5e#) called at [vendor/magento/framework/Event/Invoker/InvokerDefault.php:88]
#17 Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(&Magento\Framework\EntityManager\Observer\AfterEntitySave#000000001d2edc290000000057697e5e#, &Magento\Framework\Event\Observer#000000001d2edc2f0000000057697e5e#) called at [vendor/magento/framework/Event/Invoker/InvokerDefault.php:74]
#18 Magento\Framework\Event\Invoker\InvokerDefault->dispatch(array('instance' => 'Magento\Framewor...', 'name' => 'legacy_model_sav...'), &Magento\Framework\Event\Observer#000000001d2edc2f0000000057697e5e#) called at [vendor/magento/framework/Event/Manager.php:66]
#19 Magento\Framework\Event\Manager->dispatch('magento_catalog_...', array('entity' => &Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#)) called at [generated/code/Magento/Framework/Event/Manager/Proxy.php:95]
#20 Magento\Framework\Event\Manager\Proxy->dispatch('magento_catalog_...', array('entity' => &Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#)) called at [vendor/magento/framework/EntityManager/EventManager.php:51]
#21 Magento\Framework\EntityManager\EventManager->dispatchEntityEvent('Magento\Catalog\...', 'save_after', array('entity' => &Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#)) called at [vendor/magento/framework/EntityManager/Operation/Update.php:110]
#22 Magento\Framework\EntityManager\Operation\Update->execute(&Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#, array()) called at [vendor/magento/framework/EntityManager/EntityManager.php:96]
#23 Magento\Framework\EntityManager\EntityManager->save(&Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#) called at [vendor/magento/module-catalog/Model/ResourceModel/Product.php:758]
#24 Magento\Catalog\Model\ResourceModel\Product->save(&Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#) called at [vendor/magento/framework/Interception/Interceptor.php:58]
#25 Magento\Catalog\Model\ResourceModel\Product\Interceptor->___callParent('save', array(&Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#)) called at [vendor/magento/framework/Interception/Interceptor.php:138]
#26 Magento\Catalog\Model\ResourceModel\Product\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#) called at [app/code/Amasty/ElasticSearch/Plugin/Catalog/Model/ResourceModel/Product.php:38]
#27 Amasty\ElasticSearch\Plugin\Catalog\Model\ResourceModel\Product->aroundSave(&Magento\Catalog\Model\ResourceModel\Product\Interceptor#000000001d2ec2920000000057697e5e#, &Closure#000000001d2edf920000000057697e5e#, &Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#) called at [vendor/magento/framework/Interception/Interceptor.php:135]
#28 Magento\Catalog\Model\ResourceModel\Product\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#) called at [vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Plugin/Product.php:58]
#29 Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Product->addCommitCallback(&Magento\Catalog\Model\ResourceModel\Product\Interceptor#000000001d2ec2920000000057697e5e#, &Closure#000000001d2edf920000000057697e5e#, &Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#) called at [vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Plugin/Product.php:28]
#30 Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Product->aroundSave(&Magento\Catalog\Model\ResourceModel\Product\Interceptor#000000001d2ec2920000000057697e5e#, &Closure#000000001d2edf920000000057697e5e#, &Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#) called at [vendor/magento/framework/Interception/Interceptor.php:135]
#31 Magento\Catalog\Model\ResourceModel\Product\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#) called at [vendor/magento/framework/App/Cache/FlushCacheByTags.php:69]
#32 Magento\Framework\App\Cache\FlushCacheByTags->aroundSave(&Magento\Catalog\Model\ResourceModel\Product\Interceptor#000000001d2ec2920000000057697e5e#, &Closure#000000001d2edf920000000057697e5e#, &Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#) called at [vendor/magento/framework/Interception/Interceptor.php:135]
#33 Magento\Catalog\Model\ResourceModel\Product\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#) called at [vendor/magento/framework/Interception/Interceptor.php:153]
#34 Magento\Catalog\Model\ResourceModel\Product\Interceptor->___callPlugins('save', array(&Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#), NULL) called at [generated/code/Magento/Catalog/Model/ResourceModel/Product/Interceptor.php:273]
#35 Magento\Catalog\Model\ResourceModel\Product\Interceptor->save(&Magento\Catalog\Model\Product\Interceptor#000000001d2edfe90000000057697e5e#) called at [vendor/magento/framework/Model/AbstractModel.php:655]
#36 Magento\Framework\Model\AbstractModel->save() called at [generated/code/Magento/Catalog/Model/Product/Interceptor.php:2442]
#37 Magento\Catalog\Model\Product\Interceptor->save() called at [vendor/magento/module-catalog/Controller/Adminhtml/Product/Save.php:142]
#38 Magento\Catalog\Controller\Adminhtml\Product\Save->execute() called at [generated/code/Magento/Catalog/Controller/Adminhtml/Product/Save/Interceptor.php:24]
#39 Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->execute() called at [vendor/magento/framework/App/Action/Action.php:108]
#40 Magento\Framework\App\Action\Action->dispatch(&Magento\Framework\App\Request\Http#000000001d2ec6fc0000000057697e5e#) called at [vendor/magento/module-backend/App/AbstractAction.php:231]
#41 Magento\Backend\App\AbstractAction->dispatch(&Magento\Framework\App\Request\Http#000000001d2ec6fc0000000057697e5e#) called at [vendor/magento/framework/Interception/Interceptor.php:58]
#42 Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->___callParent('dispatch', array(&Magento\Framework\App\Request\Http#000000001d2ec6fc0000000057697e5e#)) called at [vendor/magento/framework/Interception/Interceptor.php:138]
#43 Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Framework\App\Request\Http#000000001d2ec6fc0000000057697e5e#) called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:143]
#44 Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(&Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor#000000001d2ec2280000000057697e5e#, &Closure#000000001d2ec22c0000000057697e5e#, &Magento\Framework\App\Request\Http#000000001d2ec6fc0000000057697e5e#) called at [vendor/magento/framework/Interception/Interceptor.php:135]
#45 Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Framework\App\Request\Http#000000001d2ec6fc0000000057697e5e#) called at [vendor/magento/framework/Interception/Interceptor.php:153]
#46 Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->___callPlugins('dispatch', array(&Magento\Framework\App\Request\Http#000000001d2ec6fc0000000057697e5e#), NULL) called at [generated/code/Magento/Catalog/Controller/Adminhtml/Product/Save/Interceptor.php:39]
#47 Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->dispatch(&Magento\Framework\App\Request\Http#000000001d2ec6fc0000000057697e5e#) called at [vendor/magento/framework/App/FrontController.php:159]
#48 Magento\Framework\App\FrontController->processRequest(&Magento\Framework\App\Request\Http#000000001d2ec6fc0000000057697e5e#, &Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor#000000001d2ec2280000000057697e5e#) called at [vendor/magento/framework/App/FrontController.php:98]
#49 Magento\Framework\App\FrontController->dispatch(&Magento\Framework\App\Request\Http#000000001d2ec6fc0000000057697e5e#) called at [vendor/magento/framework/Interception/Interceptor.php:58]
#50 Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', array(&Magento\Framework\App\Request\Http#000000001d2ec6fc0000000057697e5e#)) called at [vendor/magento/framework/Interception/Interceptor.php:138]
#51 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Framework\App\Request\Http#000000001d2ec6fc0000000057697e5e#) called at [vendor/magento/framework/Interception/Interceptor.php:153]
#52 Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', array(&Magento\Framework\App\Request\Http#000000001d2ec6fc0000000057697e5e#), array(array('default_store_se...', 'page_cache_from_...', 'storeCookieValid...', 'install', 'configHash'))) called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:26]
#53 Magento\Framework\App\FrontController\Interceptor->dispatch(&Magento\Framework\App\Request\Http#000000001d2ec6fc0000000057697e5e#) called at [vendor/magento/framework/App/Http.php:116]
#54 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:24]
#55 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:261]
#56 Magento\Framework\App\Bootstrap->run(&Magento\Framework\App\Http\Interceptor#000000001d2ec6e30000000057697e5e#) called at [index.php:39]
</pre> [] []
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Magento 2.3.4 save product error admin

I've manage to fix this:

 

TRUNCATE catalog_url_rewrite_product_category

TRUNCATE url_rewrite

reindex

 

After doing this the problem is gone

View solution in original post

3 REPLIES 3

Re: Magento 2.3.4 save product error admin

Hello @capoan 

Did you check this thread?

https://community.magento.com/t5/Magento-2-x-Technical-Issues/No-such-entity-with-id-3/td-p/97833/pa...

Was my answer helpful? You can accept it as a solution.
175+ Professional Extensions for M1 & M2
Need a developer?Just visit Contact Us Now

Re: Magento 2.3.4 save product error admin

Hello @theMageComp ,

 

I've checked this and I do not have that categoryid. 

What I've tested extra is to disable flat table and is the same and also I have the same error even if I have no category selected.

 

Also I've check the data that is send via POST to /edit/ and I do not have this ID anywhere.

 

I can only assume that this is because of the data migration but I have no clue where to look into. 

Re: Magento 2.3.4 save product error admin

I've manage to fix this:

 

TRUNCATE catalog_url_rewrite_product_category

TRUNCATE url_rewrite

reindex

 

After doing this the problem is gone