Closed navarr closed 7 years ago
Is it possible your database was out of sync with your config.php
file? If the plugin was enabled previously shouldn't the tables already exist in the database?
In our workflow we have multiple developers working on a single site. A developer would add a module in a local environment (adding it to config.php). Our deployment process would roll that out to other sites, and other developers would pull in the branch, composer install
and setup:upgrade
- we think that last step (along with it already being enabled in config.php) is what leads up to this issue.
It's likely going to occur in any caching module, and may just be a result of our environment and process.
I assume you don't have this error with other Magento2 plugins because they don't have a database component?
Honestly outside of developing this plugin I don't have much experience with Magento. setup:upgrade
updates the database schema so each developer would only need to run it once after they pull the branch for the first time right? Are they running it every time they composer install
or just the first time?
I don't think I see a work around here. If config.php
in VCS shows the module enabled then you shouldn't need to run setup:upgrade
.
This issue only occurs with Cloudflare because Cloudflare takes actions when the cache is cleaned out, which Magento does during setup:upgrade before it runs the actual upgrade scripts.
So it's enabled in the config.php through VCS, then they need to upgrade their database structure (which most people use setup:upgrade for).
An example future situation where this might occur would be - say you modify the database structure for the CloudFlare plugin. This new structure is used by the mechanism triggered from the cache clearing event. When a user runs setup:upgrade
to upgrade your schema, a database error would occur.
A possible fix might be to fail gracefully from database errors during the cache flushing process - catching and logging Zend DB exceptions where as right now they pass through and end the setup process.
Ah, that makes sense! Thank you for the explanation. We can definitely handle cache purge DB errors more gracefully.
Hi @navarr,
This should be fixed in 1.1.6.
Thanks, John
Forewarning: I don't have perfect recreation steps, but wanted to go ahead and let you know what's going on.
My colleague got one of these when he was running
setup:upgrade
after pulling down my code with the module installed:Attached a debugger to Zend_Exception to find the stack trace, and it's being triggered because part of the
setup:upgrade
process is re-organizingapp/etc/config.php
. Our problem then is that (like good developers) we keepapp/etc/config.php
in version control - so CloudFlare was already enabled and when it came time to clear the cache it failed.I realize this might be an edge-case. We easily worked around it by running the individual schema and data upgrade scripts.
Either way, I wanted to at least document it here.