Skip to content
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

[WIP] Possible conflict with Woocommerce 4.4.0 #3003

Closed
alfonso100 opened this issue Aug 18, 2020 · 35 comments · Fixed by #3004
Closed

[WIP] Possible conflict with Woocommerce 4.4.0 #3003

alfonso100 opened this issue Aug 18, 2020 · 35 comments · Fixed by #3004
Labels
3rd party compatibility Issues related to 3rd party compatibility like theme, plugin or hosting priority: 🔥critical The plugin or the website are unusable, it affects a significant number of customers

Comments

@alfonso100
Copy link
Contributor

alfonso100 commented Aug 18, 2020

We're receiving tickets from customers having a fatal error after updating Woocommerce to 4.4.0.
Still investigating this. According to Remy, it looks like they are using the same container package as us, but not the same version, they are on the new one that requires PHP 7 and that includes breaking changes.

Errors are similar to this:
Fatal error: Declaration of League\Container\ImmutableContainerAwareTrait::getContainer() must be compatible with League\Container\Argument\ArgumentResolverTrait::getContainer(): Psr\Container\ContainerInterface in /home/446954.cloudwaysapps.com/krxgzndejz/public_html/wp-content/plugins/wp-rocket/vendor/league/container/src/Inflector/Inflector.php on line 32

@Tabrisrp Tabrisrp added the 3rd party compatibility Issues related to 3rd party compatibility like theme, plugin or hosting label Aug 18, 2020
@Tabrisrp
Copy link
Contributor

WooCommerce 4.4 started to use the same container package as us: https://github.com/woocommerce/woocommerce/blob/b3097dbae6533efd569be95c20076a68bc146714/composer.json#L14

But they are using version 3, which is only compatible with PHP 7, while we still use version 2 (for now).

Composer being what it is, only one version of the package is loaded, during the runtime, and Since version 2 & 3 of the container are not compatible, it's preventing our code from running as expected.

@MrGKanev
Copy link

Same problem with 7 clients. Any workaround except stopping the plugin?

@101sam
Copy link

101sam commented Aug 18, 2020

Yep got it also on all my sites, just disable until the new release

@MrGKanev
Copy link

There is a PR about it. Hopefully, it can be merged soon.

@GeekPress GeekPress added the priority: 🔥critical The plugin or the website are unusable, it affects a significant number of customers label Aug 18, 2020
@reformedcigars
Copy link

reformedcigars commented Aug 18, 2020

Same. 20+ client sites affected. Not cool.

@iCaspar
Copy link
Contributor

iCaspar commented Aug 18, 2020

PR is now in QA. Making sure we don't break anything else or have any regressions. Once we can confirm it's all good, we'll be releasing.

@hellofromtonya
Copy link
Contributor

hellofromtonya commented Aug 18, 2020

Hello @MrGKanev @101sam @joshlcomstock,

WooCommerce released 4.4 earlier today which included changing the container (League Container) to a PHP 7 only version. Rocket also uses the League Container; however, we use a PHP 5.6 compatible version.

The fatal error occurs when either plugin loads the container first. How? Each expects a particular version, but only one version gets loaded into memory by Composer.

The 3.6.4 fix that's in QA right now will be released today...very shortly.

What did we change?

  1. The Container version we need is now packaged inside of Rocket's Engine (not loaded via Composer).
  2. Th namespaces for it are renamed.

How does this fix the problem?

  1. WooCommerce uses the League\Container classes, traits, etc.
  2. Rocket now uses the WP_Rocket\Engine\Container - which is a copy of the League Container files ... renamed.

To PHP, these files of classes, traits, etc. are now different. No more fatal errors from this problem.

@ChrisSmoke1
Copy link

ChrisSmoke1 commented Aug 18, 2020

@iCaspar @hellofromtonya

Well, i cant downgrade wordpress/woocommerce anymore. Wp rocket now disabled during this fatal error but can i still update and re-activate it? Because it's not activated right now and if i remember well wp rocket can only be updated when it's enabled..

@ChrisSmoke1
Copy link

support@wp-rocket.me is also not receiving any mails, Mail Delivery System - user over quota...

@reformedcigars
Copy link

I have just gone through and deactivated the WooCommerce 4.4.0 plugin and WP-Rocket is able to be reactivated without issue. Hopefully, WC releases their fix soon.

@hellofromtonya
Copy link
Contributor

support@wp-rocket.me is also not receiving any mails, Mail Delivery System - user over quota...

Sorry about that @ChrisSmoke1. We cleared out the email server and emails are flowing again. Can you resend to us please? I apologize in advance for the inconvenience.

Tabrisrp added a commit that referenced this issue Aug 18, 2020
…3004)

* add Container classes
* replace League\Container with WP_Rocket\Engine\Container
* Add permissions_callback to RESTSubscriber routes
* Fix syntax error
* update container namespace in our files
* update composer.json not to require League Container
* update plugin version
* add container dependency
* Adjust tests not to support jquery-migrate after WP version 5.5 PR #2991
* ignore Container directory

Co-authored-by: Ahmed Saeed <eng.ahmeds3ed@gmail.com>
Co-authored-by: Caspar Green <cg@caspar.green>
@hellofromtonya
Copy link
Contributor

hellofromtonya commented Aug 18, 2020

Well, i cant downgrade wordpress/woocommerce anymore. Wp rocket now disabled during this fatal error but can i still update and re-activate it? Because it's not activated right now and if i remember well wp rocket can only be updated when it's enabled..

@ChrisSmoke1 Yes, Rocket needs to be activated in order to update it through the admin area. However, reactivating it now will cause a fatal error since WooCommerce is at version 4.4. on your site.

What can you do? Please reach out to our Support team for guidance on how to load the Rocket 3.6.4. Here's a reference for you too.

@sknight80
Copy link

I did this, I download the plugin and I uploaded to my webserver. That worked for me.

@hellofromtonya
Copy link
Contributor

@sknight80 That's wonderful!

@hellofromtonya
Copy link
Contributor

@MrGKanev @101sam @joshlcomstock

We have released 3.6.4 with the fix for fatal error due to conflicts with WooCommerce 4.4 release. Here is a document that guides you in how to update Rocket.

Thank you for your patience.

@MrGKanev
Copy link

Yep, I saw it the moment it went up. Thanks! :)

@DanielRuf
Copy link

Like described in woocommerce/woocommerce#27384 namespaced / scoped dependencies should prevent such cases in the future:

Not sure if namespaced dependencies are used but this would prevent such issues in the longterm:

https://github.com/humbug/php-scoper
https://github.com/coenjacobs/mozart
https://github.com/TypistTech/imposter-plugin

So the composer autoloader will not use the wrong class / dependency with a different interface.

@hellofromtonya
Copy link
Contributor

Thanks @DanielRuf for sharing and looping the WC issue back here. Appreciate it. And yes, you're right. There are ways to encapsulate specific external dependencies. After this problem, we are talking that step.

@Mic2005
Copy link

Mic2005 commented Aug 18, 2020

I want to thank WP-Rocket to sent also the "Important Information for WooCommerce Users" e-mail to all customers. Backup was done and just wanted to hit the upgrade option for wordpress Pfff ;-)
Recommendation? Just wait for next Woo upgrade/fix?

@Kipperlenny
Copy link

FTP upload and re-activate WP Rocket 3.6.4 worked :-)

@hellofromtonya
Copy link
Contributor

@PeterTemps That error is typically due to something with going wrong during the update process or missing or old composer files. I'd suggest using FTP/SSH to bring all of the Rocket 3.6.4 files over to your server. Check out the FTP section of this doc.

@hellofromtonya
Copy link
Contributor

Recommendation? Just wait for next Woo upgrade/fix?

@Mic2005 First of all, your welcome. What do we recommend? Update to WP Rocket 3.6.4 before updating WooCommerce.

@PeterTemps
Copy link

@PeterTemps That error is typically due to something with going wrong during the update process or missing or old composer files. I'd suggest using FTP/SSH to bring all of the Rocket 3.6.4 files over to your server. Check out the FTP section of this doc.

