Error when running "commcare-cloud monolith django-manage preindex_everything"

I am running into this error when running this command "commcare-cloud monolith django-manage preindex_everything"

Please assist ref attachments

Hi Fredrick,

It looks like the fix I offered in ElasticSearch installation error interacted poorly with some common environment settings; my guess from this message is that the issue you're facing is that Elasticsearch did not start up properly. You can check this by running commcare-cloud <env> django-manage check_services; I expect you'll see an error for Elasticsearch there.

We have applied another fix, so I believe if you pull the latest and run

commcare-cloud <env> deploy-stack --limit elasticsearch --tags=es_conf

you'll see an update to the elasticsearch configuration file. You should then be able to start elasticsearch and check that it came up properly, using something like commcare-cloud <env> service elasticsearch restart followed by the check_services command above again.

Once that's in order, I expect you'll be able to run this command again without this same error.


Hello Danny,

Thank you very much for the assistance. I was able to run the commands but when I restart elasticsearch using the command provided the attached error comes up and when I check services, elasticsearch still has an error please ref attached.

Looking forward to your assistance.


The error you're seeing there (master_not_discovered_exception) is what I would expect if the latest change had not been applied. Can you confirm you pulled the latest version of commcare-cloud (update-code) and ran commcare-cloud <env> deploy-stack --limit elasticsearch --tags=es_conf? Did it update the elasticsearch configuration file? I would expect it to update the property called discovery.zen.minimum_master_nodes to 0 like so:

discovery.zen.minimum_master_nodes: 0

Only after that would I expect restarting elasticsearch to help.

I hope this helps.


Hello Danny,

I ran the commands as you advise and the property reflects as you have indicated but still elasticsearch is not starting up. Please find attached screenshots for your reference.

Looking forward to your further advice.


From the error message it seems that elasticsearch is up now, but just doesn't have all the indices set up. I would suggest now resuming where you first encountered the error at the top of this thread.

Thank you Danny,

I have passed this point now continuing with the setup.

Fredrick :slight_smile:

1 Like