apache/seatunnel · warning
Metric array size mismatch for table
Error message
Metric array size mismatch for table '{}': expected {} vertices {} but got {} metric entries. Some vertices may not be reporting metrics yet. What it means
For array-valued per-table metrics, the array length should match the number of configured vertices (each element belongs to one vertex). When arraySize is greater than 0 but less than vertexIdentifiers.size(), processMetric() logs this warning that some vertices appear not to be reporting, and processes only the entries present (positionally).
Solutions
- Re-poll metrics after all subtasks are running; arrays typically fill in once every vertex reports.
- Check for failed/killed subtasks and fix the underlying task failure.
- Verify job parallelism hasn't changed since the metrics were written (job restart with different parallelism).
- If a vertex legitimately reports nothing (e.g. empty source splits), treat the warning as benign.
Defensive patterns
Strategy: retry
Validate before calling
// check array completeness before positional attribution
if (metricNode.isArray() && metricNode.size() < vertexIdentifiers.size()) {
// defer or re-poll; do not attribute positionally yet
} Prevention
- Poll metrics after all subtasks report at least once
- Detect failed subtasks early — missing array elements often mean dead vertices
- Keep parallelism stable for the job's lifetime
- Retry metric reads with backoff during job startup
When it happens
Trigger: Metric JSON array for a table has fewer elements than configured vertex identifiers — some parallel instances returned no metrics, or the array was truncated.
Common situations: Metrics polled during partial vertex startup; subtasks failed before reporting; parallelism changed between metric-write and read (stale configuration).
Related errors
- Metric array size mismatch for table
- Cannot reliably determine vertex assignment for table
- Failed to load finished job metrics for job
- Found unassigned metric entries for table ' ' metric ' '…
- Some vertices may not be reporting metrics yet for table
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/8f658d22f71c3f3f.
Report an issue: GitHub.
Appendix: source
Thrown at seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/service/BaseService.java:907
// Fallback for legacy/simplified metric nodes without tags (mainly in tests or older
// outputs).
int arraySize = metricNode.size();
if (vertexIdentifiers.size() > 1) {
if (arraySize == vertexIdentifiers.size()) {
for (int i = 0; i < arraySize; i++) {
String identifier = vertexIdentifiers.get(i);
String metricKey = identifier + "." + tableName;
JsonNode element = metricNode.get(i);
if (element != null && element.isArray()) {
putMetricToMap(metricName, metricKey, element, tableMetricsMaps);
} else {
ArrayNode wrapped = mapper.createArrayNode();
wrapped.add(element);
putMetricToMap(metricName, metricKey, wrapped, tableMetricsMaps);
}
}
} else if (arraySize > 0 && arraySize < vertexIdentifiers.size()) {
log.warn(
"Metric array size mismatch for table '{}': expected {} vertices {} but got {} metric entries. Some vertices may not be reporting metrics yet.",
tableName,
vertexIdentifiers.size(),
vertexIdentifiers,
arraySize);
for (int i = 0; i < arraySize; i++) {
String identifier = vertexIdentifiers.get(i);
String metricKey = identifier + "." + tableName;
JsonNode element = metricNode.get(i);
if (element != null && element.isArray()) {
putMetricToMap(metricName, metricKey, element, tableMetricsMaps);
} else {
ArrayNode wrapped = mapper.createArrayNode();
wrapped.add(element);
putMetricToMap(metricName, metricKey, wrapped, tableMetricsMaps);
}
}
} else if (arraySize > vertexIdentifiers.size()) {View on GitHub (pinned to cf67b549a7)