I'll try. Thanks!

@aniatanasova
Copy link

i had the same issue. i installed now the newest wp rocket, it did activated but the site is working 10 times slower than without it...any suggestions?

@101sam
Copy link

101sam commented Aug 18, 2020

We have a similar problem, but we are working with the NGINX server. What we saw that the new version remove all our settings (in WordPress), and we need to reconfigure all the parameters (we are still trying to figure out where, if its real problem or just configuration)

@hellofromtonya
Copy link
Contributor

@aniatanasova Hmm, I'm not sure why or what. But we'd like to dig into it further with you. Could you please open a Support ticket? We'll write you back to give you a safe way to share credentials with us.

@101sam
Copy link

101sam commented Aug 18, 2020

We have a similar problem, but we are working with the NGINX server. What we saw that the new version remove all our settings (in WordPress), and we need to reconfigure all the parameters (we are still trying to figure out where, if its real problem or just configuration)

After a few rounds, we found out that the only way to go back to the same speed is to set up the parameters manually and not import/export - why I'm not sure, but its work on two different sites using NGINX.

Thank you all for the quick fix

@hellofromtonya
Copy link
Contributor

hellofromtonya commented Aug 18, 2020

@101sam Hmm that's interesting. The update "shouldn't" have removed settings. However, you experienced something that did just that. Hmm, I'm not sure why. But I do want to know.

If you'd like, feel free to open a Support ticket. We can dig into with you.

@aniatanasova
Copy link

aniatanasova commented Aug 18, 2020

@aniatanasova Hmm, I'm not sure why or what. But we'd like to dig into it further with you. Could you please open a Support ticket? We'll write you back to give you a safe way to share credentials with us.

i did open a new issue and i also emailed at support.

@101sam
Copy link

101sam commented Aug 18, 2020

@101sam Hmm that's interesting. The update "shouldn't" have removed settings. However, you experienced something that did just that. Hmm, I'm not sure why. But I do want to know.

If you'd like, feel free to open a Support ticket. We can dig into with you.

It's happening on two different servers, so I'm sure we can replicate it. But I need time for the client to come down. The problem we had as soon as the crash happens, we couldn't return to WordPress. WP command line not works, we had to delete the wp-rocket folder. Maybe this was not the optimal way, but that's the only way we manage to recover the site from the crash. We didn't want to login to the MySQL as WooCommerce has a database update during the update. It was risky to play with the wp_options at that stage.

@sknight80
Copy link

@101sam what tool or tools did you use for speed measure?

@101sam
Copy link

101sam commented Aug 19, 2020

We notice the speed changes from monitor we have on the site using:

https://gtmetrix.com

We verify it with:

https://developers.google.com/speed/pagespeed/insights/

To debug and verify its coming from we-rocket
We add the following lines and use Query Monitor to verify its not other plugin or WooCommerce updates.

ini_set('display_errors','On');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', true);
define( 'WP_DEBUG_LOG', '/tmp/log/wp-errors.log' );
define( 'SCRIPT_DEBUG', true );

@hellofromtonya
Copy link
Contributor

@101sam Have you found it to be the settings in WP Rocket? Or something else?

@101sam
Copy link

101sam commented Aug 19, 2020

Can't tell, it looks like a combination of situations:
Trying to update WooCommerece + crash happens, and WooCommerece database update was on the way.

Or one of our crontab tried to kick in the middle of updates or while we upgrade.

Or it was Wordfence blocking changes of code.

@soon716
Copy link

soon716 commented Aug 21, 2020

you have to upgrade to 4.4.1, there is a fix for it : https://woocommerce.wordpress.com/2020/08/19/woocommerce-4-4-1-fix-release/
update with the latest version of WC and problem solved !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party compatibility Issues related to 3rd party compatibility like theme, plugin or hosting priority: 🔥critical The plugin or the website are unusable, it affects a significant number of customers
Projects
None yet
Development

Successfully merging a pull request may close this issue.