roots / trellis

WordPress LEMP stack with PHP 8.2, Composer, WP-CLI and more
https://roots.io/trellis/
MIT License
2.5k stars 608 forks source link

Solved!!!: Could not get ‘template_root’ option. Does it exist? #954

Closed uhlhosting closed 6 years ago

uhlhosting commented 6 years ago

Submit a feature request or bug report

Replace any X with your information.


What is the current behavior?

TASK [deploy : Get WP theme template and stylesheet roots] *********************************************************************************************************************************************************************************************************************
System info:
  Ansible 2.4.3.0; Darwin
  Trellis at "Update `vagrant_box_version` to `>= 201801.02.0`"
---------------------------------------------------
non-zero return code
Error: Could not get 'template_root' option. Does it exist?
failed: [137.74.247.205] (item=template_root) => {"changed": false, "cmd": " wp option get template_root --skip-plugins --skip-themes\n ", "delta": "0:00:00.212474", "end": "2018-03-02 04:52:16.992247", "failed_when_result": true, "item": "template_root", "rc": 1, "start": "2018-03-02 04:52:16.779773", "stderr_lines": ["Error: Could not get 'template_root' option. Does it exist?"], "stdout": "", "stdout_lines": []}
---------------------------------------------------
non-zero return code
Error: Could not get 'stylesheet_root' option. Does it exist?
failed: [137.74.247.205] (item=stylesheet_root) => {"changed": false, "cmd": " wp option get stylesheet_root --skip-plugins --skip-themes\n ", "delta": "0:00:00.210323", "end": "2018-03-02 04:52:17.467505", "failed_when_result": true, "item": "stylesheet_root", "rc": 1, "start": "2018-03-02 04:52:17.257182", "stderr_lines": ["Error: Could not get 'stylesheet_root' option. Does it exist?"], "stdout": "", "stdout_lines": []}
    to retry, use: --limit @/Users/cosmicsound/dev/uhlhosting.ch/projects/learn-trellis/trellis/deploy.retry

PLAY RECAP *********************************************************************************************************************************************************************************************************************************************************************
137.74.247.205             : ok=24   changed=8    unreachable=0    failed=1   
localhost                  : ok=0    changed=0    unreachable=0    failed=0   

**What is the expected or desired behavior?**

successful deployment

---

## Bug report

TASK [deploy : Get WP theme template and stylesheet roots] *********************************************************************************************************************************************************************************************************************
System info:
  Ansible 2.4.3.0; Darwin
  Trellis at "Update `vagrant_box_version` to `>= 201801.02.0`"
---------------------------------------------------
non-zero return code
Error: Could not get 'template_root' option. Does it exist?
failed: [137.74.247.205] (item=template_root) => {"changed": false, "cmd": " wp option get template_root --skip-plugins --skip-themes\n ", "delta": "0:00:00.212474", "end": "2018-03-02 04:52:16.992247", "failed_when_result": true, "item": "template_root", "rc": 1, "start": "2018-03-02 04:52:16.779773", "stderr_lines": ["Error: Could not get 'template_root' option. Does it exist?"], "stdout": "", "stdout_lines": []}
---------------------------------------------------
non-zero return code
Error: Could not get 'stylesheet_root' option. Does it exist?
failed: [137.74.247.205] (item=stylesheet_root) => {"changed": false, "cmd": " wp option get stylesheet_root --skip-plugins --skip-themes\n ", "delta": "0:00:00.210323", "end": "2018-03-02 04:52:17.467505", "failed_when_result": true, "item": "stylesheet_root", "rc": 1, "start": "2018-03-02 04:52:17.257182", "stderr_lines": ["Error: Could not get 'stylesheet_root' option. Does it exist?"], "stdout": "", "stdout_lines": []}
    to retry, use: --limit @/Users/cosmicsound/dev/uhlhosting.ch/projects/learn-trellis/trellis/deploy.retry

PLAY RECAP *********************************************************************************************************************************************************************************************************************************************************************
137.74.247.205             : ok=24   changed=8    unreachable=0    failed=1   
localhost                  : ok=0    changed=0    unreachable=0    failed=0   

**Please provide steps to reproduce, including full log output:**

`Cosmics-MacBook-Pro:trellis cosmicsound$ ansible-playbook deploy.yml -e "site=uhlhosting.ch env=production"

PLAY [Ensure necessary variables are defined] **********************************************************************************************************************************************************************************************************************************
 [WARNING]: You Ansible version is 2.4.3.0 but this version of Trellis has only been tested for compatability with Ansible 2.4.0.0 -> 2.4.2.0. It is advisable to check for Trellis updates or downgrade your Ansible version.

TASK [Ensure environment is defined] *******************************************************************************************************************************************************************************************************************************************
skipping: [localhost]

PLAY [Test Connection] *********************************************************************************************************************************************************************************************************************************************************

TASK [connection : Require manual definition of remote-user] *******************************************************************************************************************************************************************************************************************
skipping: [137.74.247.205]

TASK [connection : Specify preferred HostKeyAlgorithms for unknown hosts] ******************************************************************************************************************************************************************************************************
skipping: [137.74.247.205]

TASK [connection : Check whether Ansible can connect as web] *******************************************************************************************************************************************************************************************************************
ok: [137.74.247.205 -> localhost]

TASK [connection : Warn about change in host keys] *****************************************************************************************************************************************************************************************************************************
skipping: [137.74.247.205]

TASK [connection : Set remote user for each host] ******************************************************************************************************************************************************************************************************************************
skipping: [137.74.247.205]

TASK [connection : Announce which user was selected] ***************************************************************************************************************************************************************************************************************************
skipping: [137.74.247.205]

TASK [connection : Load become password] ***************************************************************************************************************************************************************************************************************************************
skipping: [137.74.247.205]

PLAY [Deploy WP site] **********************************************************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] *********************************************************************************************************************************************************************************************************************************************************
ok: [137.74.247.205]

TASK [Ensure site is valid] ****************************************************************************************************************************************************************************************************************************************************
skipping: [137.74.247.205]

TASK [Ensure repo is valid] ****************************************************************************************************************************************************************************************************************************************************
skipping: [137.74.247.205]

TASK [deploy : include_tasks] **************************************************************************************************************************************************************************************************************************************************

TASK [deploy : include_tasks] **************************************************************************************************************************************************************************************************************************************************

TASK [deploy : Initialize] *****************************************************************************************************************************************************************************************************************************************************
ok: [137.74.247.205]

TASK [deploy : include_tasks] **************************************************************************************************************************************************************************************************************************************************

TASK [deploy : include_tasks] **************************************************************************************************************************************************************************************************************************************************

TASK [deploy : Add known_hosts] ************************************************************************************************************************************************************************************************************************************************
ok: [137.74.247.205] => (item=github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==)
ok: [137.74.247.205] => (item=bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==)
ok: [137.74.247.205] => (item=gitlab.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAfuCHKVTjquxvt6CM6tdG4SLp1Btn/nOeHHE5UOzRdf)
ok: [137.74.247.205] => (item=gitlab.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsj2bNKTBSpIYDEGk9KxsGh3mySTRgMtXL583qmBpzeQ+jqCMRgBqB98u3z++J1sKlXHWfM9dyhSevkMwSbhoR8XIq/U0tCNyokEi/ueaBMCvbcTHhO7FcwzY92WK4Yt0aGROY5qX2UKSeOvuP4D6TPqKF1onrSzH9bx9XUf2lEdWT/ia1NEKjunUqu1xOB/StKDHMoX4/OKyIzuS0q/T1zOATthvasJFoPrAjkohTyaDUz2LN5JoH839hViyEG82yB+MjcFV5MU3N1l1QL3cVUCh93xSaua1N85qivl+siMkPGbO5xR/En4iEY6K2XPASUEMaieWVNTRCtJ4S8H+9)

TASK [deploy : Check whether project source path is a git repo] ****************************************************************************************************************************************************************************************************************
ok: [137.74.247.205]

TASK [deploy : Get current git remote URL] *************************************************************************************************************************************************************************************************************************************
ok: [137.74.247.205]

TASK [deploy : Update git remote URL] ******************************************************************************************************************************************************************************************************************************************
skipping: [137.74.247.205]

TASK [deploy : Clone project files] ********************************************************************************************************************************************************************************************************************************************
ok: [137.74.247.205]

TASK [deploy : Failed connection to remote repo] *******************************************************************************************************************************************************************************************************************************
skipping: [137.74.247.205]

TASK [deploy : include_tasks] **************************************************************************************************************************************************************************************************************************************************

TASK [deploy : include_tasks] **************************************************************************************************************************************************************************************************************************************************

TASK [deploy : write unfinished file] ******************************************************************************************************************************************************************************************************************************************
changed: [137.74.247.205]

TASK [deploy : Check for project repo subtree] *********************************************************************************************************************************************************************************************************************************
ok: [137.74.247.205]

TASK [deploy : Fail if repo_subtree_path is set incorrectly] *******************************************************************************************************************************************************************************************************************
skipping: [137.74.247.205]

TASK [deploy : Create new release dir] *****************************************************************************************************************************************************************************************************************************************
changed: [137.74.247.205]

TASK [deploy : Run git archive to populate new build dir] **********************************************************************************************************************************************************************************************************************
skipping: [137.74.247.205]

TASK [deploy : Run git archive with subdirectory to populate new build dir] ****************************************************************************************************************************************************************************************************
changed: [137.74.247.205]

TASK [deploy : include_tasks] **************************************************************************************************************************************************************************************************************************************************

TASK [deploy : include_tasks] **************************************************************************************************************************************************************************************************************************************************

TASK [deploy : Copy project templates] *****************************************************************************************************************************************************************************************************************************************
changed: [137.74.247.205] => (item={u'dest': u'.env', u'src': u'roles/deploy/templates/env.j2', u'name': u'.env config'})

TASK [deploy : Check if project folders exist] *********************************************************************************************************************************************************************************************************************************
ok: [137.74.247.205] => (item=vendor)

TASK [deploy : Copy project folders] *******************************************************************************************************************************************************************************************************************************************
changed: [137.74.247.205] => (item={'_ansible_parsed': True, u'stat': {u'isuid': False, u'uid': 1001, u'exists': True, u'attr_flags': u'e', u'woth': False, u'isreg': False, u'device_type': 0, u'mtime': 1519960343.2719111, u'block_size': 4096, u'inode': 1322858, u'isgid': False, u'size': 4096, u'executable': True, u'roth': True, u'charset': u'binary', u'readable': True, u'version': u'1770316324', u'pw_name': u'web', u'gid': 33, u'ischr': False, u'wusr': True, u'writeable': True, u'isdir': True, u'blocks': 8, u'xoth': True, u'rusr': True, u'nlink': 7, u'issock': False, u'rgrp': True, u'gr_name': u'www-data', u'path': u'/srv/www/uhlhosting.ch/current/vendor', u'xusr': True, u'atime': 1519962821.3298895, u'mimetype': u'inode/directory', u'ctime': 1519960343.2719111, u'isblk': False, u'xgrp': True, u'dev': 64512, u'wgrp': False, u'isfifo': False, u'mode': u'0755', u'islnk': False, u'attributes': [u'extents']}, u'changed': False, '_ansible_no_log': False, 'item': u'vendor', '_ansible_item_result': True, 'failed': False, u'invocation': {u'module_args': {u'checksum_algorithm': u'sha1', u'get_checksum': True, u'follow': False, u'path': u'/srv/www/uhlhosting.ch/current/vendor', u'get_md5': True, u'get_mime': True, u'get_attributes': True}}, '_ansible_ignore_errors': None})

TASK [deploy : include_tasks] **************************************************************************************************************************************************************************************************************************************************
included: /Users/cosmicsound/dev/uhlhosting.ch/projects/learn-trellis/trellis/roles/deploy/hooks/build-after.yml for 137.74.247.205

TASK [deploy : Check for composer.json in project root or project_subtree_path] ************************************************************************************************************************************************************************************************
ok: [137.74.247.205]

TASK [deploy : Fail if composer.json not found] ********************************************************************************************************************************************************************************************************************************
skipping: [137.74.247.205]

TASK [deploy : Setup packagist.com authentication] *****************************************************************************************************************************************************************************************************************************
skipping: [137.74.247.205]

TASK [deploy : Install Composer dependencies] **********************************************************************************************************************************************************************************************************************************
changed: [137.74.247.205]

TASK [deploy : include_tasks] **************************************************************************************************************************************************************************************************************************************************

TASK [deploy : Ensure shared sources are present -- directories] ***************************************************************************************************************************************************************************************************************
ok: [137.74.247.205] => (item={u'path': u'web/app/uploads', u'src': u'uploads'})

TASK [deploy : Ensure shared sources are present -- files' parent directories] *************************************************************************************************************************************************************************************************
skipping: [137.74.247.205] => (item={u'path': u'web/app/uploads', u'src': u'uploads'}) 

TASK [deploy : Ensure shared sources are present -- files] *********************************************************************************************************************************************************************************************************************
skipping: [137.74.247.205] => (item={u'path': u'web/app/uploads', u'src': u'uploads'}) 

TASK [deploy : Ensure parent directories for shared paths are present] *********************************************************************************************************************************************************************************************************
ok: [137.74.247.205] => (item={u'path': u'web/app/uploads', u'src': u'uploads'})

TASK [deploy : Ensure shared paths are absent] *********************************************************************************************************************************************************************************************************************************
changed: [137.74.247.205] => (item={u'path': u'web/app/uploads', u'src': u'uploads'})

TASK [deploy : Create shared symlinks] *****************************************************************************************************************************************************************************************************************************************
changed: [137.74.247.205] => (item={u'path': u'web/app/uploads', u'src': u'uploads'})

TASK [deploy : include_tasks] **************************************************************************************************************************************************************************************************************************************************

TASK [deploy : include_tasks] **************************************************************************************************************************************************************************************************************************************************
included: /Users/cosmicsound/dev/uhlhosting.ch/projects/learn-trellis/trellis/roles/deploy/hooks/finalize-before.yml for 137.74.247.205

TASK [deploy : Create file with multisite constants defined as false] **********************************************************************************************************************************************************************************************************
ok: [137.74.247.205]

TASK [deploy : WordPress Installed?] *******************************************************************************************************************************************************************************************************************************************
ok: [137.74.247.205]

TASK [deploy : Get WP theme template and stylesheet roots] *********************************************************************************************************************************************************************************************************************
System info:
  Ansible 2.4.3.0; Darwin
  Trellis at "Update `vagrant_box_version` to `>= 201801.02.0`"
---------------------------------------------------
non-zero return code
Error: Could not get 'template_root' option. Does it exist?
failed: [137.74.247.205] (item=template_root) => {"changed": false, "cmd": " wp option get template_root --skip-plugins --skip-themes\n ", "delta": "0:00:00.212474", "end": "2018-03-02 04:52:16.992247", "failed_when_result": true, "item": "template_root", "rc": 1, "start": "2018-03-02 04:52:16.779773", "stderr_lines": ["Error: Could not get 'template_root' option. Does it exist?"], "stdout": "", "stdout_lines": []}
---------------------------------------------------
non-zero return code
Error: Could not get 'stylesheet_root' option. Does it exist?
failed: [137.74.247.205] (item=stylesheet_root) => {"changed": false, "cmd": " wp option get stylesheet_root --skip-plugins --skip-themes\n ", "delta": "0:00:00.210323", "end": "2018-03-02 04:52:17.467505", "failed_when_result": true, "item": "stylesheet_root", "rc": 1, "start": "2018-03-02 04:52:17.257182", "stderr_lines": ["Error: Could not get 'stylesheet_root' option. Does it exist?"], "stdout": "", "stdout_lines": []}
    to retry, use: --limit @/Users/cosmicsound/dev/uhlhosting.ch/projects/learn-trellis/trellis/deploy.retry

PLAY RECAP *********************************************************************************************************************************************************************************************************************************************************************
137.74.247.205             : ok=24   changed=8    unreachable=0    failed=1   
localhost                  : ok=0    changed=0    unreachable=0    failed=0   

Please describe your local environment:

OSX High Sierra, Terminal

Where did the bug happen? Development or remote servers?

Remote servers

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

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

https://discourse.roots.io/t/error-could-not-get-template-root-option-does-it-exist/11616/8


fullyint commented 6 years ago

😄 Good job solving it (according to your edit to title, adding "Solved").

Yep, I think this was handled in #948 Remember to search issues before posting, as suggested by the issue template checkbox:

  • [ ] This request isn't a duplicate of an existing issue