Netflix/Hystrix · error · IllegalArgumentException

bad property value. property name '{}'. Expected correct enu

Error message

bad property value. property name '{}'. Expected correct enum value, one of the [{}] , actual = {}

What it means

createBadEnumError is used when a @HystrixProperty maps to an enum-typed setter — in practice execution.isolation.strategy (THREAD/SEMAPHORE) and execution.isolation.semaphore.interruptOnTimeout-style flags' enum siblings. Enum.valueOf throwing NullPointerException (null/blank value) or IllegalArgumentException (unknown constant) is converted to a message listing the property name, all valid enum constants, and the actual value supplied.

Source

Thrown at hystrix-contrib/hystrix-javanica/src/main/java/com/netflix/hystrix/contrib/javanica/conf/HystrixPropertiesManager.java:424

        } catch (IllegalArgumentException e) {
            throw createBadEnumError(propName, propValue, values);
        }
    }

    private static int toInt(String propName, String propValue) throws IllegalArgumentException {
        try {
            return Integer.parseInt(propValue);
        } catch (NumberFormatException e) {
            throw new IllegalArgumentException("bad property value. property name '" + propName + "'. Expected int value, actual = " + propValue);
        }
    }

    private static boolean toBoolean(String propValue) {
        return Boolean.valueOf(propValue);
    }

    private static IllegalArgumentException createBadEnumError(String propName, String propValue, Enum... values) {
        throw new IllegalArgumentException("bad property value. property name '" + propName + "'. Expected correct enum value, one of the [" + Arrays.toString(values) + "] , actual = " + propValue);
    }

}

View on GitHub (pinned to 5ce3bc58c3)

Solutions

  1. Set the value to the exact uppercase constant, e.g. THREAD or SEMAPHORE
  2. Check the message's bracketed list of valid constants for your version and use one verbatim
  3. If sourced externally, validate/uppercase the value before it reaches the annotation, and ensure it is never blank
  4. Re-run — deterministic at command initialization

Example fix

// before
@HystrixProperty(name = "execution.isolation.strategy", value = "thread")

// after
@HystrixProperty(name = "execution.isolation.strategy", value = "THREAD")
Defensive patterns

Strategy: validation

Validate before calling

static String enumProp(String name, String raw, Set<String> allowed) {
  String v = raw == null ? "" : raw.trim().toUpperCase(Locale.ROOT);
  if (!allowed.contains(v)) throw new IllegalStateException(name + " must be one of " + allowed + ", got: " + raw);
  return v;
}

Try / catch

catch (IllegalArgumentException e) { log.error("Fix enum value: {}", e.getMessage()); throw e; }

Prevention

When it happens

Trigger: @HystrixProperty(name = "execution.isolation.strategy", value = "thread") (lowercase — valueOf is case-sensitive), value = "ASYNC", or value resolving to null/blank from configuration.

Common situations: Lowercase or mixed-case enum strings from YAML/properties files; misspelled strategy names; defaults removed from config leaving null; developers assuming case-insensitive matching.

Related errors


AI-assisted analysis of Netflix/Hystrix@5ce3bc58c3 (2026-08-14). Data as JSON: /api/errors/2b9dfcc7ca83b20d. Report an issue: GitHub.