This question is in reference to Atlassian Documentation: Troubleshooting Connection Issues for Elasticsearch
Although this appears to be the issue we are having, the solution does not resolve our issue.
We followed the resolution outlined above but are still getting 401 errors and the username and password fields are empty in the admin UI, although the elasticserarch home URL is there.
There are no relevant entries in the bitbucket.properties file.
As part of the attempt to ensure things were starting correctly I changed from SysV init scripts to systemd. systemctl status bitbucket shows both processes started.
Our environment is Ubuntu 16.04LTS and Bitbucket 4.8.2