Error deploying commcare-sync instance

Unable to run the ansible script to deploy commcare-sync due to the following error ‘public_host’ is undefined error as below:

Following the steps in the production deployment the following configuration files have already been updated as follows:

hosts.yml

vars.yml

Any help pointing where else the Public Host in stated in the error also needs to be defined?

I would have thought the definition in the vars file would be sufficient. How are you running the ansible script? Is it possible that it's not pointing at the right environment?

Hi Cory,

Below is the folder I'm executing the script from and the script as per the instructions followed here:

Production Environments — CommCare Sync Ansible documentation (commcare-sync-ansible.readthedocs.io)

the path for each of the files are as follows:

/home/kuunika_admin/commcare-sync-ansible/inventories/myproject/example/hosts.yml

/home/kuunika_admin/commcare-sync-ansible/inventories/myproject/example/group_vars/commcare_sync/vars.yml

Hello

It looks like you have invalid directory structure. Perhaps by a mistake you might have copied the example configuration directory to inventories/myproject/example instead of inventories/myproject. If you move all the files in example directory to inventories/myproject, delete the examples subdirectory and run the commands, it should work.

Please review the documentation which states below command

cp -r inventories/example inventories/myproject

1 Like

Hi Sravan,

Thanks for pointing that out, however it looks like the docs have been updated from the time i was initially trying to deploy the commcare-sync to date.

When i tried running the script after moving the file locations it found the correct configuration file and was able to proceed with the deployment however i was then presented with this error:

Referencing the docs shows that the vault file now requires these two additional lines that were not there previously:

vault_mapbox_api_key:
vault_django_secret_key:

I appended these to my vault.yml file but now the script fails during the task Run superset database migrations:

fatal: [local1]: FAILED! => {"changed": true, "cmd": "/home/ansible/www/.virtualenvs/superset/bin/superset db upgrade", "delta": "0:00:01.394522", "end": "2022-08-11 13:03:19.545219", "msg": "non-zero return code", "rc": 1, "start": "2022-08-11 13:03:18.150697", "stderr": "--------------------------------------------------------------------------------\n WARNING\n--------------------------------------------------------------------------------\nA Default SECRET_KEY was detected, please use superset_config.py to override it.\nUse a strong complex alphanumeric string and use a tool to help you generate \na sufficiently random sequence, ex: openssl rand -base64 42\n--------------------------------------------------------------------------------\n--------------------------------------------------------------------------------\nlogging was configured successfully\n2022-08-11 13:03:19,134:INFO:superset.utils.logging_configurator:logging was configured successfully\n2022-08-11 13:03:19,138:INFO:root:Configured event logger of type <class 'superset.utils.log.DBEventLogger'>\nFalling back to the built-in cache, that stores data in the metadata database, for the following cache: FILTER_STATE_CACHE_CONFIG. It is recommended to use RedisCache, MemcachedCache or another dedicated caching backend for production deployments\n2022-08-11 13:03:19,139:WARNING:superset.utils.cache_manager:Falling back to the built-in cache, that stores data in the metadata database, for the following cache: FILTER_STATE_CACHE_CONFIG. It is recommended to use RedisCache, MemcachedCache or another dedicated caching backend for production deployments\nFalling back to the built-in cache, that stores data in the metadata database, for the following cache: EXPLORE_FORM_DATA_CACHE_CONFIG. It is recommended to use RedisCache, MemcachedCache or another dedicated caching backend for production deployments\n2022-08-11 13:03:19,141:WARNING:superset.utils.cache_manager:Falling back to the built-in cache, that stores data in the metadata database, for the following cache: EXPLORE_FORM_DATA_CACHE_CONFIG. It is recommended to use RedisCache, MemcachedCache or another dedicated caching backend for production deployments\nFailed to create app\nTraceback (

It looks like an error running superset db upgrade related to Superset

Can you please share rest of the traceback and I will see if I can help?

alright sure, i'll send you the rest via email as its quite a long output

Hi Niko,

It looks like the error is

"ModuleNotFoundError: No module named 'werkzeug.wrappers.etag

It looks like an issue with Superset itself. Please see the resolution at ModuleNotFoundError: No module named 'werkzeug.wrappers.etag' · Issue #20723 · apache/superset · GitHub and ModuleNotFoundError on fresh Superset 2.0.0 install · Issue #20717 · apache/superset · GitHub

You will need to do those steps with the virtualenv located at /home/ansible/www/.virtualenvs/superset/ activated.

1 Like

Sorry for the late feedback, I was tasked to other assignments in the interim but that did the trick and we were able to run the deploy successfully.

One addition we had to make was to also add the following to the vault.yml file:

vault_default_superset_password:

which doesn't appear to be documented in the install instructions currently but is necessary for a successful deploy

Thanks for the help Sravan

Niko