cancel
Showing results for 
Search instead for 
Did you mean: 

error when set mode to production

error when set mode to production

Good morning,

 

My Magento 2 site have been very slow on admin panel. I have try to use this command to set it to production mode

 

php public_html/magento2/bin/magento deploy:mode:set -s production

 

this is the error afetr I use this command

 

Can anyone please help?

 

a:4:{i:0;s:75:"Unable to retrieve deployment version of static files from the file system.";i:1;s:6680:"#0 /home/cyberna1/public_html/magento2/vendor/magento/framework/App/View/Deployment/Version.php(77): Magento\Framework\App\View\Deployment\Version\Storage\File->load()
#1 /home/cyberna1/public_html/magento2/vendor/magento/framework/App/View/Deployment/Version.php(49): Magento\Framework\App\View\Deployment\Version->readValue('production')
#2 /home/cyberna1/public_html/magento2/vendor/magento/module-theme/Model/Url/Plugin/Signature.php(88): Magento\Framework\App\View\Deployment\Version->getValue()
#3 /home/cyberna1/public_html/magento2/vendor/magento/module-theme/Model/Url/Plugin/Signature.php(66): Magento\Theme\Model\Url\Plugin\Signature->renderUrlSignature()
#4 /home/cyberna1/public_html/magento2/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Theme\Model\Url\Plugin\Signature->aroundGetBaseUrl(Object(Magento\Store\Model\Store\Interceptor), Object(Closure), 'static', false)
#5 /home/cyberna1/public_html/magento2/var/generation/Magento/Store/Model/Store/Interceptor.php(143): Magento\Store\Model\Store\Interceptor->___callPlugins('getBaseUrl', Array, Array)
#6 /home/cyberna1/public_html/magento2/vendor/magento/framework/Url.php(452): Magento\Store\Model\Store\Interceptor->getBaseUrl('static', false)
#7 /home/cyberna1/public_html/magento2/vendor/magento/framework/View/Asset/Repository.php(266): Magento\Framework\Url->getBaseUrl(Array)
#8 /home/cyberna1/public_html/magento2/vendor/magento/framework/View/Asset/Repository.php(215): Magento\Framework\View\Asset\Repository->getFallbackContext('static', NULL, 'frontend', 'Smartwave/porto...', 'en_GB')
#9 /home/cyberna1/public_html/magento2/vendor/magento/framework/View/Page/Config.php(414): Magento\Framework\View\Asset\Repository->createAsset('mage/calendar.c...')
#10 /home/cyberna1/public_html/magento2/vendor/magento/framework/View/Page/Config/Generator/Head.php(116): Magento\Framework\View\Page\Config->addPageAsset('mage/calendar.c...', Array)
#11 /home/cyberna1/public_html/magento2/vendor/magento/framework/View/Page/Config/Generator/Head.php(93): Magento\Framework\View\Page\Config\Generator\Head->processAssets(Object(Magento\Framework\View\Page\Config\Structure))
#12 /home/cyberna1/public_html/magento2/vendor/magento/framework/View/Layout/GeneratorPool.php(86): Magento\Framework\View\Page\Config\Generator\Head->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))
#13 /home/cyberna1/public_html/magento2/vendor/magento/framework/View/Layout.php(327): Magento\Framework\View\Layout\GeneratorPool->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))
#14 /home/cyberna1/public_html/magento2/var/generation/Magento/Framework/View/Layout/Interceptor.php(89): Magento\Framework\View\Layout->generateElements()
#15 /home/cyberna1/public_html/magento2/vendor/magento/framework/View/Layout/Builder.php(129): Magento\Framework\View\Layout\Interceptor->generateElements()
#16 /home/cyberna1/public_html/magento2/vendor/magento/framework/View/Page/Builder.php(55): Magento\Framework\View\Layout\Builder->generateLayoutBlocks()
#17 /home/cyberna1/public_html/magento2/vendor/magento/framework/View/Layout/Builder.php(65): Magento\Framework\View\Page\Builder->generateLayoutBlocks()
#18 /home/cyberna1/public_html/magento2/vendor/magento/framework/View/Page/Config.php(197): Magento\Framework\View\Layout\Builder->build()
#19 /home/cyberna1/public_html/magento2/vendor/magento/framework/View/Page/Config.php(207): Magento\Framework\View\Page\Config->build()
#20 /home/cyberna1/public_html/magento2/vendor/magento/framework/View/Result/Page.php(227): Magento\Framework\View\Page\Config->publicBuild()
#21 /home/cyberna1/public_html/magento2/vendor/magento/framework/View/Result/Layout.php(164): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))
#22 /home/cyberna1/public_html/magento2/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#23 /home/cyberna1/public_html/magento2/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\View\Result\Page\Interceptor->___callParent('renderResult', Array)
#24 /home/cyberna1/public_html/magento2/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-...')
#25 /home/cyberna1/public_html/magento2/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))
#26 /home/cyberna1/public_html/magento2/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))
#27 /home/cyberna1/public_html/magento2/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-...')
#28 /home/cyberna1/public_html/magento2/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))
#29 /home/cyberna1/public_html/magento2/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))
#30 /home/cyberna1/public_html/magento2/var/generation/Magento/Framework/View/Result/Page/Interceptor.php(130): Magento\Framework\View\Result

\Page\Interceptor->___callPlugins('renderResult', Array, Array)

#31 /home/cyberna1/public_html/magento2/vendor/magento/framework/App/Http.php(139): Magento\Framework\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#32 /home/cyberna1/public_html/magento2/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#33 /home/cyberna1/public_html/magento2/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#34 {main}";s:3:"url";s:43:"/magento2/index.php/customer/account/login/";s:11:"script_name";s:19:"/magento2/index.php";}

4 REPLIES 4

Re: error when set mode to production

Hi @sudawan,

 

Maybe you can check if the file /path/to/magento/pub/static/deployed_version.txt exists. If not, you can create a blank file with that name and then try again.

Also take a look into the database, on the core_config_data table and set the dev/static/sign path to 0.

 

UPDATE core_config_data SET value = 0 WHERE path = 'dev/static/sign'

Re: error when set mode to production

Hi Damian,

 

Thank you for your reply.

 

I have check the file /path/to/magento/pub/static/deployed_version.txt and it is there

 

I have also try to solve it using this command

php public_html/magento2/bin/magento setup:static-content:deploy

 

Now the website is automatically redirect itself to localhost.

 

Can you help please?

Re: error when set mode to production

Hi Damian,

 

Thank you for your reply.

 

I have check the file /path/to/magento/pub/static/deployed_version.txt and it is there

 

I have also try to solve it using this command

php public_html/magento2/bin/magento setup:static-content:deploy

 

Now the website is automatically redirect itself to localhost.

 

Can you help please?

Re: error when set mode to production

Seems you have converted your store from the developer mode to the production mode and now the system is not able to create the folders and files automatically.

 

For the same, try below steps

 

php bin/magento cache:clean

 

php bin/magento cache:flush

 

remove everything(not .htacess) from pub, var, generated

 

php bin/magento setup:upgrade

 

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

 

php bin/magento setup:static-content:deploy en_AU --exclude-theme Magento/luma --exclude-theme Magento/blank -f

 

Here you go, check your frontend and admin, it should work like it should. Enjoy