Same here. dontenv is not available for wp-cli, but on the regular webserver environment. I’m using the latest trellis version together with ansible 2.4.0.0. But dotenv is installed in vendor/vlucas/phpdotenv …
I’ve already tried switching wp-cli versions without any success.
Yup, good catch. I ran this in the vagrant box to fix it: rm -rf vendor/ sudo rm /usr/local/bin/composer wget https://github.com/composer/composer/releases/download/1.5.6/composer.phar chmod +x composer.phar sudo mv composer.phar /usr/local/bin/composer composer install
Composer 1.6.2 is out which fixes this bug. If you re-provision your server you should get the new version. If you made the edits originally listed below, remove them first.
Same here. I even deleted the whole server from virtual box and set composer_keep_updated: false composer_version: 1.5.6
in group_vars/all/main.yml but still I get the following error on vagrant up:
ASK [wordpress-install : Install Dependencies with Composer] ******************
System info:
Ansible 2.4.2.0; Vagrant 2.0.0; Darwin
Trellis at "Bump Ansible `version_tested_max` to 2.4.2.0"
---------------------------------------------------
Loading composer repositories with package information Installing
dependencies (including require-dev) from lock file Package operations: 6
installs, 0 updates, 0 removals - Installing johnpbloch/wordpress-core
(4.9.1): Failed to download johnpbloch/wordpress-core from dist: Could not
delete web/wp/wp-content/themes/twentyfifteen: Now trying to download from
source - Installing johnpbloch/wordpress-core (4.9.1): [RuntimeException]
Could not delete web/wp/wp-content/themes/twentyfifteen: install [--prefer-
source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-
installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest]
[-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-
authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--]
[<packages>]...
failed: [default] (item=ouun.io) => {"changed": false, "item": "ouun.io", "stdout": "Loading composer repositories with package information\nInstalling dependencies (including require-dev) from lock file\nPackage operations: 6 installs, 0 updates, 0 removals\n - Installing johnpbloch/wordpress-core (4.9.1): Failed to download johnpbloch/wordpress-core from dist: Could not delete web/wp/wp-content/themes/twentyfifteen: \n Now trying to download from source\n - Installing johnpbloch/wordpress-core (4.9.1): \n \n [RuntimeException] \n Could not delete web/wp/wp-content/themes/twentyfifteen: \n \n\ninstall [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...\n\n", "stdout_lines": ["Loading composer repositories with package information", "Installing dependencies (including require-dev) from lock file", "Package operations: 6 installs, 0 updates, 0 removals", " - Installing johnpbloch/wordpress-core (4.9.1): Failed to download johnpbloch/wordpress-core from dist: Could not delete web/wp/wp-content/themes/twentyfifteen: ", " Now trying to download from source", " - Installing johnpbloch/wordpress-core (4.9.1): ", " ", " [RuntimeException] ", " Could not delete web/wp/wp-content/themes/twentyfifteen: ", " ", "", "install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...", ""]}
Might there be any relation with the following in requirements.yml:
Not sure if this is related to this but I now receive the following error if I want to use WP-CLI directly in the terminal as well as connected via “vagrant ssh”:
PHP Fatal error: Uncaught Error: Class 'Dotenv\Dotenv' not found in /srv/www/xyz/current/config/application.php:17
Stack trace:
#0 phar:///usr/bin/wp/php/WP_CLI/Runner.php(1070) : eval()'d code(7): require_once()
#1 phar:///usr/bin/wp/php/WP_CLI/Runner.php(1070): eval()
#2 phar:///usr/bin/wp/php/WP_CLI/Runner.php(1032): WP_CLI\Runner->load_wordpress()
#3 phar:///usr/bin/wp/php/WP_CLI/Bootstrap/LaunchRunner.php(23): WP_CLI\Runner->start()
#4 phar:///usr/bin/wp/php/bootstrap.php(75): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
#5 phar:///usr/bin/wp/php/wp-cli.php(23): WP_CLI\bootstrap()
#6 phar:///usr/bin/wp/php/boot-phar.php(8): include('phar:///usr/bin...')
#7 /usr/bin/wp(4): include('phar:///usr/bin...')
#8 {main}
thrown in /srv/www/xyz/current/config/application.php on line 17
I already switched back to composer_keep_updated: true and run ANSIBLE_TAGS=composer vagrant provision. But with composer 1.5.6 and 1.6.2 I get the same result.
I’m able to provision the server locally and on a DO droplet but when I attempt a deploy, I get the error above.
Prior to attempting my first deploy, I first installed all my composer dependencies and was given an error when composer attempts to install: philippbaschke/acf-pro-installer
The error states that it requires phpdotenv 2.2 so I changed the version from 3.0.0 to 2.2 and ran composer update which then throws the error from above.
I reverted back to the default composer file supplied with Bedrock and I’m still getting the same error.