{"record":{"id":"8f658d22f71c3f3f","repo":"apache/seatunnel","slug":"metric-array-size-mismatch-for-table-expecte","errorCode":null,"errorMessage":"Metric array size mismatch for table '{}': expected {} vertices {} but got {} metric entries. Some vertices may not be reporting metrics yet.","messagePattern":"Metric array size mismatch for table '(.+?)': expected (.+?) vertices (.+?) but got (.+?) metric entries\\. Some vertices may not be reporting metrics yet\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/service/BaseService.java","lineNumber":907,"sourceCode":"        // Fallback for legacy/simplified metric nodes without tags (mainly in tests or older\n        // outputs).\n        int arraySize = metricNode.size();\n        if (vertexIdentifiers.size() > 1) {\n            if (arraySize == vertexIdentifiers.size()) {\n                for (int i = 0; i < arraySize; i++) {\n                    String identifier = vertexIdentifiers.get(i);\n                    String metricKey = identifier + \".\" + tableName;\n                    JsonNode element = metricNode.get(i);\n                    if (element != null && element.isArray()) {\n                        putMetricToMap(metricName, metricKey, element, tableMetricsMaps);\n                    } else {\n                        ArrayNode wrapped = mapper.createArrayNode();\n                        wrapped.add(element);\n                        putMetricToMap(metricName, metricKey, wrapped, tableMetricsMaps);\n                    }\n                }\n            } else if (arraySize > 0 && arraySize < vertexIdentifiers.size()) {\n                log.warn(\n                        \"Metric array size mismatch for table '{}': expected {} vertices {} but got {} metric entries. Some vertices may not be reporting metrics yet.\",\n                        tableName,\n                        vertexIdentifiers.size(),\n                        vertexIdentifiers,\n                        arraySize);\n                for (int i = 0; i < arraySize; i++) {\n                    String identifier = vertexIdentifiers.get(i);\n                    String metricKey = identifier + \".\" + tableName;\n                    JsonNode element = metricNode.get(i);\n                    if (element != null && element.isArray()) {\n                        putMetricToMap(metricName, metricKey, element, tableMetricsMaps);\n                    } else {\n                        ArrayNode wrapped = mapper.createArrayNode();\n                        wrapped.add(element);\n                        putMetricToMap(metricName, metricKey, wrapped, tableMetricsMaps);\n                    }\n                }\n            } else if (arraySize > vertexIdentifiers.size()) {","sourceCodeStart":889,"sourceCodeEnd":925,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/service/BaseService.java#L889-L925","documentation":"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).","triggerScenarios":"Metric JSON array for a table has fewer elements than configured vertex identifiers — some parallel instances returned no metrics, or the array was truncated.","commonSituations":"Metrics polled during partial vertex startup; subtasks failed before reporting; parallelism changed between metric-write and read (stale configuration).","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."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// check array completeness before positional attribution\nif (metricNode.isArray() && metricNode.size() < vertexIdentifiers.size()) {\n    // defer or re-poll; do not attribute positionally yet\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["metrics","rest-api","array-length"],"backgroundTag":"shape-mismatch","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}