cancel
Showing results for 
Search instead for 
Did you mean: 

Error in category page

SOLVED

Error in category page

I am working on magento 2.1.3 and I am facing error in category page can anyone help me 

1 exception(s):
Exception #0 (Exception): Warning: imagejpeg(/home/.../public_html/pub/media/catalog/product/cache/small_image/270x350/beff4985b56e3afdbeabfc89641a4582/t/o/towel-2.jpg): failed to open stream: Permission denied in /home/../public_html/vendor/magento/framework/Image/Adapter/Gd2.php on line 184

Exception #0 (Exception): Warning: imagejpeg(/home/.../public_html/pub/media/catalog/product/cache/small_image/270x350/beff4985b56e3afdbeabfc89641a4582/t/o/towel-2.jpg): failed to open stream: Permission denied in /home/.../public_html/vendor/magento/framework/Image/Adapter/Gd2.php on line 184
#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'imagejpeg(/home...', '/home/comforteg...', 184, Array)
#1 [internal function]: imagejpeg(Resource id #2551, '/home/comforteg...', 80)
#2 /home/.../public_html/vendor/magento/framework/Image/Adapter/Gd2.php(184): call_user_func_array('imagejpeg', Array)
#3 /home/comfortegypt/public_html/vendor/magento/framework/Image.php(79): Magento\Framework\Image\Adapter\Gd2->save('/home/comforteg...', NULL)
#4 /home/.../public_html/vendor/magento/module-catalog/Model/Product/Image.php(697): Magento\Framework\Image->save('/home/comforteg...')
#5 /home/..../public_html/vendor/magento/module-catalog/Helper/Image.php(468): Magento\Catalog\Model\Product\Image->saveFile()
#6 /home/.../public_html/vendor/magento/module-catalog/Helper/Image.php(540): Magento\Catalog\Helper\Image->applyScheduledActions()
#7 /home/..../public_html/vendor/magento/module-catalog/Block/Product/ImageBuilder.php(132): Magento\Catalog\Helper\Image->getResizedImageInfo()
#8 /home/..../public_html/vendor/magento/module-catalog/Block/Product/AbstractProduct.php(507): Magento\Catalog\Block\Product\ImageBuilder->create()
#9 /home/..../public_html/vendor/magento/framework/Interception/Interceptor.php(146): Magento\Catalog\Block\Product\AbstractProduct->getImage(Object(Magento\Catalog\Model\Product\Interceptor), 'category_page_g...', Array)
#10 /home/.../public_html/var/generation/Magento/Catalog/Block/Product/ListProduct/Interceptor.php(468): Magento\Catalog\Block\Product\ListProduct\Interceptor->___callPlugins('getImage', Array, Array)
#11 /home/..../public_html/app/design/frontend/Venustheme/fashion_child/Magento_Catalog/templates/product/list.phtml(179): Magento\Catalog\Block\Product\ListProduct\Interceptor->getImage(Object(Magento\Catalog\Model\Product\Interceptor), 'category_page_g...')
#12 /home/.../public_html/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/home/comforteg...')
#13 /home/..../public_html/vendor/magento/framework/View/Element/Template.php(255): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Catalog\Block\Product\ListProduct\Interceptor), '/home/comforteg...', Array)
#14 /home/.../public_html/var/generation/Magento/Catalog/Block/Product/ListProduct/Interceptor.php(557): Magento\Framework\View\Element\Template->fetchView('/home/comforteg...')
#15 /home/.../public_html/vendor/magento/framework/View/Element/Template.php(279): Magento\Catalog\Block\Product\ListProduct\Interceptor->fetchView('/home/comforteg...')
#16 /home/..../public_html/vendor/magento/framework/View/Element/AbstractBlock.php(659): Magento\Framework\View\Element\Template->_toHtml()
#17 /home/.../public_html/var/generation/Magento/Catalog/Block/Product/ListProduct/Interceptor.php(882): Magento\Framework\View\Element\AbstractBlock->toHtml()
#18 /home/.../public_html/vendor/magento/framework/View/Layout.php(542): Magento\Catalog\Block\Product\ListProduct\Interceptor->toHtml()
#19 /home/.../public_html/vendor/magento/framework/View/Layout.php(518): Magento\Framework\View\Layout->_renderBlock('category.produc...')
#20 /home/.../public_html/var/generation/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('category.produc...')
#21 /home/..../public_html/vendor/magento/framework/View/Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('category.produc...')
#22 /home/.../public_html/var/generation/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('category.produc...', true)
#23 /home/.../public_html/vendor/magento/framework/View/Element/AbstractBlock.php(499): Magento\Framework\View\Layout\Interceptor->renderElement('category.produc...', true)
#24 /home/.../public_html/vendor/magento/module-catalog/Block/Category/View.php(98): Magento\Framework\View\Element\AbstractBlock->getChildHtml('product_list')
#25 /home/.../public_html/vendor/magento/module-catalog/view/frontend/templates/category/products.phtml(18): Magento\Catalog\Block\Category\View->getProductListHtml()
#26 /home/.../public_html/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/home/comforteg...')
#27 /home/.../public_html/vendor/magento/framework/View/Element/Template.php(255): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Catalog\Block\Category\View), '/home/comforteg...', Array)
#28 /home/.../public_html/vendor/magento/framework/View/Element/Template.php(279): Magento\Framework\View\Element\Template->fetchView('/home/comforteg...')
#29 /home/.../public_html/vendor/magento/framework/View/Element/AbstractBlock.php(659): Magento\Framework\View\Element\Template->_toHtml()
#30 /home/.../public_html/vendor/magento/framework/View/Layout.php(542): Magento\Framework\View\Element\AbstractBlock->toHtml()
#31 /home/.../public_html/vendor/magento/framework/View/Layout.php(518): Magento\Framework\View\Layout->_renderBlock('category.produc...')
#32 /home/.../public_html/var/generation/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('category.produc...')
#33 /home/.../public_html/vendor/magento/framework/View/Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('category.produc...')
#34 /home/.../public_html/var/generation/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('category.produc...', true)
#35 /home/.../public_html/vendor/magento/framework/View/Layout.php(569): Magento\Framework\View\Layout\Interceptor->renderElement('category.produc...')
#36 /home/.../public_html/vendor/magento/framework/View/Layout.php(520): Magento\Framework\View\Layout->_renderContainer('content')
#37 /home/.../public_html/var/generation/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('content')
#38 /home/.../public_html/vendor/magento/framework/View/Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('content')
#39 /home/.../public_html/var/generation/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('content', true)
#40 /home/.../public_html/vendor/magento/framework/View/Layout.php(569): Magento\Framework\View\Layout\Interceptor->renderElement('content')
#41 /home/.../public_html/vendor/magento/framework/View/Layout.php(520): Magento\Framework\View\Layout->_renderContainer('main')
#42 /home/.../public_html/var/generation/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('main')
#43 /home/.../public_html/vendor/magento/framework/View/Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('main')
#44 /home/.../public_html/var/generation/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('main', true)
#45 /home/.../public_html/vendor/magento/framework/View/Layout.php(569): Magento\Framework\View\Layout\Interceptor->renderElement('main')
#46 /home/.../public_html/vendor/magento/framework/View/Layout.php(520): Magento\Framework\View\Layout->_renderContainer('columns')
#47 /home/.../public_html/var/generation/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('columns')
#48 /home/.../public_html/vendor/magento/framework/View/Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('columns')
#49 /home/.../public_html/var/generation/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('columns', true)
#50 /home/.../public_html/vendor/magento/framework/View/Layout.php(569): Magento\Framework\View\Layout\Interceptor->renderElement('columns')
#51 /home/.../public_html/vendor/magento/framework/View/Layout.php(520): Magento\Framework\View\Layout->_renderContainer('main.content')
#52 /home/.../public_html/var/generation/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('main.content')
#53 /home/.../public_html/vendor/magento/framework/View/Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('main.content')
#54 /home/.../public_html/var/generation/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('main.content', true)
#55 /home/.../public_html/vendor/magento/framework/View/Layout.php(569): Magento\Framework\View\Layout\Interceptor->renderElement('main.content')
#56 /home/.../public_html/vendor/magento/framework/View/Layout.php(520): Magento\Framework\View\Layout->_renderContainer('page.wrapper')
#57 /home/.../public_html/var/generation/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('page.wrapper')
#58 /home/.../public_html/vendor/magento/framework/View/Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('page.wrapper')
#59 /home/.../public_html/var/generation/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('page.wrapper', true)
#60 /home/.../public_html/vendor/magento/framework/View/Layout.php(569): Magento\Framework\View\Layout\Interceptor->renderElement('page.wrapper')
#61 /home/.../public_html/vendor/magento/framework/View/Layout.php(520): Magento\Framework\View\Layout->_renderContainer('root')
#62 /home/.../public_html/var/generation/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('root')
#63 /home/.../public_html/vendor/magento/framework/View/Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('root')
#64 /home/.../public_html/var/generation/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('root', true)
#65 /home/.../public_html/vendor/magento/framework/View/Layout.php(938): Magento\Framework\View\Layout\Interceptor->renderElement('root')
#66 /home/.../public_html/vendor/magento/framework/Interception/Interceptor.php(146): Magento\Framework\View\Layout->getOutput()
#67 /home/.../public_html/var/generation/Magento/Framework/View/Layout/Interceptor.php(494): Magento\Framework\View\Layout\Interceptor->___callPlugins('getOutput', Array, Array)
#68 /home/.../public_html/vendor/magento/framework/View/Result/Page.php(243): Magento\Framework\View\Layout\Interceptor->getOutput()
#69 /home/.../public_html/vendor/magento/framework/View/Result/Layout.php(164): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))
#70 /home/.../public_html/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#71 /home/.../public_html/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\View\Result\Page\Interceptor->___callParent('renderResult', Array)
#72 /home/.../public_html/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'renderResult', Object(Magento\Framework\View\Result\Page\Interceptor), Array, 'result-varnish-...')
#73 /home/.../public_html/vendor/magento/module-page-cache/Model/Controller/Result/VarnishPlugin.php(74): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
#74 /home/.../public_html/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\PageCache\Model\Controller\Result\VarnishPlugin->aroundRenderResult(Object(Magento\Framework\View\Result\Page\Interceptor), Object(Closure), Object(Magento\Framework\App\Response\Http\Interceptor))
#75 /home/.../public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'renderResult', Object(Magento\Framework\View\Result\Page\Interceptor), Array, 'result-builtin-...')
#76 /home/.../public_html/vendor/magento/module-page-cache/Model/Controller/Result/BuiltinPlugin.php(67): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
#77 /home/.../public_html/vendor/magento/framework/Interception/Interceptor.php(142): Magento\PageCache\Model\Controller\Result\BuiltinPlugin->aroundRenderResult(Object(Magento\Framework\View\Result\Page\Interceptor), Object(Closure), Object(Magento\Framework\App\Response\Http\Interceptor))
#78 /home/.../public_html/var/generation/Magento/Framework/View/Result/Page/Interceptor.php(130): Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', Array, Array)
#79 /home/.../public_html/vendor/magento/framework/App/Http.php(139): Magento\Framework\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#80 /home/.../public_html/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#81 /home/.../public_html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#82 {main}

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Error in category page

Corrected link. 

----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!

View solution in original post

10 REPLIES 10

Re: Error in category page

This looks like it's a permissions issue on the image cache directory (public_html/pub/media/catalog/product/cache/small_image/). You could dry deleting public_html/pub/media/catalog/product/cache/ and checking the permissions. The web server will need to be able to write to it. The exact permissions will differ depending on your setup. You typically want to lock them down as strict as possible. While you're validating whether it is indeed a permissions issue, you can lax them to 777 and then see if it works. 

----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!

Re: Error in category page

can you help me how to change the permission of (public_html/pub/media/catalog/product/cache/small_image/)

Re: Error in category page

I changed the permission and the error disappear but the product images doesn't appear on front end and placeholder appear instead, can you help me to fix this

Re: Error in category page

That sounds like there is still a permissions issue or cache issue. A placeholder image would be shown when Magento is unable to find the image for a product. If Magento is unable to write to that folder then this could happen as the images in this folder are generated by Magento on page load. It could also be a cache issue if there is full page cache enabled and it has not been flushed since you deleted the media folder. 

 

So, 2 things to do:

 

1) Double check permissions on the cache images folder (http://devdocs.magento.com/guides/v2.0/install-gde/prereq/file-system-perms.html)

2) Flush all cache. (http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cache.html#config-cli...

----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!

Re: Error in category page

First link doesn't work can yiu give me another link to guide me how to Double check permissions on the cache images folder 

Re: Error in category page

Corrected link. 

----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!

Re: Error in category page

when I tried to clear the cash with the command 

rm -R pub/static/*

I got this message

descend into directory ‘pub/static/frontend’?

, and I don't know what should I do 

please advice

Re: Error in category page

Try 

 

rm -rf pub/static/*

----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!

Re: Error in category page

It doesn't help the site look Missy when I run the command and the images doesn't appear, I had to return the backup folder of static again, do you know what the other files permission I should check