{"record":{"id":"2b9dfcc7ca83b20d","repo":"Netflix/Hystrix","slug":"bad-property-value-property-name-expected-c","errorCode":null,"errorMessage":"bad property value. property name '{}'. Expected correct enum value, one of the [{}] , actual = {}","messagePattern":"bad property value\\. property name '(.+?)'\\. Expected correct enum value, one of the \\[(.+?)\\] , actual = (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hystrix-contrib/hystrix-javanica/src/main/java/com/netflix/hystrix/contrib/javanica/conf/HystrixPropertiesManager.java","lineNumber":424,"sourceCode":"        } catch (IllegalArgumentException e) {\n            throw createBadEnumError(propName, propValue, values);\n        }\n    }\n\n    private static int toInt(String propName, String propValue) throws IllegalArgumentException {\n        try {\n            return Integer.parseInt(propValue);\n        } catch (NumberFormatException e) {\n            throw new IllegalArgumentException(\"bad property value. property name '\" + propName + \"'. Expected int value, actual = \" + propValue);\n        }\n    }\n\n    private static boolean toBoolean(String propValue) {\n        return Boolean.valueOf(propValue);\n    }\n\n    private static IllegalArgumentException createBadEnumError(String propName, String propValue, Enum... values) {\n        throw new IllegalArgumentException(\"bad property value. property name '\" + propName + \"'. Expected correct enum value, one of the [\" + Arrays.toString(values) + \"] , actual = \" + propValue);\n    }\n\n}\n","sourceCodeStart":406,"sourceCodeEnd":428,"githubUrl":"https://github.com/Netflix/Hystrix/blob/5ce3bc58c38e7ca60ef2fe0e516e390e294ad941/hystrix-contrib/hystrix-javanica/src/main/java/com/netflix/hystrix/contrib/javanica/conf/HystrixPropertiesManager.java#L406-L428","documentation":"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.","triggerScenarios":"@HystrixProperty(name = \"execution.isolation.strategy\", value = \"thread\") (lowercase — valueOf is case-sensitive), value = \"ASYNC\", or value resolving to null/blank from configuration.","commonSituations":"Lowercase or mixed-case enum strings from YAML/properties files; misspelled strategy names; defaults removed from config leaving null; developers assuming case-insensitive matching.","solutions":["Set the value to the exact uppercase constant, e.g. THREAD or SEMAPHORE","Check the message's bracketed list of valid constants for your version and use one verbatim","If sourced externally, validate/uppercase the value before it reaches the annotation, and ensure it is never blank","Re-run — deterministic at command initialization"],"exampleFix":"// before\n@HystrixProperty(name = \"execution.isolation.strategy\", value = \"thread\")\n\n// after\n@HystrixProperty(name = \"execution.isolation.strategy\", value = \"THREAD\")","handlingStrategy":"validation","validationCode":"static String enumProp(String name, String raw, Set<String> allowed) {\n  String v = raw == null ? \"\" : raw.trim().toUpperCase(Locale.ROOT);\n  if (!allowed.contains(v)) throw new IllegalStateException(name + \" must be one of \" + allowed + \", got: \" + raw);\n  return v;\n}","typeGuard":null,"tryCatchPattern":"catch (IllegalArgumentException e) { log.error(\"Fix enum value: {}\", e.getMessage()); throw e; }","preventionTips":["Use exact uppercase enum constants in annotations","Uppercase+trim externalized values before they reach annotations","Treat blank enum values as config errors early, not at first invocation"],"tags":["hystrix","javanica","configuration","enum","validation"],"backgroundTag":null,"analyzedSha":"5ce3bc58c38e7ca60ef2fe0e516e390e294ad941","analyzedAt":"2026-08-14T10:55:35.600Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}