apache/seatunnel · error · AerospikeConnectorException
WRITER_OPERATION_FAILED
WRITER_OPERATION_FAILED
Error message
Failed to write record
What it means
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.
Source
Thrown at seatunnel-connectors-v2/connector-aerospike/src/main/java/org/apache/seatunnel/connectors/seatunnel/aerospike/sink/AerospikeSinkWriter.java:144
JSON.parseObject(data, new TypeReference<Map<String, Object>>() {});
List<Bin> bins = new ArrayList<>();
Map<String, String> configFieldTypes =
config.get(AerospikeSinkOptions.FIELD_TYPES);
for (String fieldName : configFieldTypes.keySet()) {
Object value = fieldsMap.get(fieldName);
AerospikeDataType dataType = typeConverter.getFieldType(fieldName);
Object convertedValue = convertValue(value, dataType);
bins.add(new Bin(fieldName, convertedValue));
}
aerospikeClient.put(writePolicy, aerospikeKey, bins.toArray(new Bin[0]));
break;
default:
throw new IllegalArgumentException(
"Unsupported data format type: " + formatType);
}
} catch (Exception e) {
throw new AerospikeConnectorException(
AerospikeErrorCode.WRITER_OPERATION_FAILED, "Failed to write record", e);
}
}
@Override
public void close() throws IOException {
try {
if (Objects.nonNull(aerospikeClient)) {
aerospikeClient.close();
}
} catch (Exception e) {
throw new AerospikeConnectorException(
AerospikeErrorCode.WRITER_CLOSE_FAILED, "Failed to close writer", e);
}
}
private AerospikeClient buildClient() {
ClientPolicy clientPolicy = new ClientPolicy();View on GitHub (pinned to cf67b549a7)
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
Defensive patterns
Strategy: try-catch
Validate before calling
// preflight: cluster reachable? aerospikeClient.get(writePolicy, key) ; // throws if cluster unreachable // validate fields/bins match schema before writing
Try / catch
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 */ } } Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Unsupported data format type:
- WRITER_CLOSE_FAILED
- Expected Array type but got:
- Expected List type but got:
- WRITE_FAILED
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/8920d1c295fe3231.
Report an issue: GitHub.