• Resolved Mark Barnes

    (@mark8barnes)


    The new v7 release has broken the wp sg purge command. This now always returns the error Unable to Purge File Cache.

    The issue appears to be that WP_CLI->file_cacher->purge_everything() does not return anything, whereas line 54 of Cli_Purge.php excepts it to return a true/false.

    • This topic was modified 2 years, 5 months ago by Mark Barnes.
    • This topic was modified 2 years, 5 months ago by Mark Barnes.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Mark Barnes

    (@mark8barnes)

    Even when I hack around the above problem, there’s a second issue, this time with Cli_Purge->supercacher->purge_everything(). On my local test environment, that attempts to run the site-tools-client domain-all update id=%s flush_cache=1 path='%s' command, which of course fails. This should presumably be skipped when away from SiteGround servers.

    • This reply was modified 2 years, 5 months ago by Mark Barnes.
    Plugin Support Vladimir Trandev

    (@vtrandev)

    Hello @mark8barnes,

    Thank you for your report!

    We are aware of the issue and our developers are working on a fix.

    Regards,
    Vladimir

    Thread Starter Mark Barnes

    (@mark8barnes)

    Thank you for the quick release of 7.0.2. This release partly fixes the issue. The purge command does now work, but with an important caveat. It exits with an exit code of ‘200’. I presume this is supposed to be equivalent to an HTTP status code of 200 OK, but anything other than an exit code of 0 is usually interpreted by bash scripts as an error. The plugin should exit with a code of 0 if the cache was successfully purged.

    (In our case, we’re using BitBucket Pipelines, which assumes a build has failed if there isn’t an exit code of 0. I’ve had to write a bash script to check for an error code of 200 and convert it to 0!)

    Plugin Support Gergana Petrova

    (@gpetrova)

    Hello @mark8barnes,

    Could you please elaborate a bit more on how are you checking the exit code on your end to get the 200 response? In our tests the exit code when the cache is purged via cli is 0, as expected.

    Could you please also specify your domain name and if your site is with SiteGround?

    Best Regards,
    Gergana Petrova

    Thread Starter Mark Barnes

    (@mark8barnes)

    baseos | <redacted>@<redacted>.sgvps.net:~/www/samaritans-purse.org.uk/html$ wp sg purge
    Success: SiteGround Optimizer assets folder purged successfully.
    Success: File Cache Succesfully Purged.
    Success: Dynamic Cache Successfully Purged.
    baseos | <redacted>@<redacted>.sgvps.net:~/www/samaritans-purse.org.uk/html$ echo $?
    200
    

    Thanks for the response. My site is with SiteGround. You can see the domain name above. There’s a typo in the File Cache “Succesfully” message, by the way.

    You’ve got halt(200) commands all over purge_everything() and purge_url().

    Plugin Support Vladimir Trandev

    (@vtrandev)

    Hello again,

    We have already implemented a fix, so please update the plugin to the latest version -> 7.0.3.

    Regards,
    Vladimir

    Thread Starter Mark Barnes

    (@mark8barnes)

    7.0.3 does seem to have fixed the issues. Thanks for the quick response. (And it’s worthwhile, because the file-based cache is much faster than v6.)

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Bug: CLI cache busting broken with v7’ is closed to new replies.