Title: wp cli command returns timeout
Last modified: April 8, 2020

---

# wp cli command returns timeout

 *  Resolved [phloo](https://wordpress.org/support/users/phloo/)
 * (@phloo)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-command-returns-timeout/)
 * Sending following command via ssh we get an error
    “wp fvm purge”
 * Returns:
    “http_request_async curl error: Connection timed out after 1000 milliseconds
   Success: FVM and other caches were purged.”
 * We contacted the host (WPE) but couldn’t find a reason for the timeout yet.
    
   Any idea why it happens?

Viewing 15 replies - 1 through 15 (of 20 total)

1 [2](https://wordpress.org/support/topic/wp-cli-command-returns-timeout/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/wp-cli-command-returns-timeout/page/2/?output_format=md)

 *  Thread Starter [phloo](https://wordpress.org/support/users/phloo/)
 * (@phloo)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-command-returns-timeout/#post-12645381)
 * The WPE support says it can be related to flush the CDN cache. Because our site
   doesnt use a CDN.
 * But I am not sure. Maybe the timeout for the curl is too small? 1s
 *  Plugin Author [Raul P.](https://wordpress.org/support/users/alignak/)
 * (@alignak)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-command-returns-timeout/#post-12646276)
 * That message comes from somewhere else, another plugin or your theme, most likely.
   
   After that, you can see: Success: FVM and other caches were purged.
 * That means the command is running, but before that, there is some other code 
   somewhere else, trying to make an external request, that is most likely blocked,
   either by your host or the api.
 * It could be a plugin that you lack license for and it’s blocking your server,
   or it could be a blacklisted domain by your host, or some developer added something
   to your site to prevent it from connecting to some url (check license for example).
 * There is also a possibility of being malware, but if the timeout is 1 second,
   then something is blocking it.
 * I would suggest, asking your hosting to do a grep on your php files (active theme
   and plugins only) for any curl function with a 1 second timeout, and then inspect
   carefully what and why it’s fetching something with a 1 second timeout.
 * If it’s an async request, a beacon or something like that, just to monitor something,
   that would make sense to be 1 second.
 * We don’t use curl on our plugin.
    The wp fvm purge command, only runs the 2 default
   cache purge functions, which doesn’t require an http request.
 *  Thread Starter [phloo](https://wordpress.org/support/users/phloo/)
 * (@phloo)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-command-returns-timeout/#post-12646438)
 * Thanks Raul, I forwarded this to WPE and hope they can find what you suggest 
   to search for. It’s really weird, since we only use this cli command via shell.
 * So nothing else should run during the cache purging, right?
 *  Plugin Author [Raul P.](https://wordpress.org/support/users/alignak/)
 * (@alignak)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-command-returns-timeout/#post-12646452)
 * It doesn’t matter what other commands you run, that curl message will likely 
   show up with any command you input via wp-cli and it’s unrelated to my plugin.
 * Try to run the cronjobs for example:
    `wp cron event run --due-now`
 *  Thread Starter [phloo](https://wordpress.org/support/users/phloo/)
 * (@phloo)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-command-returns-timeout/#post-12646473)
 * Nope, this is the only output
 *     ```
       XXXX.ssh.wpengine.net:~$ wp cron event run --due-now
       Success: Executed a total of 0 cron events.
       ```
   
 *  Plugin Author [Raul P.](https://wordpress.org/support/users/alignak/)
 * (@alignak)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-command-returns-timeout/#post-12646496)
 * What does `wp cache flush` return?
 * Also by WPE, you mean wpengine.com ?
 * Our cache purge also purges wpengine, so their plugin could be causing it.
    This
   is our code:
 *     ```
       # Purge WP Engine
       if (class_exists("WpeCommon")) {
       	if (method_exists('WpeCommon', 'purge_memcached')) { WpeCommon::purge_memcached(); }
       	if (method_exists('WpeCommon', 'clear_maxcdn_cache')) { WpeCommon::clear_maxcdn_cache(); }
       	if (method_exists('WpeCommon', 'purge_varnish_cache')) { WpeCommon::purge_varnish_cache(); }
       }
       ```
   
 * It checks if their plugin is installed and if it is, it asks their plugin to 
   purge all caches (only if it’s installed).
 * In that case, it would make sense if they say it’s related to the cdn, as the
   function tries to purge all caches available.
 * I haven’t checked if they have a method to verify if the cdn is enabled or not,
   but if they do, I’ll add it to my plugin.
 * In that case, while the curl message doesn’t come directly from FVM, it may be
   related, simply because it runs the cache purge on wpengine plugin, and that 
   plugin returns the error timeout.
 * I assume, wpengine plugin still makes a curl request to the cdn and that’s why
   it fails.
 * I’ll look into it sometime later again.
 *  Thread Starter [phloo](https://wordpress.org/support/users/phloo/)
 * (@phloo)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-command-returns-timeout/#post-12646543)
 * Returns “Success: The cache was flushed.”
 * Yes, it means WPengine. I saw the function FVM uses to flush their caches.
    I
   will check if the plugin has some curl calls but still weird that it sends a 
   message back to the cli command. And it hasn’t three weeks ago.
 * Thanks for investigate this “issue”.
 *  Plugin Author [Raul P.](https://wordpress.org/support/users/alignak/)
 * (@alignak)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-command-returns-timeout/#post-12646558)
 * If you are comfortable with editing the code, you can comment out the `if (method_exists('
   WpeCommon', 'clear_maxcdn_cache')) { WpeCommon::clear_maxcdn_cache(); }` line
   on my plugin, `functions-cache.php` file.
 * If running wp-cli again doesn’t return that curl message, then it’s confirmed.
 *  Thread Starter [phloo](https://wordpress.org/support/users/phloo/)
 * (@phloo)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-command-returns-timeout/#post-12646592)
 * Tried, unfortunately no change to the response.
 *  Plugin Author [Raul P.](https://wordpress.org/support/users/alignak/)
 * (@alignak)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-command-returns-timeout/#post-12646596)
 * Then, sorry, but can you try to comment out the other 2 lines?
    One of those 
   must be causing it.
 *  Thread Starter [phloo](https://wordpress.org/support/users/phloo/)
 * (@phloo)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-command-returns-timeout/#post-12646629)
 * Boom, I removed the functions call and yes, no error message.
 *  Plugin Author [Raul P.](https://wordpress.org/support/users/alignak/)
 * (@alignak)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-command-returns-timeout/#post-12646638)
 * Which one specifically, do you know?
    I’m guessing it’s the varnish related one
   then. Either way, I will try to look into it later with more time.
 *  Thread Starter [phloo](https://wordpress.org/support/users/phloo/)
 * (@phloo)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-command-returns-timeout/#post-12646656)
 * Remove the complete call, didn’t test one by one. Sorry
 *  Plugin Author [Raul P.](https://wordpress.org/support/users/alignak/)
 * (@alignak)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-command-returns-timeout/#post-12646668)
 * You can ignore the error for now, it doesn’t do anything other than to try to
   purge the cache.
    I’ll investigate if wpengine changed something on their plugin
   soon and push an update.
 * Thanks for reporting.
 *  Thread Starter [phloo](https://wordpress.org/support/users/phloo/)
 * (@phloo)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-command-returns-timeout/#post-12646675)
 * Thanks for the help, really appreciated!

Viewing 15 replies - 1 through 15 (of 20 total)

1 [2](https://wordpress.org/support/topic/wp-cli-command-returns-timeout/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/wp-cli-command-returns-timeout/page/2/?output_format=md)

The topic ‘wp cli command returns timeout’ is closed to new replies.

 * ![](https://ps.w.org/fast-velocity-minify/assets/icon-128x128.jpg?rev=1440946)
 * [Fast Velocity Minify](https://wordpress.org/plugins/fast-velocity-minify/)
 * [Support Threads](https://wordpress.org/support/plugin/fast-velocity-minify/)
 * [Active Topics](https://wordpress.org/support/plugin/fast-velocity-minify/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/fast-velocity-minify/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/fast-velocity-minify/reviews/)

 * 20 replies
 * 2 participants
 * Last reply from: [phloo](https://wordpress.org/support/users/phloo/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/wp-cli-command-returns-timeout/page/2/#post-12689098)
 * Status: resolved