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

1 Answer
1

You 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.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *