Hi guys, I hope you are well! One query, I was doing the following on my server for a routine maintenance issue.
Install module with composer
Enable module cleaning static content
Do setup: upgrade
After that, the server basically fell. Throwing me, only the following: "System is gong Down for halt Now", and likewise the following: failed to open stream: No such file or directory in \ / home \ / tekstore \ / public_html \ / vendor \ / magento \ /framework\/View\/Result\/Page.php on line 327 "," 1 ":" <pre> # 1 include () called at [vendor \ / magento \ / framework \ / View \ / Result \ / Page .php: 327]
Do you have any solution, or any idea what might be happening, or what can I review?
Thanks!
Solved! Go to Solution.
Hi @luis_suarez2,
It looks like static content not deployed properly.
Try once the following commands in the sequence.
chmod -R 0777 var/ pub/ generated/ php bin/magento setup:static-content:deploy -f php bin/magento cache:flush chmod -R 0777 var/ pub/ generated/
Are you on developer mode? you can check by the following command:
php bin/magento deploy:mode:show To set different mode php bin/magento deploy:mode:set production
When you switch to production mode, then magento run all necessary commands in the sequence.
BTW the sequence should be:
chmod -R 0777 var/ pub/ generated/ rm -rf var/cache/* var/view_preprocessed/* generated/* pub/static/* php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy -f php bin/magento cache:flush php bin/magento indexer:reindex chmod -R 0777 var/ pub/ generated/
If there are any permissions issue on the server, then you can try following command.
sudo find . -type d -exec chmod 755 {} \; && find . -type f -exec chmod 644 {} \; && chmod u+x bin/magento sudo chmod -R 0777 var/ pub/ generated/
I hope it will help you.
Act--
I am currently running the static content command. the slowness of the server disappeared, but in the URL it throws the following (annex screenshots)
Act -
The server log is as follows:
{"0": "Warning: include (\ / home \ / tekstore \ / public_html \ / var \ / view_preprocessed \ / pub \ / static \ / vendor \ / magento \ / module-theme \ / view \ / base \ / templates \ /root.phtml): failed to open stream: No such file or directory in \ / home \ / tekstore \ / public_html \ / vendor \ / magento \ / framework \ / View \ / Result \ / Page.php on line 327 "," 1 ":" <pre> # 1 include () called at [vendor \ / magento \ / framework \ / View \ / Result \ /Page.php: 327] \
Hi @luis_suarez2,
It looks like static content not deployed properly.
Try once the following commands in the sequence.
chmod -R 0777 var/ pub/ generated/ php bin/magento setup:static-content:deploy -f php bin/magento cache:flush chmod -R 0777 var/ pub/ generated/
Are you on developer mode? you can check by the following command:
php bin/magento deploy:mode:show To set different mode php bin/magento deploy:mode:set production
When you switch to production mode, then magento run all necessary commands in the sequence.
BTW the sequence should be:
chmod -R 0777 var/ pub/ generated/ rm -rf var/cache/* var/view_preprocessed/* generated/* pub/static/* php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy -f php bin/magento cache:flush php bin/magento indexer:reindex chmod -R 0777 var/ pub/ generated/
If there are any permissions issue on the server, then you can try following command.
sudo find . -type d -exec chmod 755 {} \; && find . -type f -exec chmod 644 {} \; && chmod u+x bin/magento sudo chmod -R 0777 var/ pub/ generated/
I hope it will help you.
Hello @luis_suarez2 ,
I think it is permission issue. You need to give root permissions to your magento 2 instance , Login with SSH and go to Magento 2 root path, execute the following commands:
find app/code pub/static app/etc var/generation var/di var/view_preprocessed vendor \( -type f -or -type d \) -exec chmod u-w {} \; && chmod o-rwx app/etc/env.php && chmod u+x bin/magento
You can also read documentation related to Permission by Magento own,
https://devdocs.magento.com/guides/v2.3/config-guide/prod/prod_file-sys-perms.html
I hope this will work for you, if still you face any issue please let me know.
If it helps you, please accept it as solution and give kudos.
Regards.
Hello everyone, the problem we had was indeed, a permissions issue and that additionally, the static content was not being displayed, in advance, thank you very much to all.
Now though, the topic was that the server was down. The main reason for its failure was the following:
We update an extension directly with Composer, at the time of making it, the Magento cache is disabled, the application worked for a long time without it, which I realized will considerably increase the consumption of server resources.