{"record":{"id":"79cdc1f5591f0b6d","repo":"apache/pulsar","slug":"failed-to-parse-config-file-s-invalid-field-s","errorCode":null,"errorMessage":"Failed to parse config file %s. Invalid field '%s' on line: %d column: %d. Valid fields are %s","messagePattern":"Failed to parse config file (.+?)\\. Invalid field '(.+?)' on line: (.+?) column: (.+?)\\. Valid fields are (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/utils/CmdUtils.java","lineNumber":42,"sourceCode":"import java.io.IOException;\nimport org.apache.pulsar.common.util.ObjectMapperFactory;\n\npublic class CmdUtils {\n    public static <T> T loadConfig(String file, Class<T> clazz) throws IOException {\n        try {\n            return ObjectMapperFactory.getYamlMapper().reader().readValue(new File(file), clazz);\n        } catch (Exception ex) {\n            if (ex instanceof UnrecognizedPropertyException) {\n                UnrecognizedPropertyException unrecognizedPropertyException = (UnrecognizedPropertyException) ex;\n\n                String exceptionMessage = String.format(\"Failed to parse config file %s. \"\n                                + \"Invalid field '%s' on line: %d column: %d. Valid fields are %s\",\n                        file,\n                        unrecognizedPropertyException.getPath().get(0).getFieldName(),\n                        unrecognizedPropertyException.getLocation().getLineNr(),\n                        unrecognizedPropertyException.getLocation().getColumnNr(),\n                        unrecognizedPropertyException.getKnownPropertyIds());\n                throw new IllegalArgumentException(exceptionMessage);\n            } else if (ex instanceof InvalidFormatException) {\n\n                InvalidFormatException invalidFormatException = (InvalidFormatException) ex;\n                String exceptionMessage = String.format(\"Failed to parse config file %s. %s on line: %d column: %d\",\n                        file,\n                        invalidFormatException.getOriginalMessage(),\n                        invalidFormatException.getLocation().getLineNr(),\n                        invalidFormatException.getLocation().getColumnNr());\n\n                throw new IllegalArgumentException(exceptionMessage);\n            } else {\n                throw new IllegalArgumentException(ex.getMessage());\n            }\n        }\n    }\n\n    public static boolean positiveCheck(String paramName, long value) {\n        if (value <= 0) {","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/utils/CmdUtils.java#L24-L60","documentation":"CmdUtils.loadConfig hit a Jackson UnrecognizedPropertyException: the YAML config file contains a field name that is not a valid property of the target config class, with line/column and the valid field list included.","triggerScenarios":"Thrown at pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/utils/CmdUtils.java:42 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove or correct the invalid field in the config file","Upgrade the CLI if the field belongs to a newer config version"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}