When I run most wp-cli commands I get silent failure. If I echo the return code, I can see that it is 255.
Some background. Our team is working on a plugin. Previous version of plugin works fine with wp-cli. If I update the plugin ($ wp plugin update our-plugin) the plugin updates, and the site seems to work fine, BUT, any further commands with wp-cli fail with return code 255.
I am talking about simple commands like ($ wp plugin list) or ($ wp plugin status) The 255 error codes even extend to theme subcommands as well.
The question is: How do I debug this? Is there a way to get more details failure information from wp-cli?
Thanks, John Schank
When I run most wp-cli commands I get silent failure. If I echo the return code, I can see that it is 255.
Some background. Our team is working on a plugin. Previous version of plugin works fine with wp-cli. If I update the plugin ($ wp plugin update our-plugin) the plugin updates, and the site seems to work fine, BUT, any further commands with wp-cli fail with return code 255.
I am talking about simple commands like ($ wp plugin list) or ($ wp plugin status) The 255 error codes even extend to theme subcommands as well.
The question is: How do I debug this? Is there a way to get more details failure information from wp-cli?
Thanks, John Schank
Share Improve this question asked Jun 11, 2015 at 20:17 John SchankJohn Schank 411 silver badge2 bronze badges 3- 1 This might be worth reporting as possible issue to wp-cli issue tracker on github. – Rarst Commented Jun 11, 2015 at 20:24
- @Rarst: yeah, I agree. I just wanted to do some due diligence and make sure we aren't doing something to cause this. – John Schank Commented Jun 11, 2015 at 21:03
- Well, you very well might, but it doesn't sound like anything I ever heard so the more specific wp-cli expertise is probably in order. :) – Rarst Commented Jun 12, 2015 at 8:07
1 Answer
Reset to default 2You could at least try to run wp COMMAND --debug
to see what this will give you.
I once got this after I manually copied a preprocessed wp-config.php
in place to be used inside a Docker container. Suddenly all commands stopped working, silently. The container returned me a 255
. With --debug
I could identify at which point exactly the commands stopped working and identified that it must have been the wp-config.php
.
In the end I fixed it by generating the config with wp config create
and suddenly WP-CLI started working again. Would be interesting to know if your error disappears as soon as you remove your wp-config.php
. WP-CLI then should tell you that there's no config existent and might suggest using wp config create
to create one.