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

Updating plugin via WP-CLI yields ZenCache Pro errors #563

Closed
MarioKnight opened this issue Sep 8, 2015 · 8 comments
Closed

Updating plugin via WP-CLI yields ZenCache Pro errors #563

MarioKnight opened this issue Sep 8, 2015 · 8 comments
Assignees
Labels
Milestone

Comments

@MarioKnight
Copy link

@MarioKnight MarioKnight commented Sep 8, 2015

While I know that ZenCache (Pro) has yet to support WP-CLI directly, an issue has come up that I believe started after updating sites to the latest ZenCache Pro version. When I run plugin updates, sites with ZenCache Pro activated output the following errors:

Fatal error: Uncaught exception 'Exception' with message 'Invalid argument; host token empty!' in /home/xxxx/public_html/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php:264
Stack trace:
#0 [internal function]: WebSharks\ZenCache\Pro\AbsBaseAp->WebSharks\ZenCache\Pro\{closure}('/^.+/i')
#1 /home/xxxx/public_html/wp-content/plugins/zencache-pro/src/includes/classes/AbsBaseAp.php(55): call_user_func_array(Object(Closure), Array)
#2 /home/xxxx/public_html/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php(54): WebSharks\ZenCache\Pro\AbsBaseAp->__call('deleteFilesFrom...', Array)
#3 /home/xxxx/public_html/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php(54): WebSharks\ZenCache\Pro\Plugin->deleteFilesFromHostCacheDir('/^.+/i')
#4 [internal function]: WebSharks\ZenCache\Pro\AbsBaseAp->WebSharks\ZenCache\Pro\{closure}('/^.+/i')
#5 /home/xxxx/public_html/wp-content/plugins/zencache-pro/src/includes/classes/AbsBaseAp.php(55) in /home/xxxx/public_html/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php on line 264

The plugins still update and the cache still appears to clear and work normally afterward, so thankfully this is currently just an inconvenience. I just wanted to let you know in case something can be done, and in hopes that this could potentially help with #464 . Please let me know if you need anything else on my end. Thank you!

@raamdev
Copy link
Contributor

@raamdev raamdev commented Sep 8, 2015

@MarioKnight Thanks so much for the additional information!

@jaswsinc I noticed 'Invalid argument; host token empty!' is the same error reported in #560; it sounds like these could be related.

@jaswrks
Copy link

@jaswrks jaswrks commented Sep 9, 2015

I noticed 'Invalid argument; host token empty!' is the same error reported in #560; it sounds like these could be related.

Yeah. I suspect this is a bug. ZenCache needs to consider that it might run as part of a CLI process where $_SERVER['HTTP_HOST'] is empty. We had this consideration covered in a previous release, but it looks like something is slipping through in the latest copy.

@jaswrks
Copy link

@jaswrks jaswrks commented Oct 7, 2015

Next Actions

  • New feature branch: feature/563 in the websharks/zencache-pro repo.

  • Replace this line with the following:

    if (!$this->enable_hooks || strcasecmp(PHP_SAPI, 'cli') === 0) {
  • Submit PR.

@jaswrks
Copy link

@jaswrks jaswrks commented Oct 7, 2015

Should also resolve: #560

@MarioKnight
Copy link
Author

@MarioKnight MarioKnight commented Oct 9, 2015

I tested this on a site, and the behavior is back to normal. I'm looking forward to seeing this in the next release, though since it's just a one line change, I will likely roll out that change to all our client sites in the meantime. Thank you!

@raamdev
Copy link
Contributor

@raamdev raamdev commented Oct 9, 2015

@MarioKnight Thanks so much for the confirmation that @jaswsinc's fix works. :-) I'll make sure this fix makes it into the next Pro release.

@raamdev raamdev removed the needs testing label Oct 9, 2015
@raamdev
Copy link
Contributor

@raamdev raamdev commented Oct 9, 2015

Next Pro Release Changelog:

  • Bug Fix: Fixed a bug related to updating plugins with WP-CLI on a site that was running ZenCache Pro. While ZenCache Pro updates must still be done through the ZenCache Pro Updater inside the Dashboard, updating other plugins via WP-CLI was generating a harmless ZenCache exception: "Invalid argument; host token empty!". With this fix, ZenCache will properly detect when WP-CLI is running to avoid these errors. Props @MarioKnight @renzms. See Issue #563.
@raamdev raamdev closed this Oct 9, 2015
@raamdev
Copy link
Contributor

@raamdev raamdev commented Nov 14, 2015

ZenCache v151114 has been released and includes changes from this GitHub Issue. See the v151114 announcement for further details.


This issue will now be locked to further updates. If you have something to add related to this GitHub Issue, please open a new GitHub Issue and reference this one (#563).

@wpsharks wpsharks locked and limited conversation to collaborators Nov 14, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants