-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Don't assume a frontend cache section exists in the env.php file. #38119
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
Don't assume a frontend cache section exists in the env.php file. #38119
Conversation
Hi @hostep. Thank you for your contribution! Add the comment under your pull request to deploy test or vanilla Magento instance:
❗ Automated tests can be triggered manually with an appropriate comment:
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
6aed4dd
to
8b62461
Compare
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@magento run Functional Tests B2B,Functional Tests CE |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@magento run Functional Tests B2B,Functional Tests CE |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@magento run Functional Tests CE |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@magento create issue |
@engcom-Hotel: you realize that this was already approved and merged? :p |
Description (*)
Code exists in Magento that assumes your
app/etc/env.php
will always contain afrontend
section if there is acache
section. Like this:But that's not always the case. All shops that were setup before Magento 2.3.1 didn't have a
cache
section in theirenv.php
file in a default installation (if they didn't use Redis as caching).If they now upgrade to Magento 2.4.4 or higher and use a graphql endpoint, Magento automatically writes
cache > graphql > id_salt
to theenv.php
file and so introduces acache
section without afrontend
section.This then leads to this crash on every execution within Magento (frontend, backoffice,
bin/magento
, ...):This PR fixes this.
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
app/etc/env.php
file and remove the entirefrontend
section in thecache
sectionbin/magento
or visit the frontendvendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist lib/internal/Magento/Framework/App/Test/Unit/Cache/Frontend/PoolTest.php
)More elaborate testing scenario that can cause this situation:
app/etc/env.php
file contains nocache
sectionbin/magento setup:upgrade
app/etc/env.php
file will be updated to a new format, but will still not contain acache
section./graphql
urlapp/etc/env.php
file and see that acache
section has appeared with agraphql
section but nofrontend
sectionbin/magento
Questions or comments
Should we expect that when we run
bin/magento setup:upgrade
it will update yourapp/etc/env.php
file with all missing sections? Would people expect this? Or will this cause issues in some scenario's? Runningbin:magento setup:config:set
without extra flags does exactly that. That seems to be some kind of hidden feature ...Contribution checklist (*)
Resolved issues: