Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trellis setup doesn't work with WP 4.6 #639

Closed
4 of 5 tasks
runofthemill opened this issue Aug 19, 2016 · 11 comments
Closed
4 of 5 tasks

Trellis setup doesn't work with WP 4.6 #639

runofthemill opened this issue Aug 19, 2016 · 11 comments

Comments

@runofthemill
Copy link
Contributor

runofthemill commented Aug 19, 2016

Submit a feature request or bug report


What is the current behavior?

If you follow the exact docs from https://roots.io/trellis/docs/installing-trellis/, running vagrant up to set up local development fails with the following error:

TASK [wordpress-install : Install WP] ******************************************
System info:
  Ansible 2.0.2.0; Vagrant 1.8.5; Darwin
  Trellis 0.9.8: August 14th, 2016
---------------------------------------------------
PHP Fatal error:  Uncaught phpmailerException: Invalid address:
wordpress@${http_host} in /srv/www/trusa.org/current/web/wp/wp-includes
/class-phpmailer.php:946
Stack trace:
#0 /srv/www/trusa.org/current/web/wp/wp-includes/pluggable.php(352):
PHPMailer->setFrom('wordpress@${htt...', 'WordPress')
#1 /srv/www/trusa.org/current/web/wp/wp-admin/includes/upgrade.php(392):
wp_mail('jeremy.miller@t...', 'New WordPress S...', 'Your new WordPr...')
#2 /srv/www/trusa.org/current/web/wp/wp-admin/includes/upgrade.php(95):
wp_new_blog_notification('trusa.org', 'http://${HTTP_H...', 1, 'The password
yo...')
#3 phar:///usr/bin/wp/php/commands/core.php(763): wp_install('trusa.org',
'admin', 'jeremy.miller@t...', true, '', 'f478hai43...')
#4 phar:///usr/bin/wp/php/commands/core.php(573):
Core_Command->_install(Array)
#5 [internal function]: Core_Command->install(Array, Array)
#6 phar:///usr/bin/wp/php/WP_CLI/Dispatcher/CommandFactory.php(67):
call_user_func(Array, Array, Array)
#7 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_ in
/srv/www/trusa.org/current/web/wp/wp-includes/class-phpmailer.php on line 946
failed: [default] (item=trusa.org) => {"changed": true, "cmd": ["wp", "core", "install", "--allow-root", "--url=http://${HTTP_HOST}", "--title=trusa.org", "--admin_user=admin", "--admin_password=f478hai43", "[email protected]"], "delta": "0:00:00.926436", "end": "2016-08-19 00:46:52.904785", "failed": true, "item": "trusa.org", "rc": 255, "start": "2016-08-19 00:46:51.978349", "stderr": "PHP Fatal error:  Uncaught phpmailerException: Invalid address: wordpress@${http_host} in /srv/www/trusa.org/current/web/wp/wp-includes/class-phpmailer.php:946\nStack trace:\n#0 /srv/www/trusa.org/current/web/wp/wp-includes/pluggable.php(352): PHPMailer->setFrom('wordpress@${htt...', 'WordPress')\n#1 /srv/www/trusa.org/current/web/wp/wp-admin/includes/upgrade.php(392): wp_mail('jeremy.miller@t...', 'New WordPress S...', 'Your new WordPr...')\n#2 /srv/www/trusa.org/current/web/wp/wp-admin/includes/upgrade.php(95): wp_new_blog_notification('trusa.org', 'http://${HTTP_H...', 1, 'The password yo...')\n#3 phar:///usr/bin/wp/php/commands/core.php(763): wp_install('trusa.org', 'admin', 'jeremy.miller@t...', true, '', 'f478hai43...')\n#4 phar:///usr/bin/wp/php/commands/core.php(573): Core_Command->_install(Array)\n#5 [internal function]: Core_Command->install(Array, Array)\n#6 phar:///usr/bin/wp/php/WP_CLI/Dispatcher/CommandFactory.php(67): call_user_func(Array, Array, Array)\n#7 [internal function]: WP_CLI\\Dispatcher\\CommandFactory::WP_ in /srv/www/trusa.org/current/web/wp/wp-includes/class-phpmailer.php on line 946", "stdout": "", "stdout_lines": [], "warnings": []}

msg: One or more items failed

What is the expected or desired behavior?

vagrant up should complete with no errors


Bug report

Run through documentation steps; it works if you use a bedrock commit prior to 662e149

Please describe your local environment:

Ansible version: 2.0.2.0

OS: 10.11.6

Vagrant version: 1.8.5

Where did the bug happen? Development or remote servers?

Development

Please provide a repository or your wordpress_sites config (if possible):

N/A

Is there a related Discourse thread or were any utilized (please link them)?

Potentially related to #533

@creativematter
Copy link

creativematter commented Aug 19, 2016

I am also getting this error (it only shows up for websites that are running WP 4.6, earlier versions work as expected). Here is one of the error outputs:

PHP Fatal error: Uncaught Error: Call to undefined function apply_filters() in /srv/www/example.com/current/web/wp/wp-includes/load.php:317 Stack trace: #0 phar:///usr/bin/wp/php/utils-wp.php(22): wp_debug_mode() #1 phar:///usr/bin/wp/php/wp-settings-cli.php(59): WP_CLI\Utils\wp_debug_mode() #2 phar:///usr/bin/wp/php/WP_CLI/Runner.php(807): require('phar:///usr/bin...') #3 phar:///usr/bin/wp/php/WP_CLI/Runner.php(755): WP_CLI\Runner->load_wordpress() #4 phar:///usr/bin/wp/php/wp-cli.php(21): WP_CLI\Runner->start() #5 phar:///usr/bin/wp/php/boot-phar.php(5): include('phar:///usr/bin...') #6 /usr/bin/wp(4): include('phar:///usr/bin...') #7 {main} thrown in /srv/www/example.com/current/web/wp/wp-includes/load.php on line 317 failed: [default] (item=example.com) => {"changed": true, "cmd": ["wp", "core", "install", "--allow-root", "--url=http://${HTTP_HOST}", "--title=Website", "--admin_user=a", "--admin_password=b", "[email protected]"], "delta": "0:00:00.077265", "end": "2016-08-19 15:43:44.375947", "failed": true, "item": "example.com", "rc": 255, "start": "2016-08-19 15:43:44.298682", "stderr": "PHP Fatal error: Uncaught Error: Call to undefined function apply_filters() in /srv/www/example.com/current/web/wp/wp-includes/load.php:317\nStack trace:\n#0 phar:///usr/bin/wp/php/utils-wp.php(22): wp_debug_mode()\n#1 phar:///usr/bin/wp/php/wp-settings-cli.php(59): WP_CLI\\Utils\\wp_debug_mode()\n#2 phar:///usr/bin/wp/php/WP_CLI/Runner.php(807): require('phar:///usr/bin...')\n#3 phar:///usr/bin/wp/php/WP_CLI/Runner.php(755): WP_CLI\\Runner->load_wordpress()\n#4 phar:///usr/bin/wp/php/wp-cli.php(21): WP_CLI\\Runner->start()\n#5 phar:///usr/bin/wp/php/boot-phar.php(5): include('phar:///usr/bin...')\n#6 /usr/bin/wp(4): include('phar:///usr/bin...')\n#7 {main}\n thrown in /srv/www/example.com/current/web/wp/wp-includes/load.php on line 317", "stdout": "", "stdout_lines": [], "warnings": []}

@arashohadi
Copy link

@kikandrew Updating WP_CLI on the server to the latest version fixed that error for me.

@creativematter
Copy link

@arashohadi Ahh thanks! I had checked my wp-cli version on the host, but not the virtual machine. Updating it on the virtual machine fixed it for me.

@peebeebee
Copy link

peebeebee commented Aug 24, 2016

While this fixes @kikandrew 's issue, it does not resolve @runofthemill 's

EDIT:
.env did not have its http_host and wp_home variables filled in. It's still the placeholders.
I see that in Bedrock modes have been changed from 755 to 644. Maybe it has to do with this?

@OezlemYi
Copy link

OezlemYi commented Aug 26, 2016

Still getting this error. Here is the error output:

`TASK [wordpress-install : Install WP] ******************************************
System info:
  Ansible 2.1.1.0; Vagrant 1.8.5; Darwin
  Trellis at "Fix #639 - WP 4.6 compatibility: update WP-CLI to 0.24.1"
---------------------------------------------------
PHP Fatal error:  Uncaught phpmailerException: Invalid address:
wordpress@${http_host} in /srv/www/hangout.com/current/web/wp/wp-includes
/class-phpmailer.php:946
Stack trace:
#0 /srv/www/hangout.com/current/web/wp/wp-includes/pluggable.php(352):
PHPMailer->setFrom('wordpress@${htt...', 'WordPress')
#1 /srv/www/hangout.com/current/web/wp/wp-admin/includes/upgrade.php(392):
wp_mail('[email protected]...', 'New WordPress S...', 'Your new WordPr...')
#2 /srv/www/hangout.com/current/web/wp/wp-admin/includes/upgrade.php(95):
wp_new_blog_notification('hangout.com', 'http://${HTTP_H...', 1, 'The
password yo...')
#3 phar:///usr/bin/wp/php/commands/core.php(763): wp_install('hangout.com',
'admin', '[email protected]...', true, '', 'admin')
#4 phar:///usr/bin/wp/php/commands/core.php(573):
Core_Command->_install(Array)
#5 [internal function]: Core_Command->install(Array, Array)
#6 phar:///usr/bin/wp/php/WP_CLI/Dispatcher/CommandFactory.php(67):
call_user_func(Array, Array, Array)
#7 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_C in
/srv/www/hangout.com/current/web/wp/wp-includes/class-phpmailer.php on line
946
failed: [default] (item=hangout.com) => {"changed": true, "cmd": ["wp", "core", "install", "--allow-root", "--url=http://${HTTP_HOST}", "--title=hangout.com", "--admin_user=admin", "--admin_password=admin", "[email protected]"], "delta": "0:00:01.380342", "end": "2016-08-26 11:46:27.534314", "failed": true, "item": "hangout.com", "rc": 255, "start": "2016-08-26 11:46:26.153972", "stderr": "PHP Fatal error:  Uncaught phpmailerException: Invalid address: wordpress@${http_host} in /srv/www/hangout.com/current/web/wp/wp-includes/class-phpmailer.php:946\nStack trace:\n#0 /srv/www/hangout.com/current/web/wp/wp-includes/pluggable.php(352): PHPMailer->setFrom('wordpress@${htt...', 'WordPress')\n#1 /srv/www/hangout.com/current/web/wp/wp-admin/includes/upgrade.php(392): wp_mail('[email protected]...', 'New WordPress S...', 'Your new WordPr...')\n#2 /srv/www/hangout.com/current/web/wp/wp-admin/includes/upgrade.php(95): wp_new_blog_notification('hangout.com', 'http://${HTTP_H...', 1, 'The password yo...')\n#3 phar:///usr/bin/wp/php/commands/core.php(763): wp_install('hangout.com', 'admin', '[email protected]...', true, '', 'admin')\n#4 phar:///usr/bin/wp/php/commands/core.php(573): Core_Command->_install(Array)\n#5 [internal function]: Core_Command->install(Array, Array)\n#6 phar:///usr/bin/wp/php/WP_CLI/Dispatcher/CommandFactory.php(67): call_user_func(Array, Array, Array)\n#7 [internal function]: WP_CLI\\Dispatcher\\CommandFactory::WP_C in /srv/www/hangout.com/current/web/wp/wp-includes/class-phpmailer.php on line 946", "stdout": "", "stdout_lines": [], "warnings": []}

NO MORE HOSTS LEFT *************************************************************

RUNNING HANDLER [common : restart memcached] ***********************************
changed: [default]

RUNNING HANDLER [common : reload php-fpm] **************************************
changed: [default]

RUNNING HANDLER [common : reload nginx] ****************************************
changed: [default]

RUNNING HANDLER [common : perform nginx reload] ********************************
changed: [default]

RUNNING HANDLER [fail2ban : restart fail2ban] **********************************
changed: [default]

RUNNING HANDLER [ferm : restart ferm] ******************************************
skipping: [default]

RUNNING HANDLER [ntp : restart ntp] ********************************************
changed: [default]

RUNNING HANDLER [sshd : restart ssh] *******************************************
changed: [default]
    to retry, use: --limit @/Users/Madlax/Websites/hangout/trellis/dev.retry

PLAY RECAP *********************************************************************
default                    : ok=102  changed=80   unreachable=0    failed=1   

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
`

WP-CLI, Vagrant and Ansible are up to date:

Madlax@Madlax-MacBook-Pro ~> vagrant version
Installed Version: 1.8.5
Latest Version: 1.8.5

You're running an up-to-date version of Vagrant!
Madlax@Madlax-MacBook-Pro ~> wp cli version
WP-CLI 0.24.1
Madlax@Madlax-MacBook-Pro ~> ansible --version
ansible 2.1.1.0
  config file = /Users/Madlax/Websites/hangout/trellis/ansible.cfg
  configured module search path = Default w/o overrides 

@ababra
Copy link

ababra commented Aug 27, 2016

Solved this by downgrading my Ansible version from 2.1.1.0 to 2.0.2.0. On Mac:

sudo -H pip uninstall ansible
sudo pip install ansible==2.0.2.0

Vagrant: 1.8.5
WP-CLI (inside of VM): 0.24.1

@OezlemYi
Copy link

Downgraded my Ansible to 2.0.2.0. Still getting this error.

`TASK [wordpress-install : Install WP] ******************************************
System info:
  Ansible 2.0.2.0; Vagrant 1.8.5; Darwin
  Trellis at "Fix #639 - WP 4.6 compatibility: update WP-CLI to 0.24.1"
---------------------------------------------------
PHP Fatal error:  Uncaught phpmailerException: Invalid address:
wordpress@${http_host} in /srv/www/hangout.com/current/web/wp/wp-includes
/class-phpmailer.php:946
Stack trace:
#0 /srv/www/hangout.com/current/web/wp/wp-includes/pluggable.php(352):
PHPMailer->setFrom('wordpress@${htt...', 'WordPress')
#1 /srv/www/hangout.com/current/web/wp/wp-admin/includes/upgrade.php(392):
wp_mail('[email protected]...', 'New WordPress S...', 'Your new WordPr...')
#2 /srv/www/hangout.com/current/web/wp/wp-admin/includes/upgrade.php(95):
wp_new_blog_notification('hangout.com', 'http://${HTTP_H...', 1, 'The
password yo...')
#3 phar:///usr/bin/wp/php/commands/core.php(763): wp_install('hangout.com',
'admin', '[email protected]...', true, '', 'admin')
#4 phar:///usr/bin/wp/php/commands/core.php(573):
Core_Command->_install(Array)
#5 [internal function]: Core_Command->install(Array, Array)
#6 phar:///usr/bin/wp/php/WP_CLI/Dispatcher/CommandFactory.php(67):
call_user_func(Array, Array, Array)
#7 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_C in
/srv/www/hangout.com/current/web/wp/wp-includes/class-phpmailer.php on line
946
failed: [default] (item=hangout.com) => {"changed": true, "cmd": ["wp", "core", "install", "--allow-root", "--url=http://${HTTP_HOST}", "--title=hangout.com", "--admin_user=admin", "--admin_password=admin", "[email protected]"], "delta": "0:00:01.333393", "end": "2016-08-29 08:27:58.312015", "failed": true, "item": "hangout.com", "rc": 255, "start": "2016-08-29 08:27:56.978622", "stderr": "PHP Fatal error:  Uncaught phpmailerException: Invalid address: wordpress@${http_host} in /srv/www/hangout.com/current/web/wp/wp-includes/class-phpmailer.php:946\nStack trace:\n#0 /srv/www/hangout.com/current/web/wp/wp-includes/pluggable.php(352): PHPMailer->setFrom('wordpress@${htt...', 'WordPress')\n#1 /srv/www/hangout.com/current/web/wp/wp-admin/includes/upgrade.php(392): wp_mail('[email protected]...', 'New WordPress S...', 'Your new WordPr...')\n#2 /srv/www/hangout.com/current/web/wp/wp-admin/includes/upgrade.php(95): wp_new_blog_notification('hangout.com', 'http://${HTTP_H...', 1, 'The password yo...')\n#3 phar:///usr/bin/wp/php/commands/core.php(763): wp_install('hangout.com', 'admin', '[email protected]...', true, '', 'admin')\n#4 phar:///usr/bin/wp/php/commands/core.php(573): Core_Command->_install(Array)\n#5 [internal function]: Core_Command->install(Array, Array)\n#6 phar:///usr/bin/wp/php/WP_CLI/Dispatcher/CommandFactory.php(67): call_user_func(Array, Array, Array)\n#7 [internal function]: WP_CLI\\Dispatcher\\CommandFactory::WP_C in /srv/www/hangout.com/current/web/wp/wp-includes/class-phpmailer.php on line 946", "stdout": "", "stdout_lines": [], "warnings": []}

NO MORE HOSTS LEFT *************************************************************

RUNNING HANDLER [common : restart memcached] ***********************************
changed: [default]

RUNNING HANDLER [common : reload php-fpm] **************************************
changed: [default]

RUNNING HANDLER [common : reload nginx] ****************************************
included: /Users/Madlax/Websites/hangout/trellis/roles/common/tasks/reload_nginx.yml for default

RUNNING HANDLER [common : command] *********************************************
changed: [default]

RUNNING HANDLER [common : service] *********************************************
changed: [default]

RUNNING HANDLER [fail2ban : restart fail2ban] **********************************
changed: [default]

RUNNING HANDLER [ferm : restart ferm] ******************************************
skipping: [default]

RUNNING HANDLER [ntp : restart ntp] ********************************************
changed: [default]

RUNNING HANDLER [sshd : restart ssh] *******************************************
changed: [default]
    to retry, use: --limit @/Users/Madlax/Websites/hangout/trellis/dev.retry

PLAY RECAP *********************************************************************
default                    : ok=108  changed=80   unreachable=0    failed=1   

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
`

@solace
Copy link

solace commented Aug 30, 2016

For reference, I had this issue, updated WP-CLI on the VM. Fixed it.
Added another site, and the issue cropped up again. Downgraded Ansible. Fixed it.

So, can't tell if the fixes are fixes, or red herrings.

OSX
Vagrant: 1.8.5
WP-CLI (vm): 0.24.0
Ansible: 2.0.2.0 (previously 2.1.1.0)

@wassim
Copy link

wassim commented Aug 30, 2016

@swalkinshaw Could you reopen this please? I'm having the exact same issue so it seems that your commit hadn't fix anything.

@intelligence
Copy link

Changing wordpress version to 4.5 in composer.json before running vagrant up does the trick.

@swalkinshaw
Copy link
Member

See #645 for the real problem. Anything related to this issue will happen over there.

@roots roots locked and limited conversation to collaborators Aug 31, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants