apache/pulsar · error · IllegalArgumentException

Failed to parse config file %s. Invalid field '%s' on line:

Error message

Failed to parse config file %s. Invalid field '%s' on line: %d column: %d. Valid fields are %s

What it means

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.

Source

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

import java.io.IOException;
import org.apache.pulsar.common.util.ObjectMapperFactory;

public class CmdUtils {
    public static <T> T loadConfig(String file, Class<T> clazz) throws IOException {
        try {
            return ObjectMapperFactory.getYamlMapper().reader().readValue(new File(file), clazz);
        } catch (Exception ex) {
            if (ex instanceof UnrecognizedPropertyException) {
                UnrecognizedPropertyException unrecognizedPropertyException = (UnrecognizedPropertyException) ex;

                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) {

View on GitHub (pinned to 820761864e)

Solutions

  1. Remove or correct the invalid field in the config file
  2. Upgrade the CLI if the field belongs to a newer config version
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/utils/CmdUtils.java:42 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/79cdc1f5591f0b6d. Report an issue: GitHub.