core-command icon indicating copy to clipboard operation
core-command copied to clipboard

core install fails silently (error code 255)

Open simpixelated opened this issue 5 years ago • 3 comments

Bug Report

Describe the current, buggy behavior

wp core install fails silently; echo $? shows error code 255

Describe how other contributors can replicate this bug

  • clone my repo and run it on CircleCI: https://github.com/simpixelated/wordpress-ci
  • view my current failing build: https://circleci.com/gh/simpixelated/wordpress-ci/13#tests/containers/0

Here are the commands I'm running after installing wp-cli:

wp core download
wp config create --dbhost=127.0.0.1 --dbname=$WORDPRESS_DB_NAME --dbuser=$WORDPRESS_DB_USER --dbpass=$WORDPRESS_DB_PASSWORD
wp core install --url=localhost --title=test --admin_user=test --admin_password=test [email protected]

Describe what you would expect as the correct outcome

install succeeds or at least provides more debug info about why it fails

Let us know what environment you are running this on

CircleCI using their PHP and MySQL docker images

Here is the output from running core install again on the CircleCI box directly (via ssh) with all --skip options and --debug added. I tried specifying a path for download, config, and install, but it still fails at the same spot. I can see that the wp-config.php file exists at that path and it looks correct.

Debug (bootstrap): argv: /usr/local/bin/wp core install --url=localhost --title=test --admin_user=test --admin_password=test [email protected] --path=wordpress --debug --skip-themes --skip-plugins --allow-root --skip-email --skip-packages (0.079s)
Debug (bootstrap): ABSPATH defined: /home/circleci/project/wordpress/ (0.079s)
Debug (bootstrap): Set URL: localhost (0.079s)
Debug (bootstrap): Begin WordPress load (0.08s)
Debug (bootstrap): wp-config.php path: /home/circleci/project/wordpress/wp-config.php (0.08s)

simpixelated avatar May 03 '19 17:05 simpixelated

@simpixelated - I had the same issue. Steps to debug/resolve in my case:

  • ssh in to circleci at failure point
  • curl the WP URL
  • had apache config issues, fixed
  • curl the WP URL
  • PHP error showing missing PHP extension (mysqli), installed
  • re-run wp core install. Success.

leonstafford avatar Jul 14 '19 08:07 leonstafford

This is a WIP, but a green build for reference: https://circleci.com/gh/WP2Static/wp2static/755

leonstafford avatar Jul 14 '19 09:07 leonstafford

I assume in the reporter's case, the issue is something similar to an extension missing. I agree that WP-CLI should do a better job here of letting the user know what is happening. Silently failing is never a good option.

schlessera avatar Jul 16 '19 16:07 schlessera