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

  1. Re-poll metrics after all subtasks are running; arrays typically fill in once every vertex reports.
  2. Check for failed/killed subtasks and fix the underlying task failure.
  3. Verify job parallelism hasn't changed since the metrics were written (job restart with different parallelism).
  4. 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

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


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)