Some images could not be resized after server migration

Hi,

 

I am getting the following error every time I try to add a new image. If I set the new image to hidden, before saving my product, the image get saved.

Capture.PNG

This Magento store was upgraded from Magento 1.9 to mag 2.2.6 but it is working fine on the website I did the upgrade, I did it on another server with a different domain. After I migrated everything to the new server, an AWS EC2 server running Ubuntu with all the server requirements listed on the Magento website, I did the following:

 

– migrated all the data to MySQL

– Migrated all the files and corrected the file permissions

– I did run the following:

php bin/magento setup:di:compile (just in case)

php bin/magento setup:static-content:deploy es_ES -f

php bin/magento setup:static-content:deploy -f (for the English lang)

php bin/magento indexer:reindex

php bin/magento cache:clean

php bin/magento cache:flush

 

I disabled cache and enabled it again, but nothing works. As I said above, everything works fine on my other server. I did updated the PHP configuration, reinstalled php, used the same version of php, nothing works.

 

Here is the system.log error that it is showing when I try to save a product with an image

 

This is the error on my var/log/system.log file:

[2019-07-23 23:40:02] main.ERROR: The image could not be resized: /home/ServerUser/public_html/pub/media/catalog/product/h/i/hidrolavadora_t50_1.jpg [] []
[2019-07-23 23:40:02] main.ERROR: Notice: Undefined index: dirname in /home/ServerUser/public_html/vendor/magento/framework/Image/Adapter/AbstractAdapter.php on line 520 [] []
[2019-07-23 23:40:02] main.ERROR: The image could not be resized: /home/ServerUser/public_html/pub/media/catalog/product/h/i/hidrolavadora_t50_1.jpg [] []
[2019-07-23 23:40:02] main.ERROR: Notice: Undefined index: dirname in /home/ServerUser/public_html/vendor/magento/framework/Image/Adapter/AbstractAdapter.php on line 520 [] []
[2019-07-23 23:40:02] main.ERROR: The image could not be resized: /home/ServerUser/public_html/pub/media/catalog/product/h/i/hidrolavadora_t50_1.jpg [] []
[2019-07-23 23:40:02] main.ERROR: Notice: Undefined index: dirname in /home/ServerUser/public_html/vendor/magento/framework/Image/Adapter/AbstractAdapter.php on line 520 [] []
[2019-07-23 23:40:02] main.ERROR: The image could not be resized: /home/ServerUser/public_html/pub/media/catalog/product/h/i/hidrolavadora_t50_1.jpg [] []
[2019-07-23 23:40:02] main.CRITICAL: Exception message: Some images could not be resized. See log file for details.
Trace: #0 /home/ServerUser/public_html/vendor/magento/module-catalog/Model/Product.php(957): MagentoCatalogModelProductImageCache->generate(Object(MagentoCatalogModelProductInterceptor))
#1 /home/ServerUser/public_html/vendor/magento/framework/EntityManager/Observer/AfterEntitySave.php(31): MagentoCatalogModelProduct->afterSave()
#2 /home/ServerUser/public_html/vendor/magento/framework/Event/Invoker/InvokerDefault.php(72): MagentoFrameworkEntityManagerObserverAfterEntitySave->execute(Object(MagentoFrameworkEventObserver))
#3 /home/ServerUser/public_html/vendor/magento/framework/Event/Invoker/InvokerDefault.php(60): MagentoFrameworkEventInvokerInvokerDefault->_callObserverMethod(Object(MagentoFrameworkEntityManagerObserverAfterEntitySave), Object(MagentoFrameworkEventObserver))
#4 /home/ServerUser/public_html/vendor/magento/framework/Event/Manager.php(66): MagentoFrameworkEventInvokerInvokerDefault->dispatch(Array, Object(MagentoFrameworkEventObserver))
#5 /home/ServerUser/public_html/generated/code/Magento/Framework/Event/Manager/Proxy.php(95): MagentoFrameworkEventManager->dispatch('magento_catalog...', Array)
#6 /home/ServerUser/public_html/vendor/magento/framework/EntityManager/EventManager.php(52): MagentoFrameworkEventManagerProxy->dispatch('magento_catalog...', Array)
#7 /home/ServerUser/public_html/vendor/magento/framework/EntityManager/Operation/Update.php(110): MagentoFrameworkEntityManagerEventManager->dispatchEntityEvent('Magento\Catalog...', 'save_after', Array)
#8 /home/ServerUser/public_html/vendor/magento/framework/EntityManager/EntityManager.php(96): MagentoFrameworkEntityManagerOperationUpdate->execute(Object(MagentoCatalogModelProductInterceptor), Array)
#9 /home/ServerUser/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product.php(655): MagentoFrameworkEntityManagerEntityManager->save(Object(MagentoCatalogModelProductInterceptor))
#10 /home/ServerUser/public_html/vendor/magento/framework/Interception/Interceptor.php(58): MagentoCatalogModelResourceModelProduct->save(Object(MagentoCatalogModelProductInterceptor))
#11 /home/ServerUser/public_html/vendor/magento/framework/Interception/Interceptor.php(138): MagentoCatalogModelResourceModelProductInterceptor->___callParent('save', Array)
#12 /home/ServerUser/public_html/vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Plugin/Product.php(51): MagentoCatalogModelResourceModelProductInterceptor->MagentoFrameworkInterception{closure}(Object(MagentoCatalogModelProductInterceptor))
#13 /home/ServerUser/public_html/vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Plugin/Product.php(24): MagentoCatalogSearchModelIndexerFulltextPluginProduct->addCommitCallback(Object(MagentoCatalogModelResourceModelProductInterceptor), Object(Closure), Object(MagentoCatalogModelProductInterceptor))
#14 /home/ServerUser/public_html/vendor/magento/framework/Interception/Interceptor.php(135): MagentoCatalogSearchModelIndexerFulltextPluginProduct->aroundSave(Object(MagentoCatalogModelResourceModelProductInterceptor), Object(Closure), Object(MagentoCatalogModelProductInterceptor))
#15 /home/ServerUser/public_html/vendor/magento/framework/App/Cache/FlushCacheByTags.php(68): MagentoCatalogModelResourceModelProductInterceptor->MagentoFrameworkInterception{closure}(Object(MagentoCatalogModelProductInterceptor))
#16 /home/ServerUser/public_html/vendor/magento/framework/Interception/Interceptor.php(135): MagentoFrameworkAppCacheFlushCacheByTags->aroundSave(Object(MagentoCatalogModelResourceModelProductInterceptor), Object(Closure), Object(MagentoCatalogModelProductInterceptor))
#17 /home/ServerUser/public_html/vendor/magento/framework/Interception/Interceptor.php(153): MagentoCatalogModelResourceModelProductInterceptor->MagentoFrameworkInterception{closure}(Object(MagentoCatalogModelProductInterceptor))
#18 /home/ServerUser/public_html/generated/code/Magento/Catalog/Model/ResourceModel/Product/Interceptor.php(39): MagentoCatalogModelResourceModelProductInterceptor->___callPlugins('save', Array, Array)
#19 /home/ServerUser/public_html/vendor/magento/framework/Model/AbstractModel.php(647): MagentoCatalogModelResourceModelProductInterceptor->save(Object(MagentoCatalogModelProductInterceptor))
#20 /home/ServerUser/public_html/vendor/magento/module-catalog/Controller/Adminhtml/Product/Save.php(111): MagentoFrameworkModelAbstractModel->save()
#21 /home/ServerUser/public_html/vendor/magento/framework/App/Action/Action.php(107): MagentoCatalogControllerAdminhtmlProductSave->execute()
#22 /home/ServerUser/public_html/vendor/magento/module-backend/App/AbstractAction.php(235): MagentoFrameworkAppActionAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
#23 /home/ServerUser/public_html/vendor/magento/framework/Interception/Interceptor.php(58): MagentoBackendAppAbstractAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
#24 /home/ServerUser/public_html/vendor/magento/framework/Interception/Interceptor.php(138): MagentoCatalogControllerAdminhtmlProductSaveInterceptor->___callParent('dispatch', Array)
#25 /home/ServerUser/public_html/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): MagentoCatalogControllerAdminhtmlProductSaveInterceptor->MagentoFrameworkInterception{closure}(Object(MagentoFrameworkAppRequestHttp))
#26 /home/ServerUser/public_html/vendor/magento/framework/Interception/Interceptor.php(135): MagentoBackendAppActionPluginAuthentication->aroundDispatch(Object(MagentoCatalogControllerAdminhtmlProductSaveInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#27 /home/ServerUser/public_html/vendor/magento/framework/Interception/Interceptor.php(153): MagentoCatalogControllerAdminhtmlProductSaveInterceptor->MagentoFrameworkInterception{closure}(Object(MagentoFrameworkAppRequestHttp))
#28 /home/ServerUser/public_html/generated/code/Magento/Catalog/Controller/Adminhtml/Product/Save/Interceptor.php(26): MagentoCatalogControllerAdminhtmlProductSaveInterceptor->___callPlugins('dispatch', Array, NULL)
#29 /home/ServerUser/public_html/vendor/magento/framework/App/FrontController.php(55): MagentoCatalogControllerAdminhtmlProductSaveInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
#30 /home/ServerUser/public_html/vendor/magento/framework/Interception/Interceptor.php(58): MagentoFrameworkAppFrontController->dispatch(Object(MagentoFrameworkAppRequestHttp))
#31 /home/ServerUser/public_html/vendor/magento/framework/Interception/Interceptor.php(138): MagentoFrameworkAppFrontControllerInterceptor->___callParent('dispatch', Array)
#32 /home/ServerUser/public_html/vendor/magento/framework/Interception/Interceptor.php(153): MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterception{closure}(Object(MagentoFrameworkAppRequestHttp))
#33 /home/ServerUser/public_html/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): MagentoFrameworkAppFrontControllerInterceptor->___callPlugins('dispatch', Array, Array)
#34 /home/ServerUser/public_html/vendor/magento/framework/App/Http.php(135): MagentoFrameworkAppFrontControllerInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
#35 /home/ServerUser/public_html/vendor/magento/framework/App/Bootstrap.php(257): MagentoFrameworkAppHttp->launch()
#36 /home/ServerUser/public_html/index.php(39): MagentoFrameworkAppBootstrap->run(Object(MagentoFrameworkAppHttpInterceptor))
#37 {main} [] []