apache/pulsar · error · IllegalArgumentException

Failed to parse config file %s. %s on line: %d column: %d

Error message

Failed to parse config file %s. %s on line: %d column: %d

What it means

YAML config-parse failure reported by CmdUtils.loadConfig: Jackson threw a general mapping error while reading the client config file (the excerpt covers the non-UnrecognizedProperty, non-InvalidFormat branches), and the file path plus line/column of the offending node are embedded in the rethrown IllegalArgumentException; the config file's malformed section is the faulty input.

Source

Thrown at pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/utils/CmdUtils.java:52

                String exceptionMessage = String.format("Failed to parse config file %s. "
                                + "Invalid field '%s' on line: %d column: %d. Valid fields are %s",
                        file,
                        unrecognizedPropertyException.getPath().get(0).getFieldName(),
                        unrecognizedPropertyException.getLocation().getLineNr(),
                        unrecognizedPropertyException.getLocation().getColumnNr(),
                        unrecognizedPropertyException.getKnownPropertyIds());
                throw new IllegalArgumentException(exceptionMessage);
            } else if (ex instanceof InvalidFormatException) {

                InvalidFormatException invalidFormatException = (InvalidFormatException) ex;
                String exceptionMessage = String.format("Failed to parse config file %s. %s on line: %d column: %d",
                        file,
                        invalidFormatException.getOriginalMessage(),
                        invalidFormatException.getLocation().getLineNr(),
                        invalidFormatException.getLocation().getColumnNr());

                throw new IllegalArgumentException(exceptionMessage);
            } else {
                throw new IllegalArgumentException(ex.getMessage());
            }
        }
    }

    public static boolean positiveCheck(String paramName, long value) {
        if (value <= 0) {
            throw new IllegalArgumentException(paramName + " cannot be less than or equal to 0!");
        }
        return true;
    }

    public static boolean maxValueCheck(String paramName, long value, long maxValue) {
        if (value > maxValue) {
            throw new IllegalArgumentException(paramName + " cannot be greater than " + maxValue + "!");
        }
        return true;

View on GitHub (pinned to 820761864e)

Solutions

  1. Fix the malformed value at the reported line/column
  2. Match the expected type (number vs string, etc.)
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/utils/CmdUtils.java:52 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of apache/pulsar@820761864e (2026-09-06). Data as JSON: /api/errors/46c986a80021069e. Report an issue: GitHub.