{"record":{"id":"8f02d8ebde428fa7","repo":"apache/beam","slug":"offsetretainer-failed-to-save-offset-to-the-offset-will-be","errorCode":null,"errorMessage":"OffsetRetainer: failed to save offset to {}. The offset will be lost if the pipeline restarts.","messagePattern":"OffsetRetainer: failed to save offset to (.+?)\\. The offset will be lost if the pipeline restarts\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/java/io/debezium/src/main/java/org/apache/beam/io/debezium/FileSystemOffsetRetainer.java","lineNumber":159,"sourceCode":"  public void saveOffset(Map<String, Object> offset) {\n    if (offset.equals(lastSavedOffset)) {\n      LOG.debug(\"OffsetRetainer: offset unchanged, skipping write to {}\", path);\n      return;\n    }\n    String tmpPath = path + \".tmp\";\n    try {\n      ResourceId tmpResourceId = FileSystems.matchNewResource(tmpPath, /* isDirectory= */ false);\n      try (WritableByteChannel channel = FileSystems.create(tmpResourceId, \"application/json\");\n          OutputStream stream = Channels.newOutputStream(channel)) {\n        mapper().writeValue(stream, offset);\n      }\n      ResourceId finalResourceId = FileSystems.matchNewResource(path, /* isDirectory= */ false);\n      FileSystems.rename(\n          Collections.singletonList(tmpResourceId), Collections.singletonList(finalResourceId));\n      lastSavedOffset = offset;\n      LOG.debug(\"OffsetRetainer: saved offset to {}: {}\", path, offset);\n    } catch (IOException e) {\n      LOG.warn(\n          \"OffsetRetainer: failed to save offset to {}.\"\n              + \" The offset will be lost if the pipeline restarts.\",\n          path,\n          e);\n    }\n  }\n}\n","sourceCodeStart":141,"sourceCodeEnd":167,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/debezium/src/main/java/org/apache/beam/io/debezium/FileSystemOffsetRetainer.java#L141-L167","documentation":"WARN logged by the Debezium FileSystemOffsetRetainer when atomically persisting the connector offset (write to .tmp then rename) fails. The pipeline deliberately continues running from the in-memory offset, but as the message states, that offset is lost on restart — the connector will resume from the last successfully saved offset and may replay or skip changes accordingly.","triggerScenarios":"Thrown at sdks/java/io/debezium/src/main/java/org/apache/beam/io/debezium/FileSystemOffsetRetainer.java:159 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the underlying I/O error: permissions, disk full, or an unreachable offset-storage path","Ensure the offset directory is writable and durable across pipeline restarts","Verify the last saved offset after fixing storage, since the newest offset may have been lost"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}