$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>plugins - wp-cli silently fails with error code 255|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

plugins - wp-cli silently fails with error code 255

matteradmin7PV0评论

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
Add a comment  | 

1 Answer 1

Reset to default 2

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.

Post a comment

comment list (0)

  1. No comments so far