elasticsearch system_error ai_generated partial

TranslogException: failed to sync translog for [my_index][0] - java.nio.file.AccessDeniedException: /data/elasticsearch/nodes/0/indices/.../translog/translog-12345.tlog

ID: elasticsearch/translog-sync-failure

Also available as: JSON · Markdown · 中文
80%Fix Rate
86%Confidence
1Evidence
2025-01-20First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
elasticsearch 7.17.0 active
elasticsearch 8.10.0 active
elasticsearch 8.15.0 active

Root Cause

The Elasticsearch process lacks write permissions to the translog file, often due to filesystem permission changes or disk errors.

generic

中文

Elasticsearch进程缺少对事务日志文件的写入权限,通常由于文件系统权限更改或磁盘错误引起。

Official Documentation

https://www.elastic.co/guide/en/elasticsearch/reference/current/translog.html

Workarounds

  1. 85% success Fix permissions on the translog directory: chown -R elasticsearch:elasticsearch /data/elasticsearch/nodes/0/indices/ and ensure the elasticsearch user has write access.
    Fix permissions on the translog directory: chown -R elasticsearch:elasticsearch /data/elasticsearch/nodes/0/indices/ and ensure the elasticsearch user has write access.
  2. 80% success If disk is full, free up space by removing old indices or increasing disk capacity, then retry sync.
    If disk is full, free up space by removing old indices or increasing disk capacity, then retry sync.
  3. 70% success As a last resort, close and reopen the index to regenerate translog: POST /my_index/_close then POST /my_index/_open. This may drop uncommitted changes.
    As a last resort, close and reopen the index to regenerate translog: POST /my_index/_close then POST /my_index/_open. This may drop uncommitted changes.

中文步骤

  1. 修复事务日志目录的权限:chown -R elasticsearch:elasticsearch /data/elasticsearch/nodes/0/indices/ 并确保elasticsearch用户有写权限。
  2. 如果磁盘满,通过删除旧索引或增加磁盘容量释放空间,然后重试同步。
  3. 作为最后手段,关闭并重新打开索引以重新生成事务日志:POST /my_index/_close 然后 POST /my_index/_open。这可能会丢弃未提交的更改。

Dead Ends

Common approaches that don't work:

  1. 90% fail

    The underlying permissions issue persists; the node will fail again when it tries to sync the translog.

  2. 70% fail

    Deleting translog can cause data loss and corrupt the shard; Elasticsearch may refuse to start.

  3. 50% fail

    The new directory may also have permissions issues if not configured correctly.