restarting elasticsearch running without completing

Skip to first unread message

Lewatle Johannes Phaladi

Oct 24, 2022, 6:01:08 AM10/24/22
to AtoM Users

I am restarting elasticsearch  on ubuntu 16.04, the command run forever "$ sudo systemctl restart elasticsearch" : see results on web browser : 

elastic connection exception.png


Dan Gillean

Oct 24, 2022, 8:37:10 AM10/24/22
Hi Lewatle, 

What version of AtoM are you using? Does it use all the recommended dependencies as outlined in the installation instructions for that version, or have you made changes? If you've made changes, please tell us more about them. 

Elasticsearch exceptions and reserved characters

Were you attempting a search when you originally saw this message in the user interface? If so, what? In most cases, when I see an Elasticsearch exception error message in the UI, it is because a search has been attempted with one of ES's reserved characters - one of the special characters used as an operator in ES. See:
Here is the important part of that documentation: 

Reserved characters

If you need to use any of the characters which function as operators in your query itself (and not as operators), then you should escape them with a leading backslash. For instance, to search for (1+1)=2, you would need to write your query as \(1\+1\)\=2.

The reserved characters are: + - = && || > < ! ( ) { } [ ] ^ " ~ * ? : \ /

Failing to escape these special characters correctly could lead to a syntax error which prevents your query from running.

< and > can’t be escaped at all. The only way to prevent them from attempting to create a range query is to remove them from the query string entirely.

If you would like to know more about what most of these special characters are reserved for - it's that they act as special search operators. See:
While the forward slash is not a boolean operator, it is apparently reserved by Elasticsearach for constructing regular expressions.

One simple solution is to search for the phrase exactly - i.e. in quotations. Wood/tree may produce an error, but "Wood/tree" should not. Additionally, there is a setting that can also help to resolve this. See:
Please read the section carefully, including the part in the IMPORTANT admonition, to get a full picture of how this setting works, and its gotchas.

Logs and manual stop / start commands

Is there any further information in the webserver error logs? See: 
Please share anything relevant you find there. If there is nothing relevant, we could perhaps also check the Elasticsearch logs, which are typically found at: 
  • /var/log/elasticsearch/elasticsearch.log
Again, please share anything relevant you find. 

Let's try stopping the ES service first, and then stopping it. Let's also be explicit about our user - in AtoM during installation, we assign all permissions to the www-data user, so let's make sure we run all AtoM / Symfony commands as the www-data user. 
  • sudo systemctl stop elasticsearch
  • sudo systemctl start elasticsearch
  • sudo -u www-data php symfony search:status
Let us know what happens when you try the above. If the search:status command successfully runs, please share the output here. 

Manually deleting the index

Finally, we could try manually deleting the search index before stopping and starting the service, to see if we can rebuild it. Assuming your search index name during installation was set to atom, the following should delete the index: 
  • curl -XDELETE 'localhost:9200/atom'
Hopefully this will allow you to properly start or restart the service without exceptions, so you can run the search:populate command again. 

Let us know how it goes!


Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
he / him

You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages