{"record":{"id":"a670de58ec4c39ce","repo":"apache/seatunnel","slug":"failed-to-persist-failure-sample-to-disablin","errorCode":null,"errorMessage":"Failed to persist failure sample to '{}'; disabling failure-data persistence. cause={}","messagePattern":"Failed to persist failure sample to '(.+?)'; disabling failure-data persistence\\. cause=(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-hugegraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/hugegraph/buffer/BatchBuffer.java","lineNumber":367,"sourceCode":"                if (!dir.exists() && !dir.mkdirs() && !dir.exists()) {\n                    throw new IOException(\"Failed to create failure data directory: \" + dir);\n                }\n                File file =\n                        new File(dir, \"hugegraph-sink-failures-subtask-\" + subtaskIndex + \".log\");\n                failureWriter =\n                        new BufferedWriter(\n                                new OutputStreamWriter(\n                                        new FileOutputStream(file, true), StandardCharsets.UTF_8));\n                LOG.info(\"Persisting skipped-record failure samples to {}\", file.getAbsolutePath());\n            }\n            failureWriter.write(formatFailureSample(envelope, failure));\n            failureWriter.newLine();\n            // Flush per record: failures are rare and losing samples on an abrupt crash defeats\n            // their purpose.\n            failureWriter.flush();\n        } catch (IOException e) {\n            failureWriterDisabled = true;\n            LOG.warn(\n                    \"Failed to persist failure sample to '{}'; disabling failure-data persistence. cause={}\",\n                    failureDataPath,\n                    e.getMessage());\n        }\n    }\n\n    /**\n     * One-line, tab-delimited failure sample. Newlines are stripped to keep one record per line.\n     */\n    static String formatFailureSample(GraphElementEnvelope envelope, Exception failure) {\n        GraphElement element = envelope.getElement();\n        String line =\n                String.format(\n                        \"mapping=%s\\ttype=%s\\tid=%s\\tlabel=%s\\tproperties=%s\\terror=%s\",\n                        envelope.getMappingLabel(),\n                        envelope.getElementType(),\n                        element == null ? null : element.id(),\n                        element == null ? null : element.label(),","sourceCodeStart":349,"sourceCodeEnd":385,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hugegraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/hugegraph/buffer/BatchBuffer.java#L349-L385","documentation":"Logged by BatchBuffer.writeFailureSample when persisting a failed-record sample to the configured failure-data file throws an IOException. The writer is permanently disabled (failureWriterDisabled = true) for the rest of the task, and only the exception message is logged as WARN. Future failed records will still be skipped but no longer saved to disk.","triggerScenarios":"Writing/flushing a failure record to failureDataPath fails: the parent directory does not exist or is not writable, the disk is full, the path is invalid, or the file handle was closed/deleted while the job runs. Called from fallbackInsertSingly after record failures.","commonSituations":"Misconfigured failure-data path (read-only mount, container without write permission to the configured directory), disk-full on worker nodes, or the output directory being cleaned up by an external process during a long-running job.","solutions":["Verify the failureDataPath directory exists and is writable by the SeaTunnel worker process user","Check disk space on the worker node (df -h) and free space if full","Correct the failure-data path in the sink configuration to a valid, writable location","Restart the job after fixing the path; the writer stays disabled until the task is recreated"],"exampleFix":"// before\n\"failure-data-path\" = \"/read-only-mount/failures.log\"\n// after\n\"failure-data-path\" = \"/tmp/seatunnel/failures.log\"  // writable directory, pre-created\n// mkdir -p /tmp/seatunnel && chmod u+w /tmp/seatunnel","handlingStrategy":"validation","validationCode":"// Before submitting the job\nPath dir = Paths.get(failureDataPath).getParent();\nif (!Files.isDirectory(dir) || !Files.isWritable(dir)) {\n    throw new IllegalStateException(\"failure-data path not writable: \" + dir);\n}\nif (dir.toFile().getUsableSpace() < minRequiredBytes) {\n    throw new IllegalStateException(\"insufficient disk space for failure samples\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Point failureDataPath at a writable local directory on every worker","Pre-create the directory in deployment scripts (mkdir -p with correct ownership)","Monitor worker disk usage; keep headroom for failure samples","Avoid read-only container filesystems or read-only NFS mounts for this path"],"tags":["hugegraph","io","file-write","dirty-data"],"backgroundTag":"file-write-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}