poanetwork / blockscout-terraform

An automation framework for spinning up cloud infrastructure to run BlockScout
GNU General Public License v3.0
46 stars 37 forks source link

Ansible deployment - Error while deploying the infrastructure #147

Open junedl-nimblechapps opened 4 years ago

junedl-nimblechapps commented 4 years ago

Here is my error message:

Screenshot 2019-11-25 at 4 20 16 PM

From error message it looks like some some state are change but Im deploying it first time using ansible-playbook deploy_infra.yml command

vbaranov commented 4 years ago

@junedl-nimblechapps in order to deploy infrastructure first time you should use ansible-playbook deploy_infra.yml. ansible-playbook deploy_software.yml is used to deploy updates on the application.

junedl-nimblechapps commented 4 years ago

@vbaranov it was typo. Im using command to deploy infrastructure. Its stops at ok: [xyz] => (item={'value': u'sudo systemctl restart explorer.service', 'key': u'heart_command'})

vbaranov commented 4 years ago

Just to make sure, that prerequisites are correct: which version of Terraform, Ansible and python on the machine where you make a deploy from?

Did the deployment create an EC2-server with the application? Can you check is /opt/app folder is not empty on that server? The application should live there

junedl-nimblechapps commented 4 years ago

Terraform v0.12.15 ansible 2.9.1 Python 2.7.10

junedl-nimblechapps commented 4 years ago

Well I installed the latest version of pyhton3.

python3 version is 3.8.0 os version is macOS 10.14

and set ansible_python_interpreter in my [mygroup].yml to python3 located on my device using which python command.

Path : /Library/Frameworks/Python.framework/Versions/3.8/bin/python3

Im still getting the above error message.

vbaranov commented 4 years ago

@junedl-nimblechapps

Could you try to get upstream from the master branch and repeat deployment?

If this doesn't help, try to clean deployment cache ansible-playbook clean.yml (ref https://docs.blockscout.com/for-developers/ansible-deployment/common-additional-tasks#cleaning-deployment-cache) and try deployment again

junedl-nimblechapps commented 4 years ago

@vbaranov Still the same error.

However

But ....

vbaranov commented 4 years ago

Check that your ansible is tied to python 3 like this:

viktor$ ansible --version
ansible 2.8.5
  config file = None
  configured module search path = ['/Users/viktor/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/2.8.5_1/libexec/lib/python3.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.7.4 (default, Oct 12 2019, 19:06:48) [Clang 11.0.0 (clang-1100.0.33.8)]

if no, I'd recommend reinstalling ansible.

And then you can try to destroy built infrastructure by following this guide https://docs.blockscout.com/for-developers/ansible-deployment/destroying-provisioned-infrastructure and start building from scratch again.

If this will not help, try to downgrade Terraform version. I successfully used v0.12.12 with the latest deployment in the past month:

viktor$ terraform --version
Terraform v0.12.12
vbaranov commented 4 years ago

@junedl-nimblechapps take a look to this comment https://github.com/poanetwork/blockscout-terraform/issues/144#issuecomment-582403732. Possibly, you have the same issue. The main suggestion is to try with Terraform 11.11 - 11.14. The script is not stable with Terraform 12.