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

**URL:** <https://discuss.elastic.co/t/elasticsearch-org-elasticsearch-index-engine-engineexception-failed-to-recover-translog/209714>\
**Category:** Elasticsearch\
**Created:** [November 27, 2019, 3:12pm UTC](https://discuss.elastic.co/t/elasticsearch-org-elasticsearch-index-engine-engineexception-failed-to-recover-translog/209714 "2019-11-27T15:12:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![apizano](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@apizano](https://discuss.elastic.co/u/apizano)\
**Post date:** [November 27, 2019, 3:12pm UTC](https://discuss.elastic.co/t/elasticsearch-org-elasticsearch-index-engine-engineexception-failed-to-recover-translog/209714/1 "2019-11-27T15:12:07Z")

</div>

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":  
 ![38%20AM](https://us1.discourse-cdn.com/elastic/original/3X/3/4/347e3ecac543d77f50854c40b1ef89161416569d.png)

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

---

<div class="post-metadata">

**Author:** ![apizano](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@apizano](https://discuss.elastic.co/u/apizano)\
**Post date:** [November 27, 2019, 3:21pm UTC](https://discuss.elastic.co/t/elasticsearch-org-elasticsearch-index-engine-engineexception-failed-to-recover-translog/209714/2 "2019-11-27T15:21:04Z")

</div>

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

 ![29%20AM](https://us1.discourse-cdn.com/elastic/original/3X/4/9/492e26c6b8b722f71ba508648bf66208630a9012.png)

---

<div class="post-metadata">

**Author:** ![apizano](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@apizano](https://discuss.elastic.co/u/apizano)\
**Post date:** [November 27, 2019, 4:34pm UTC](https://discuss.elastic.co/t/elasticsearch-org-elasticsearch-index-engine-engineexception-failed-to-recover-translog/209714/3 "2019-11-27T16:34:53Z")

</div>

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:  
[https://www.elastic.co/guide/en/elasticsearch/reference/6.3/index-modules-translog.html#corrupt-translog-truncation](https://www.elastic.co/guide/en/elasticsearch/reference/6.3/index-modules-translog.html#corrupt-translog-truncation)

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`

```
    Commands
    --------
    truncate - Removes corrupted shard files

    Non-option arguments:
    command              

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

---

<div class="post-metadata">

**Author:** ![apizano](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@apizano](https://discuss.elastic.co/u/apizano)\
**Post date:** [November 27, 2019, 4:42pm UTC](https://discuss.elastic.co/t/elasticsearch-org-elasticsearch-index-engine-engineexception-failed-to-recover-translog/209714/4 "2019-11-27T16:42:00Z")

</div>

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)
```

---

<div class="post-metadata">

**Author:** ![apizano](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@apizano](https://discuss.elastic.co/u/apizano)\
**Post date:** [November 27, 2019, 5:58pm UTC](https://discuss.elastic.co/t/elasticsearch-org-elasticsearch-index-engine-engineexception-failed-to-recover-translog/209714/5 "2019-11-27T17:58:12Z")

</div>

Nevermind, just uninstalled and its working now.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 25, 2019, 5:58pm UTC](https://discuss.elastic.co/t/elasticsearch-org-elasticsearch-index-engine-engineexception-failed-to-recover-translog/209714/6 "2019-12-25T17:58:16Z")

</div>

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