{"record":{"id":"8920d1c295fe3231","repo":"apache/seatunnel","slug":"writer-operation-failed","errorCode":"WRITER_OPERATION_FAILED","errorMessage":"Failed to write record","messagePattern":"Failed to write record","errorType":"error_code","errorClass":"AerospikeConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-aerospike/src/main/java/org/apache/seatunnel/connectors/seatunnel/aerospike/sink/AerospikeSinkWriter.java","lineNumber":144,"sourceCode":"                            JSON.parseObject(data, new TypeReference<Map<String, Object>>() {});\n                    List<Bin> bins = new ArrayList<>();\n                    Map<String, String> configFieldTypes =\n                            config.get(AerospikeSinkOptions.FIELD_TYPES);\n                    for (String fieldName : configFieldTypes.keySet()) {\n                        Object value = fieldsMap.get(fieldName);\n                        AerospikeDataType dataType = typeConverter.getFieldType(fieldName);\n                        Object convertedValue = convertValue(value, dataType);\n                        bins.add(new Bin(fieldName, convertedValue));\n                    }\n                    aerospikeClient.put(writePolicy, aerospikeKey, bins.toArray(new Bin[0]));\n                    break;\n\n                default:\n                    throw new IllegalArgumentException(\n                            \"Unsupported data format type: \" + formatType);\n            }\n        } catch (Exception e) {\n            throw new AerospikeConnectorException(\n                    AerospikeErrorCode.WRITER_OPERATION_FAILED, \"Failed to write record\", e);\n        }\n    }\n\n    @Override\n    public void close() throws IOException {\n        try {\n            if (Objects.nonNull(aerospikeClient)) {\n                aerospikeClient.close();\n            }\n        } catch (Exception e) {\n            throw new AerospikeConnectorException(\n                    AerospikeErrorCode.WRITER_CLOSE_FAILED, \"Failed to close writer\", e);\n        }\n    }\n\n    private AerospikeClient buildClient() {\n        ClientPolicy clientPolicy = new ClientPolicy();","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-aerospike/src/main/java/org/apache/seatunnel/connectors/seatunnel/aerospike/sink/AerospikeSinkWriter.java#L126-L162","documentation":"AerospikeSinkWriter.write wraps any exception raised while putting a record into Aerospike — client.put failures, key/bin conversion errors (including the internal IllegalArgumentException for unsupported formats/types) — into AerospikeConnectorException WRITER_OPERATION_FAILED with message 'Failed to write record'. It is the generic write-path failure for the aerospike sink.","triggerScenarios":"Any Exception during write(): aerospikeClient.put fails (timeout, key existence with write policy, cluster down), record field conversion fails, or an unsupported formatType/dataType triggers an internal IllegalArgumentException that is then wrapped.","commonSituations":"Aerospike cluster unreachable or timing out; write policy conflicts (e.g. generation checks); malformed record fields that convertValue rejects; unsupported format config reaching the default branch.","solutions":["Inspect the wrapped cause 'e' to distinguish I/O (put failure) from data conversion problems","Verify Aerospike cluster connectivity, timeouts and ClientPolicy settings","Check the record schema/fields against the configured bins and format","Fix format/dataType config if the cause is IllegalArgumentException"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// preflight: cluster reachable?\naerospikeClient.get(writePolicy, key) ; // throws if cluster unreachable\n// validate fields/bins match schema before writing","typeGuard":null,"tryCatchPattern":"try { writer.write(row); } catch (AerospikeConnectorException e) { if (e.getErrorCode() == AerospikeErrorCode.WRITER_OPERATION_FAILED) { log.error(\"write failed: {}\", e.getCause()); /* inspect cause: IO vs conversion */ } }","preventionTips":["Verify Aerospike cluster connectivity and timeouts before job start","Align record schema with configured bins and data types","Review write policy settings (retries, timeouts, generation checks)","Check the wrapped cause to distinguish I/O from conversion errors"],"tags":["aerospike","sink","write","io"],"backgroundTag":"database-write-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}