# Quick monolith install problem

**URL:** <https://forum.dimagi.com/t/quick-monolith-install-problem/9088>\
**Category:** Developers\
**Created:** [June 20, 2022, 6:38pm UTC](https://forum.dimagi.com/t/quick-monolith-install-problem/9088 "2022-06-20T18:38:32Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![robynton](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/r/67e7ee/32.png) [@robynton](https://forum.dimagi.com/u/robynton)\
**Post date:** [June 20, 2022, 6:38pm UTC](https://forum.dimagi.com/t/quick-monolith-install-problem/9088/1 "2022-06-20T18:38:32Z")

</div>

Good day to all. I've had a problem running quick monolith install on Ubuntu 18.04 LTS.  
It give me error about install-config.yml when running commcare-cloud/quick\_monolith\_install/bash cchq-install.sh install-config.yml

TASK [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [127.0.0.1] =\> {  
"msg": "Invalid installation configuration: ['monolith', 'mysitecom', 'srv001', 'exampelserver1.mysitecom', 'SSH public key string', 'ssh username', '']. Please define all the variables in your install-config.yml file."  
}

TASK [assert] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [127.0.0.1]: FAILED! =\> {  
"assertion": "not config\_is\_not\_valid",  
"changed": false,  
"evaluated\_to": false,  
"msg": "Assertion failed"  
}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
127.0.0.1 : ok=4 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

It looks like it needs extra parameter. My install-config is made over samlple (just replaced private data):

env\_name: "monolith"

site\_host: "mysitecom"

server\_inventory\_name: "srv001"

server\_host\_name: "exampelserver1.mysitecom"

ssh\_public\_key: "SSH public key string"

ssh\_username: "ssh username"

So, can anyone help me what else should I add?

---

<div class="post-metadata">

**Author:** ![robynton](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/r/67e7ee/32.png) [@robynton](https://forum.dimagi.com/u/robynton)\
**Post date:** [June 25, 2022, 1:26pm UTC](https://forum.dimagi.com/t/quick-monolith-install-problem/9088/2 "2022-06-25T13:26:20Z")

</div>

The links in readme on github has been broken.

> **[commcare-cloud/quick\_monolith\_install at master · dimagi/commcare-cloud](https://github.com/dimagi/commcare-cloud/tree/master/quick_monolith_install#readme)**
>
> master/quick\_monolith\_install

Any suggestion, what that extra parameter should be?

---

<div class="post-metadata">

**Author:** ![Ethan\_Soergel](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/ethan_soergel/32/543_2.png) [@Ethan\_Soergel](https://forum.dimagi.com/u/Ethan_Soergel)\
**Post date:** [June 27, 2022, 2:19pm UTC](https://forum.dimagi.com/t/quick-monolith-install-problem/9088/3 "2022-06-27T14:19:57Z")

</div>

It looks like it also needs a parameter called `cchq_venv`, with the path to the `commcare-cloud` virtualenvironment directory, which will be something like this (though I'd verify the location on your system:  
`~/.virtualenvs/cchq`

The links in the README should point to  
[https://commcare-cloud.readthedocs.io/en/latest/installation/2-manual-install.html](https://commcare-cloud.readthedocs.io/en/latest/installation/2-manual-install.html)  
and  
[https://commcare-cloud.readthedocs.io/en/latest/installation/1-quick-monolith-install.html](https://commcare-cloud.readthedocs.io/en/latest/installation/1-quick-monolith-install.html)

---

<div class="post-metadata">

**Author:** ![robynton](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/r/67e7ee/32.png) [@robynton](https://forum.dimagi.com/u/robynton)\
**Post date:** [June 27, 2022, 9:26pm UTC](https://forum.dimagi.com/t/quick-monolith-install-problem/9088/4 "2022-06-27T21:26:05Z")

</div>

Thanks for quick reply! But I've got the same error with `cchq_venv` declared.  
Like we see in _bootstrap-env-playbook.yml_

> vars:  
> install\_config:  
> - '{{env\_name}}'  
> - '{{site\_host}}'  
> - '{{server\_inventory\_name}}'  
> - '{{server\_host\_name}}'  
> - '{{ssh\_public\_key}}'  
> - '{{ssh\_username}}'  
> - '{{cchq\_venv}}'  
> config\_is\_not\_valid: '{{"" in install\_config}}'

Event _config\_is\_not\_valid: '{{"" in install\_config}}'_ happens when some of this variables are empty string.  
But as we see in _cchq-install.sh_

> #VENV should have been set by init.sh  
> ansible-playbook --connection=local --extra-vars "@$config\_file\_path" --extra-vars "cchq\_venv=$VENV" "$DIR/bootstrap-env-playbook.yml"

Somehow _$VENV_ isn't set correctly by init.sh and we get error from ansible about config part.  
When we set direct path instead of _$VENV_

> ansible-playbook --connection=local --extra-vars "@$config\_file\_path" --extra-vars "cchq\_venv=/home/username/.virtualenvs/cchq" "$DIR/bootstrap-env-playbook.yml"

There's no error about config from ansible.

---

<div class="post-metadata">

**Author:** ![Ethan\_Soergel](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/ethan_soergel/32/543_2.png) [@Ethan\_Soergel](https://forum.dimagi.com/u/Ethan_Soergel)\
**Post date:** [June 28, 2022, 9:34pm UTC](https://forum.dimagi.com/t/quick-monolith-install-problem/9088/5 "2022-06-28T21:34:36Z")

</div>

It's also possible `init.sh` isn't being executed for new terminal sessions - there's an option during setup to pick yes or no there.

Your explanation makes sense. Have you tried setting `$VENV` manually?

---

<div class="post-metadata">

**Author:** ![robynton](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/r/67e7ee/32.png) [@robynton](https://forum.dimagi.com/u/robynton)\
**Post date:** [June 29, 2022, 8:29pm UTC](https://forum.dimagi.com/t/quick-monolith-install-problem/9088/6 "2022-06-29T20:29:14Z")

</div>

Thanks for the clue! Yes, when `$VENV` was set manually, ansible script worked. It seems that init.sh isn't executed before ansible normally.

But, unfortunatly, in the end I've had this error:

> TASK [Configure Pl/Proxy cluster] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> fatal: [192.169.233.128]: FAILED! =\> {"changed": false, "cmd": "./manage.py configure\_pl\_proxy\_cluster --create\_only", "msg": "stdout: Creating cluster config in DB proxy\n\n:stderr: Traceback (most recent call last):\n File "/home/cchq/www/cchq/current/python\_env/lib/python3.9/site-packages/django/db/backends/utils.py", line 82, in \_execute\n return self.cursor.execute(sql)\npsycopg2.errors.UndefinedObject: role "axk5z8gymsfryjnqeun0gicdqdj4tu3j" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File "/home/cchq/www/cchq/releases/2022-06-29\_19.08/./manage.py", line 190, in \n main()\n File "/home/cchq/www/cchq/releases/2022-06-29\_19.08/./manage.py", line 44, in main\n execute\_from\_command\_line(sys.argv)\n File "/home/cchq/www/cchq/current/python\_env/lib/python3.9/site-packages/django/core/management/ **init**.py", line 419, in execute\_from\_command\_line\n utility.execute()\n File "/home/cchq/www/cchq/current/python\_env/lib/python3.9/site-packages/django/core/management/ **init**.py", line 413, in execute\n self.fetch\_command(subcommand).run\_from\_argv(self.argv)\n File "/home/cchq/www/cchq/current/python\_env/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run\_from\_argv\n self.execute(\*args, \*\*cmd\_options)\n File "/home/cchq/www/cchq/current/python\_env/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute\n output = self.handle(\*args, \*\*options)\n File "/home/cchq/www/cchq/releases/2022-06-29\_19.08/corehq/sql\_db/management/commands/configure\_pl\_proxy\_cluster.py", line 54, in handle\n create\_or\_update\_cluster(plproxy\_config, verbose, options['create\_only'])\n File "/home/cchq/www/cchq/releases/2022-06-29\_19.08/corehq/sql\_db/management/commands/configure\_pl\_proxy\_cluster.py", line 70, in create\_or\_update\_cluster\n create\_pl\_proxy\_cluster(cluster\_config, verbose)\n File "/home/cchq/www/cchq/releases/2022-06-29\_19.08/corehq/sql\_db/management/commands/configure\_pl\_proxy\_cluster.py", line 149, in create\_pl\_proxy\_cluster\n cursor.execute(command)\n File "/home/cchq/www/cchq/current/python\_env/lib/python3.9/site-packages/django/db/backends/utils.py", line 66, in execute\n return self.\_execute\_with\_wrappers(sql, params, many=False, executor=self.\_execute)\n File "/home/cchq/www/cchq/current/python\_env/lib/python3.9/site-packages/django/db/backends/utils.py", line 75, in \_execute\_with\_wrappers\n return executor(sql, params, many, context)\n File "/home/cchq/www/cchq/current/python\_env/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in \_execute\n return self.cursor.execute(sql, params)\n File "/home/cchq/www/cchq/current/python\_env/lib/python3.9/site-packages/django/db/utils.py", line 90, in **exit** \n raise dj\_exc\_value.with\_traceback(traceback) from exc\_value\n File "/home/cchq/www/cchq/current/python\_env/lib/python3.9/site-packages/django/db/backends/utils.py", line 82, in \_execute\n return self.cursor.execute(sql)\ndjango.db.utils.ProgrammingError: role "axk5z8gymsfryjnqeun0gicdqdj4tu3j" does not exist\n\n", "path": "/home/cchq/www/cchq/current/python\_env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin", "syspath": ["/tmp/ansible\_django\_manage\_payload\_jvlkdvc8/ansible\_django\_manage\_payload.zip", "", "/usr/lib/python36.zip", "/usr/lib/python3.6", "/usr/lib/python3.6/lib-dynload", "/usr/local/lib/python3.6/dist-packages", "/usr/lib/python3/dist-packages"]}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
192.169.233.128 : ok=651 changed=316 unreachable=0 failed=1 skipped=392 rescued=0 ignored=2

✗ Apply failed with status code 2

Saying something about undefined role. Any clues where to start digging?

---

<div class="post-metadata">

**Author:** ![Ethan\_Soergel](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/ethan_soergel/32/543_2.png) [@Ethan\_Soergel](https://forum.dimagi.com/u/Ethan_Soergel)\
**Post date:** [June 30, 2022, 7:46pm UTC](https://forum.dimagi.com/t/quick-monolith-install-problem/9088/7 "2022-06-30T19:46:06Z")

</div>

I believe that error means that the postgres role does not exist. This could be because there are multiple instances of postgres running, and the wrong one is occupying the port commcare-cloud expects, or perhaps initial setup failed to create that role.

---

<div class="post-metadata">

**Author:** ![Sravan\_Reddy](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@Sravan\_Reddy](https://forum.dimagi.com/u/Sravan_Reddy)\
**Post date:** [July 1, 2022, 4:55am UTC](https://forum.dimagi.com/t/quick-monolith-install-problem/9088/8 "2022-07-01T04:55:45Z")

</div>

Hello,

> [@robynton](#):
>
> psycopg2.errors.UndefinedObject: role "axk5z8gymsfryjnqeun0gicdqdj4tu3j" does not exist

This indicates that the postgres user `axk5z8gymsfryjnqeun0gicdqdj4tu3j` doesn't exist. CommCareHQ code base uses mainly a user called `commcarehq` but the quick-install script is generating a different username. There is possibly a bug. I will look into addressing this.

Meanwhile, to get around this, you can manually edit your environment config and do a deploy-stack again. Please do below on the above VM.

- Edit the `ansible-vault edit ~/environments/<env_name>/vault.yml`. You will need to update any usernames per this example file [commcare-cloud/commcare-cloud-bootstrap/environment/private.yml.j2 at master · dimagi/commcare-cloud · GitHub](https://github.com/dimagi/commcare-cloud/blob/master/commcare-cloud-bootstrap/environment/private.yml.j2) .
- Re-run the rest of the commands as listed in the Troubleshooting section on quick-install [Quick Install on Single Server — CommCareHQ Deployment documentation](https://commcare-cloud.readthedocs.io/en/latest/installation/1-quick-monolith-install.html#troubleshooting).

---

<div class="post-metadata">

**Author:** ![robynton](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/r/67e7ee/32.png) [@robynton](https://forum.dimagi.com/u/robynton)\
**Post date:** [July 1, 2022, 10:38pm UTC](https://forum.dimagi.com/t/quick-monolith-install-problem/9088/9 "2022-07-01T22:38:22Z")

</div>

Thank you for quick respond sir!  
I've changed all usernames which was just a strange pool of symbolic string via `ansible-vault edit ~/environments/<env_name>/vault.yml` and ran `commcare-cloud cchq deploy-stack --skip-check --skip-tags=users -e 'CCHQ_IS_FRESH_INSTALL=1'`, but got next error

> TASK [couchdb2 : Add nodes] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> skipping: [192.169.233.128] =\> (item=192.169.233.128)
> 
> TASK [couchdb2 : Create system databases] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> failed: [192.169.233.128] (item=\_users) =\> {"ansible\_loop\_var": "item", "attempts": 1, "cache\_control": "must-revalidate", "changed": false, "connection": "close", "content": "{"error":"unauthorized","reason":"Name or password is incorrect."}\n", "content\_length": "67", "content\_type": "application/json", "date": "Fri, 01 Jul 2022 22:18:42 GMT", "elapsed": 0, "item": "\_users", "json": {"error": "unauthorized", "reason": "Name or password is incorrect."}, "msg": "Status code was 401 and not [201, 412]: HTTP Error 401: Unauthorized", "redirected": false, "server": "CouchDB/2.3.1 (Erlang OTP/19)", "status": 401, "url": "[http://192.169.233.128:15984/\_users](http://192.169.233.128:15984/_users)", "x\_couch\_request\_id": "5fced95eeb", "x\_couchdb\_body\_time": "0"}  
> failed: [192.169.233.128] (item=\_replicator) =\> {"ansible\_loop\_var": "item", "attempts": 1, "cache\_control": "must-revalidate", "changed": false, "connection": "close", "content": "{"error":"unauthorized","reason":"Name or password is incorrect."}\n", "content\_length": "67", "content\_type": "application/json", "date": "Fri, 01 Jul 2022 22:18:42 GMT", "elapsed": 0, "item": "\_replicator", "json": {"error": "unauthorized", "reason": "Name or password is incorrect."}, "msg": "Status code was 401 and not [201, 412]: HTTP Error 401: Unauthorized", "redirected": false, "server": "CouchDB/2.3.1 (Erlang OTP/19)", "status": 401, "url": "[http://192.169.233.128:15984/\_replicator](http://192.169.233.128:15984/_replicator)", "x\_couch\_request\_id": "0ebd25679f", "x\_couchdb\_body\_time": "0"}  
> failed: [192.169.233.128] (item=\_global\_changes) =\> {"ansible\_loop\_var": "item", "attempts": 1, "cache\_control": "must-revalidate", "changed": false, "connection": "close", "content": "{"error":"unauthorized","reason":"Name or password is incorrect."}\n", "content\_length": "67", "content\_type": "application/json", "date": "Fri, 01 Jul 2022 22:18:42 GMT", "elapsed": 0, "item": "\_global\_changes", "json": {"error": "unauthorized", "reason": "Name or password is incorrect."}, "msg": "Status code was 401 and not [201, 412]: HTTP Error 401: Unauthorized", "redirected": false, "server": "CouchDB/2.3.1 (Erlang OTP/19)", "status": 401, "url": "[http://192.169.233.128:15984/\_global\_changes](http://192.169.233.128:15984/_global_changes)", "x\_couch\_request\_id": "122c86bf79", "x\_couchdb\_body\_time": "0"}
> 
> PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> 192.169.233.128 : ok=215 changed=16 unreachable=0 failed=1 skipped=190 rescued=0 ignored=0
> 
> ✗ Apply failed with status code 2

Any clue, what to do next?

---

<div class="post-metadata">

**Author:** ![Sravan\_Reddy](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@Sravan\_Reddy](https://forum.dimagi.com/u/Sravan_Reddy)\
**Post date:** [July 5, 2022, 6:10am UTC](https://forum.dimagi.com/t/quick-monolith-install-problem/9088/10 "2022-07-05T06:10:47Z")

</div>

Hello,

It is possible that the couchdb's credentials got updated to previous username, so the correctly updated username is no longer working.

The underlying bug that caused incorrect usernames is now fixed. You can re-pull the commcare-cloud code and then you could either try uninstalling couchdb and run the above command again or start all over by doing a system reset, if that's an option.

Thanks

---

<div class="post-metadata">

**Author:** ![robynton](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/r/67e7ee/32.png) [@robynton](https://forum.dimagi.com/u/robynton)\
**Post date:** [July 5, 2022, 7:48pm UTC](https://forum.dimagi.com/t/quick-monolith-install-problem/9088/11 "2022-07-05T19:48:45Z")

</div>

Thank you very much for your help! After repository update script had been going well until the subcommand `commcare-cloud $env_name django-manage create_kafka_topics` . So I've got an error about zookeeper service exactly the same as in manual mode installation, described here [After-reboot on a monolith consistently fails on start Zookeeper service - #7 by Sravan\_Reddy](https://forum.dimagi.com/t/after-reboot-on-a-monolith-consistently-fails-on-start-zookeeper-service/9102/7)
