{"record":{"id":"4088a3b28fb89678","repo":"apache/seatunnel","slug":"ignored-malformed-cluster-health-metrics-token-s","errorCode":null,"errorMessage":"Ignored malformed cluster health metrics token(s) from member {}, tokens={}, rawPrefix={}","messagePattern":"Ignored malformed cluster health metrics token\\(s\\) from member (.+?), tokens=(.+?), rawPrefix=(.+?)","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":1464,"sourceCode":"            if (equalIndex <= 0) {\n                if (invalidTokens.size() < INVALID_METRICS_LOG_TOKEN_MAX_COUNT) {\n                    invalidTokens.add(truncateForLog(trimmed, INVALID_METRICS_LOG_TOKEN_MAX_LEN));\n                }\n                continue;\n            }\n            String key = trimmed.substring(0, equalIndex).trim();\n            if (key.isEmpty()) {\n                continue;\n            }\n            String value =\n                    equalIndex == trimmed.length() - 1\n                            ? \"\"\n                            : trimmed.substring(equalIndex + 1).trim();\n            jobInfo.add(key, value);\n        }\n\n        if (!invalidTokens.isEmpty() && log.isWarnEnabled() && shouldLogInvalidMetrics()) {\n            log.warn(\n                    \"Ignored malformed cluster health metrics token(s) from member {}, tokens={}, rawPrefix={}\",\n                    memberAddress == null ? \"unknown\" : memberAddress,\n                    invalidTokens,\n                    truncateForLog(input, INVALID_METRICS_LOG_PREFIX_MAX_LEN));\n        }\n\n        return jobInfo;\n    }\n\n    private static boolean shouldLogInvalidMetrics() {\n        long now = System.currentTimeMillis();\n        long last = LAST_INVALID_METRICS_LOG_TIME_MS.get();\n        if (now - last < INVALID_METRICS_LOG_INTERVAL_MS) {\n            return false;\n        }\n        return LAST_INVALID_METRICS_LOG_TIME_MS.compareAndSet(last, now);\n    }\n","sourceCodeStart":1446,"sourceCodeEnd":1482,"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#L1446-L1482","documentation":"BaseService parses cluster health metrics tokens sent by members (key=value pairs). Tokens that cannot be parsed into a valid key/value are collected and this warning is logged per member, listing the bad tokens and a truncated raw prefix. It is a warn-level diagnostic, not a thrown exception: the malformed tokens are skipped and the rest of the metrics are still applied.","triggerScenarios":"A member publishes a cluster health metrics string containing tokens without the expected '=' separator, or with an empty/unparseable value, e.g. custom or version-mismatched member emitting metrics in an unexpected format.","commonSituations":"Mixed-version clusters where an older/newer node emits a metrics token format the current node does not understand; custom monitoring agents injecting extra fields; misconfigured jetty/metrics settings adding non key=value tokens.","solutions":["Identify the offending member via the memberAddress in the log and check its SeaTunnel version; upgrade/downgrade so all nodes run a compatible version.","Inspect rawPrefix in the log to see the malformed token text and fix whatever emits it (custom agent, wrapper script, extra JVM metrics flags).","Verify the member's log/metrics configuration matches the documented format (key=value tokens separated consistently).","If the tokens are known-harmless noise, suppress the repeated warns by adjusting logging levels for BaseService."],"exampleFix":"// before (member emits malformed token)\n// metrics string: \"threadCount=42 garbageToken\"\n// after: fix the producer so every token is key=value\n// metrics string: \"threadCount=42 heapUsed=1048576\"","handlingStrategy":"validation","validationCode":"// before sending/parsing metrics tokens\n// for (String token : metricsString.split(\",\")) {\n//     if (!token.contains(\"=\") || token.split(\"=\", 2)[0].trim().isEmpty()) {\n//         log.warn(\"Skipping malformed metrics token: {}\", token);\n//         continue;\n//     }\n// }","typeGuard":"boolean isValidMetricsToken(String token) {\n    return token != null && token.contains(\"=\") && !token.split(\"=\", 2)[0].trim().isEmpty();\n}","tryCatchPattern":null,"preventionTips":["Keep all cluster members on the same SeaTunnel version","Only emit key=value formatted metrics tokens","Test custom metric producers against BaseService parsing before deploying"],"tags":["logging","rest-api","cluster-metrics","malformed-input"],"backgroundTag":"invalid-argument-format","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}