Elasticsearch org.elasticsearch.index.engine.EngineException"failed to recover translog"

Hi guys, I'm an intern at my software engineering company adding a health endpoint (using Spring Actuator) to our API for our Elasticsearch service.

I am using POSTMAN to view the JSON response and it's sending it correctly, but listing Elasticsearch as "OUT_OF_SERVICE":

Upon further inspection, I found when I boot up ./elasticsearch from local on the terminal (Mac) , it is throwing some errors for "failed to recover translog" , which another developer indicted to me might be the issue. It's a pretty big log. Is there a way to upload or copy and paste it here to get some help?

I would like to avoid having to reinstall Elasticsearch if its a minor fix.

Anyhelp would be greatly appreciated

Here is just some of the output , but I can copy and paste the entire thing if need be:

Also, after some googling , I managed to find other people with similar issues (corrupted trans logs?) and found this link on one of the threads:

However , when running the command :
$bin/elasticsearch-translog -d /var/lib/elasticsearchdata/nodes/

.. I get this output in terminal:
ERROR StatusLogger No Log4j 2 configuration file found. Using default configuration (logging only errors to the console), or user programmatically provided configurations. Set system property 'log4j2.debug' to show Log4j 2 internal initialization logging. See https://logging.apache.org/log4j/2.x/manual/configuration.html for instructions on how to configure Log4j 2

A CLI tool for various Elasticsearch translog actions

    truncate - Removes corrupted shard files

    Non-option arguments:

    Option         Description        
    ------         -----------        
    -h, --help     show help          
    -s, --silent   show minimal output
    -v, --verbose  show verbose output
    ERROR: d is not a recognized option

OK, I ran the command again and changed the directory but now getting an exception:
$ bin/elasticsearch-translog -d ~/documents/elasticsearch-6.7.0/data/nodes/

Exception that outputs after running the truncate translog tool:

Exception in thread "main" ElasticsearchException[index directory [/Users/Pizano_Alberto/documents/elasticsearch-6.7.0/data/index], must exist and be a directory]
    	at org.elasticsearch.index.shard.RemoveCorruptedShardDataCommand.findAndProcessShardPath(RemoveCorruptedShardDataCommand.java:147)
    	at org.elasticsearch.index.shard.RemoveCorruptedShardDataCommand.execute(RemoveCorruptedShardDataCommand.java:297)
    	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
    	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
    	at org.elasticsearch.cli.MultiCommand.execute(MultiCommand.java:77)
    	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
    	at org.elasticsearch.cli.Command.main(Command.java:90)
    	at org.elasticsearch.index.translog.TranslogToolCli.main(TranslogToolCli.java:39)

Nevermind, just uninstalled and its working now.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.