Commcare-cloud monolith deployment

I am currently deploying in a monolith environment. I followed all the steps correctly yet when I run
commcare-cloud monolith deploy-stack --skip-check -e 'CCHQ_IS_FRESH_INSTALL=1' Am getting the error below. Looking forward to your help.

ansible-playbook /home/smanjawira/commcare-cloud/src/commcare_cloud/ansible/deploy_stack.yml -i /home/smanjawira/environments/monolith/inventory.ini -e @/home/smanjawira/environments/monolith/public.yml -e @/home/smanjawira/environments/monolith/.generated.yml --diff -e CCHQ_IS_FRESH_INSTALL=1 -u ansible -e @/home/smanjawira/environments/monolith/vault.yml --vault-password-file=/home/smanjawira/commcare-cloud/src/commcare_cloud/ansible/echo_vault_password.sh '--ssh-common-args=-o UserKnownHostsFile=/home/smanjawira/environments/monolith/known_hosts'
**Vault Password for 'monolith': **
[DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.6.9 (default, Jun 29 2022, 11:45:57) [GCC 8.4.0]. This feature will be removed **
from ansible-core in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
/home/smanjawira/.virtualenvs/cchq/lib/python3.6/site-packages/ansible/parsing/vault/init.py:44: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
** from cryptography.exceptions import InvalidSignature

**PLAY [update apt cache] *********************************************************************************************************************************************************************************************

**TASK [apt] **********************************************************************************************************************************************************************************************************
fatal: [192.168.8.14]: FAILED! => {"changed": false, "module_stderr": "Shared connection to 192.168.8.14 closed.\r\n", "module_stdout": "/usr/lib/python3/dist-packages/OpenSSL/crypto.py:12: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.\r\n from cryptography import x509\r\nTraceback (most recent call last):\r\n File "/tmp/ansible-tmp-1665060690.0126739-12554-7726360987583/AnsiballZ_apt.py", line 100, in \r\n _ansiballz_main()\r\n File "/tmp/ansible-tmp-1665060690.0126739-12554-7726360987583/AnsiballZ_apt.py", line 92, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File "/tmp/ansible-tmp-1665060690.0126739-12554-7726360987583/AnsiballZ_apt.py", line 41, in invoke_module\r\n run_name='main', alter_sys=True)\r\n File "/usr/lib/python3.6/runpy.py", line 205, in run_module\r\n return _run_module_code(code, init_globals, run_name, mod_spec)\r\n File "/usr/lib/python3.6/runpy.py", line 96, in _run_module_code\r\n mod_name, mod_spec, pkg_name, script_name)\r\n File "/usr/lib/python3.6/runpy.py", line 85, in _run_code\r\n exec(code, run_globals)\r\n File "/tmp/ansible_apt_payload_bkoyiwkb/ansible_apt_payload.zip/ansible/modules/apt.py", line 327, in \r\n File "", line 971, in _find_and_load\r\n File "", line 955, in _find_and_load_unlocked\r\n File "", line 656, in _load_unlocked\r\n File "", line 626, in _load_backward_compatible\r\n File "/tmp/ansible_apt_payload_bkoyiwkb/ansible_apt_payload.zip/ansible/module_utils/urls.py", line 115, in \r\n File "/usr/lib/python3/dist-packages/urllib3/contrib/pyopenssl.py", line 46, in \r\n import OpenSSL.SSL\r\n File "/usr/lib/python3/dist-packages/OpenSSL/init.py", line 8, in \r\n from OpenSSL import crypto, SSL\r\n File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1550, in \r\n class X509StoreFlags(object):\r\n File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1570, in X509StoreFlags\r\n CB_ISSUER_CHECK = _lib.X509_V_FLAG_CB_ISSUER_CHECK\r\nAttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

**PLAY RECAP **********************************************************************************************************************************************************************************************************
**192.168.8.14 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 **

✗ Apply failed with status code 2

Hi Senze,
have you seen his change log, can you try Installing Python 3.9 and update-alternatives to assign python 3.9

1 Like

This should have been fixed here: Add missing pyOpenSSL dependency by skodde · Pull Request #5475 · dimagi/commcare-cloud · GitHub

Are you running the latest commcare-cloud code and did you update the local dependencies (calling update-code or manually running python3 -m pip install -r requirements.txt inside the commcare-cloud virtualenv)?

1 Like