-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to enable maintenance mode when env.php is read only #24229
Comments
Hi @ihor-sviziev. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. @ihor-sviziev do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
✅ Confirmed by @engcom-Charlie Issue Available: @engcom-Charlie, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
#cd19latam |
Hi @irving0mar. Thank you for working on this issue.
|
We can't reproduce this issue on Centos 7 and Magento 2.3-develop, give us more information please. For example, what is the OS you are using. |
I had this issue on Ubuntu 18.04 and on Amazon Linux (Cent OS based). I don’t think it’s related. |
#cd-cologne19 |
@Parakoopa thank you for joining. Please accept team invitation here and self-assign the issue. |
Hi @Parakoopa. Thank you for working on this issue.
|
This issue is somewhat related to #4955. The best solution for the future would probably to solve that issue, this will also allow changing any cache state with a read-only env.php. As a simple solution for this issue I will remove the observer |
…ublic cache headers - Removes the observer for disabling and re-enabling the FPC during maintenande mode switch - Disables setting public cache headers, if maintenance mode is enabled - phpcs:ignore entries were added in places where no actual code was changed by this commit, but static tests failed
Hi @ihor-sviziev. Thank you for your report. The fix will be available with the upcoming 2.4.0 release. |
Preconditions (*)
chmod -w app/etc/env.php
orchmod 754 app/etc/env.php
Steps to reproduce (*)
php bin/magento maintenance:enable -v
Expected result (*)
Actual result (*)
Additional info
Why it's important to keep
env.php
file read only - on production servers it's the only one way to make sure that no one will disable cache --> website will work fine.My investigation shown that this issue appeared in 0e37353.
If i'll remove following observer - it works fine:
magento2/app/code/Magento/PageCache/etc/events.xml
Lines 60 to 62 in 0e37353
I reviewed this commit and actually it's ok that FPC should not cache pages in maintenance mode, but disabling FPC at all- the wrong way.
What I would suggest - revert changes that were done in 0e37353 and add checking for maintenance flag in when we're sending public
Cache-Control
headersThe text was updated successfully, but these errors were encountered: