Roots Discourse

Deploying on Windows


#1

I’m trying to set up my development environment on Windows and when I run this command

ansible-playbook deploy.yml -e “site=staging.visitorstore.ch env=staging”

I get these errors:

TASK [deploy : Run npm install] *************************************************************************************************************************************************************************************************************************************
task path: /home/vagrant/trellis/deploy-hooks/build-before.yml:10
Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/commands/command.py
<104.248.43.139> ESTABLISH LOCAL CONNECTION FOR USER: vagrant
<104.248.43.139> EXEC /bin/sh -c ‘/usr/bin/python && sleep 0’
System info:
Ansible 2.5.3; Linux
Trellis version (per changelog): “Update wp-cli to 2.0.1”

MODULE FAILURE
Traceback (most recent call last):
File “/tmp/ansible_xOS35l/ansible_module_command.py”, line 248, in
main()
File “/tmp/ansible_xOS35l/ansible_module_command.py”, line 192, in main
os.chdir(chdir)
OSError: [Errno 2] No such file or directory:
‘/home/vagrant/site/web/app/themes/visitorstore’

The full traceback is:
Traceback (most recent call last):
File “/tmp/ansible_xOS35l/ansible_module_command.py”, line 248, in
main()
File “/tmp/ansible_xOS35l/ansible_module_command.py”, line 192, in main
os.chdir(chdir)
OSError: [Errno 2] No such file or directory: ‘/home/vagrant/site/web/app/themes/visitorstore’

fatal: [104.248.43.139]: FAILED! => {
“changed”: false,
“module_stdout”: “”,
“rc”: 1
}

Please help me to handle this.

Thanks,


#2

What troubleshooting steps have you tried already?


#3

I just fixed that - it was related to Windows characteristics and I started following these articles: https://discourse.roots.io/t/deploying-to-remote-from-windows/6316/7;
https://discourse.roots.io/t/running-deploy-within-the-guest-vm-on-windows-issue-with-building-assets/5800/4;
https://github.com/roots/docs/issues/62

so right now I’m on this stage -

TASK [deploy : Finalize the deploy] *************************************************************************************************************task path: /home/vagrant/trellis/roles/deploy/tasks/finalize.yml:8
Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/web_infrastructure/deploy_helper.py
<104.248.43.139> ESTABLISH SSH CONNECTION FOR USER: web
<104.248.43.139> SSH: EXEC ssh -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/d5e95318e3 104.248.43.139 ‘/bin/sh -c ‘"’"’/usr/bin/python && sleep 0’"’"’’
<104.248.43.139> (1, ‘\n{“msg”: “rmtree failed: [Errno 13] Permission denied: ‘/srv/www/staging.visitorstore.ch/releases/20180927185941/web/app/plugins/wp-migrate-db-pro-media-files/version.php’”, “failed”: true, “exception”: “Traceback (most recent call last):\n File \”/tmp/ansible_KJ0CL1/ansible_module_deploy_helper.py\", line 340, in delete_path\n shutil.rmtree(path, ignore_errors=False)\n File \"/usr/lib/python2.7/shutil.py\", line 247, in rmtree\n rmtree(fullname, ignore_errors, onerror)\n File \"/usr/lib/python2.7/shutil.py\", line 247, in rmtree\n rmtree(fullname, ignore_errors, onerror)\n File \"/usr/lib/python2.7/shutil.py\", line 247, in rmtree\n rmtree(fullname, ignore_errors, onerror)\n File \"/usr/lib/python2.7/shutil.py\", line 247, in rmtree\n rmtree(fullname, ignore_errors, onerror)\n File \"/usr/lib/python2.7/shutil.py\", line 252, in rmtree\n onerror(os.remove, fullname, sys.exc_info())\n File \"/usr/lib/python2.7/shutil.py\", line 250, in rmtree\n os.remove(fullname)\nOSError: [Errno 13] Permission denied: ‘/srv/www/staging.visitorstore.ch/releases/20180927185941/web/app/plugins/wp-migrate-db-pro-media-files/version.php’\n", “invocation”: {“module_args”: {“directory_mode”: null, “force”: null, “remote_src”: null, “path”: “/srv/www/staging.visitorstore.ch”, “owner”: null, “follow”: false, “group”: null, “keep_releases”: 5, “unsafe_writes”: null, “state”: “finalize”, “content”: null, “serole”: null, “shared_path”: “shared”, “releases_path”: “releases”, “current_path”: “current”, “setype”: null, “selevel”: null, “regexp”: null, “src”: null, “unfinished_filename”: “DEPLOY_UNFINISHED”, “seuser”: null, “delimiter”: null, “mode”: null, “clean”: true, “release”: “20181203214038”, “attributes”: null, “backup”: null}}}\n’, ‘OpenSSH_7.2p2 Ubuntu-4ubuntu2.6, OpenSSL 1.0.2g 1 Mar 2016\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 3: Applying options for *\r\ndebug3: kex names ok: [curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256]\r\ndebug1: /etc/ssh/ssh_config line 20: Deprecated option “useroaming”\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 2386\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 1\r\n’)
System info:
Ansible 2.5.3; Linux
Trellis version (per changelog): “Update wp-cli to 2.0.1”

rmtree failed: [Errno 13] Permission denied:
‘/srv/www/staging.visitorstore.ch/releases/20180927185941/web/app/plugins/wp-
migrate-db-pro-media-files/version.php’
The full traceback is:
Traceback (most recent call last):
File “/tmp/ansible_KJ0CL1/ansible_module_deploy_helper.py”, line 340, in delete_path
shutil.rmtree(path, ignore_errors=False)
File “/usr/lib/python2.7/shutil.py”, line 247, in rmtree
rmtree(fullname, ignore_errors, onerror)
File “/usr/lib/python2.7/shutil.py”, line 247, in rmtree
rmtree(fullname, ignore_errors, onerror)
File “/usr/lib/python2.7/shutil.py”, line 247, in rmtree
rmtree(fullname, ignore_errors, onerror)
File “/usr/lib/python2.7/shutil.py”, line 247, in rmtree
rmtree(fullname, ignore_errors, onerror)
File “/usr/lib/python2.7/shutil.py”, line 252, in rmtree
onerror(os.remove, fullname, sys.exc_info())
File “/usr/lib/python2.7/shutil.py”, line 250, in rmtree
os.remove(fullname)
OSError: [Errno 13] Permission denied: ‘/srv/www/staging.visitorstore.ch/releases/20180927185941/web/app/plugins/wp-migrate-db-pro-media-files/version.php’

fatal: [104.248.43.139]: FAILED! => {
“changed”: false,
“invocation”: {
“module_args”: {
“attributes”: null,
“backup”: null,
“clean”: true,
“content”: null,
“current_path”: “current”,
“delimiter”: null,
“directory_mode”: null,
“follow”: false,
“force”: null,
“group”: null,
“keep_releases”: 5,
“mode”: null,
“owner”: null,
“path”: “/srv/www/staging.visitorstore.ch”,
“regexp”: null,
“release”: “20181203214038”,
“releases_path”: “releases”,
“remote_src”: null,
“selevel”: null,
“serole”: null,
“setype”: null,
“seuser”: null,
“shared_path”: “shared”,
“src”: null,
“state”: “finalize”,
“unfinished_filename”: “DEPLOY_UNFINISHED”,
“unsafe_writes”: null
}
}
}