{"record":{"id":"4c07606233fd576a","repo":"apache/seatunnel","slug":"writer-operation-failed-4c0760","errorCode":"WRITER_OPERATION_FAILED","errorMessage":"Get parquet writer for file [%s] error","messagePattern":"Get parquet writer for file \\[(.+?)\\] error","errorType":"error_code","errorClass":"FileConnectorException","httpStatus":null,"severity":"critical","filePath":"seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sink/writer/ParquetWriteStrategy.java","lineNumber":222,"sourceCode":"                            ParquetWriter<GenericRecord> newWriter =\n                                    AvroParquetWriter.<GenericRecord>builder(outputFile)\n                                            .withWriteMode(ParquetFileWriter.Mode.OVERWRITE)\n                                            .withDataModel(dataModel)\n                                            .withConf(configuration)\n                                            // use parquet v1 to improve compatibility\n                                            .withWriterVersion(\n                                                    ParquetProperties.WriterVersion.PARQUET_1_0)\n                                            .withCompressionCodec(\n                                                    compressFormat.getParquetCompression())\n                                            .withSchema(schema)\n                                            .build();\n                            this.beingWrittenWriter.put(filePath, newWriter);\n                            return newWriter;\n                        } catch (IOException e) {\n                            String errorMsg =\n                                    String.format(\n                                            \"Get parquet writer for file [%s] error\", filePath);\n                            throw new FileConnectorException(\n                                    CommonErrorCodeDeprecated.WRITER_OPERATION_FAILED, errorMsg, e);\n                        }\n                    });\n        }\n        return writer;\n    }\n\n    private Object resolveObject(String name, Object data, SeaTunnelDataType<?> seaTunnelDataType) {\n        if (data == null) {\n            return null;\n        }\n        switch (seaTunnelDataType.getSqlType()) {\n            case ARRAY:\n                SeaTunnelDataType<?> elementType =\n                        ((ArrayType<?, ?>) seaTunnelDataType).getElementType();\n                ArrayList<Object> records = new ArrayList<>(((Object[]) data).length);\n                for (Object object : (Object[]) data) {\n                    Object resolvedObject = resolveObject(name, object, elementType);","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sink/writer/ParquetWriteStrategy.java#L204-L240","documentation":"ParquetWriteStrategy.getOrCreateOutputStream creates/obtains a ParquetWriter for the target file. When constructing the writer throws IOException (disk full, missing parent directory, permission problem, bad HDFS path), it is wrapped as FileConnectorException with WRITER_OPERATION_FAILED and a message naming the file. It indicates the sink could not open a Parquet writer, not a data-format problem.","triggerScenarios":"Calling writer() on the Parquet write strategy when a new output file must be rolled (file size threshold, checkpoint rollover) and the underlying filesystem fails to create the file or the writer.","commonSituations":"Disk full on local FS/HDFS; target directory deleted or not writable; HDFS name-node unavailable or in safe mode; incorrect path (permission denied, quota exceeded); transient network errors to remote storage.","solutions":["Check the wrapped cause (e) for the root IOException — permission, space, or connectivity","Verify the sink path exists and the running user has write permission to the target directory","Check disk space / HDFS quota on the worker nodes","Confirm HDFS/S3 connectivity from all worker nodes and retry the job after fixing storage"],"exampleFix":"# before (typical failure)\nsink.path = hdfs://nn/data/out  # dir not writable\n# after\nhdfs dfs -chmod -R 775 /data/out   # or fix the configured path/credentials","handlingStrategy":"try-catch","validationCode":"Files dirs = new Files(Paths.get(path)); if (!dirs.exists() || !dirs.canWrite()) { fail fast before job submit }","typeGuard":null,"tryCatchPattern":"try { sinkWriter.write(row); } catch (FileConnectorException e) { if (e.getErrorCode() == WRITER_OPERATION_FAILED) { log(e.getCause()); /* check storage, then retry job */ } }","preventionTips":["Pre-create sink directories with correct permissions before submitting jobs","Monitor disk space/HDFS quota on worker nodes","Test storage connectivity from all worker nodes before production runs"],"tags":["parquet","io","file-sink","writer"],"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"}