1

I'm getting error when , going to clear cache from backend admin. 'flush static cache '( Preprocessed view files and static files) button only.

Because of this error i'm not able to clear static files, like css

Full error was:

FilesystemIterator::__construct(/var/www/html/pub/static/_requirejs/frontend/Magento): failed to open dir: Permission denied
#0 /var/www/html/vendor/magento/framework/Filesystem/Driver/File.php(398): FilesystemIterator->__construct('/var/www/html/p...', 12288)
#1 /var/www/html/vendor/magento/framework/Filesystem/Driver/File.php(402): Magento\Framework\Filesystem\Driver\File->deleteDirectory('/var/www/html/p...')
#2 /var/www/html/vendor/magento/framework/Filesystem/Driver/File.php(402): Magento\Framework\Filesystem\Driver\File->deleteDirectory('/var/www/html/p...')
#3 /var/www/html/vendor/magento/framework/Filesystem/Directory/Write.php(175): Magento\Framework\Filesystem\Driver\File->deleteDirectory('/var/www/html/p...')
#4 /var/www/html/vendor/magento/framework/App/State/CleanupFiles.php(105): Magento\Framework\Filesystem\Directory\Write->delete('_requirejs')
#5 /var/www/html/vendor/magento/framework/App/State/CleanupFiles.php(66): Magento\Framework\App\State\CleanupFiles->emptyDir('static')
#6 /var/www/html/vendor/magento/module-backend/Controller/Adminhtml/Cache/CleanStaticFiles.php(20): Magento\Framework\App\State\CleanupFiles->clearMaterializedViewFiles()
#7 /var/www/html/var/generation/Magento/Backend/Controller/Adminhtml/Cache/CleanStaticFiles/Interceptor.php(25): Magento\Backend\Controller\Adminhtml\Cache\CleanStaticFiles->execute()
#8 /var/www/html/vendor/magento/framework/App/Action/Action.php(102): Magento\Backend\Controller\Adminhtml\Cache\CleanStaticFiles\Interceptor->execute()
#9 /var/www/html/vendor/magento/module-backend/App/AbstractAction.php(226): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#10 [internal function]: Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http))
#11 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(74): call_user_func_array(Array, Array)
#12 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Backend\Controller\Adminhtml\Cache\CleanStaticFiles\Interceptor->___callParent('dispatch', Array)
#13 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Backend...', 'dispatch', Object(Magento\Backend\Controller\Adminhtml\Cache\CleanStaticFiles\Interceptor), Array, 'adminAuthentica...')
#14 /var/www/html/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#15 [internal function]: Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(Magento\Backend\Controller\Adminhtml\Cache\CleanStaticFiles\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#16 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): call_user_func_array(Array, Array)
#17 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Backend...', 'dispatch', Object(Magento\Backend\Controller\Adminhtml\Cache\CleanStaticFiles\Interceptor), Array, 'designLoader')
#18 /var/www/html/vendor/magento/framework/App/Action/Plugin/Design.php(39): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#19 [internal function]: Magento\Framework\App\Action\Plugin\Design->aroundDispatch(Object(Magento\Backend\Controller\Adminhtml\Cache\CleanStaticFiles\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#20 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): call_user_func_array(Array, Array)
#21 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(136): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Backend...', 'dispatch', Object(Magento\Backend\Controller\Adminhtml\Cache\CleanStaticFiles\Interceptor), Array, 'adminMassaction...')
#22 /var/www/html/vendor/magento/module-backend/App/Action/Plugin/MassactionKey.php(33): Magento\Backend\Controller\Adminhtml\Cache\CleanStaticFiles\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#23 [internal function]: Magento\Backend\App\Action\Plugin\MassactionKey->aroundDispatch(Object(Magento\Backend\Controller\Adminhtml\Cache\CleanStaticFiles\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#24 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(140): call_user_func_array(Array, Array)
#25 /var/www/html/var/generation/Magento/Backend/Controller/Adminhtml/Cache/CleanStaticFiles/Interceptor.php(40): Magento\Backend\Controller\Adminhtml\Cache\CleanStaticFiles\Interceptor->___callPlugins('dispatch', Array, Array)
#26 /var/www/html/vendor/magento/framework/App/FrontController.php(55): Magento\Backend\Controller\Adminhtml\Cache\CleanStaticFiles\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#27 [internal function]: Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#28 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(74): call_user_func_array(Array, Array)
#29 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#30 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(136): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install')
#31 /var/www/html/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#32 [internal function]: Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#33 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(140): call_user_func_array(Array, Array)
#34 /var/www/html/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#35 /var/www/html/vendor/magento/framework/App/Http.php(115): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#36 /var/www/html/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#37 /var/www/html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))

closed as off-topic by 7ochem, Manoj Deswal, Jai, Amit Bera, Manashvi Birla Dec 21 '17 at 12:35

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced OR seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – 7ochem, Manoj Deswal, Jai, Amit Bera, Manashvi Birla
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    You should be set permission 777 for pub folder – Bill Dec 21 '17 at 9:59
  • should i set to pub ? or just pub/static? – Ganesh Dec 21 '17 at 10:03
0

yes this help me:

sudo chmod -R 777 /var/www/html/pub/static/*

Not the answer you're looking for? Browse other questions tagged or ask your own question.