wp-cli / core-command

Downloads, installs, updates, and manages a WordPress installation.
MIT License
49 stars 50 forks source link

core install fails silently (error code 255) #123

Open simpixelated opened 5 years ago

simpixelated commented 5 years ago

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

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 --admin_email=test@example.com

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 --admin_email=test@example.com --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)
leonstafford commented 5 years ago

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

leonstafford commented 5 years ago

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

schlessera commented 5 years ago

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.