{"record":{"id":"bb5ed923b2e80974","repo":"apache/druid","slug":"problem-parsing-object-at-prefix-s-s","errorCode":null,"errorMessage":"Problem parsing object at prefix[%s]: %s.","messagePattern":"Problem parsing object at prefix\\[(.+?)\\]: (.+?)\\.","errorType":"validation","errorClass":"ProvisionException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/guice/JsonConfigurator.java","lineNumber":146,"sourceCode":"\n    final T config;\n    try {\n      if (defaultClass != null && jsonMap.isEmpty()) {\n        // No configs were provided. Don't use the jsonMapper; instead create a default instance of the default class\n        // using the JsonCreator annotated factory method or no-arg constructor.\n        // We know it exists because verifyClazzIsConfigurable checks for it.\n        Optional<Method> factoryMethod = findJsonCreatorFactoryMethod(defaultClass);\n        if (factoryMethod.isPresent()) {\n          config = (T) factoryMethod.get().invoke(null);\n        } else {\n          config = defaultClass.getConstructor().newInstance();\n        }\n      } else {\n        config = jsonMapper.convertValue(jsonMap, clazz);\n      }\n    }\n    catch (IllegalArgumentException e) {\n      throw new ProvisionException(\n          StringUtils.format(\"Problem parsing object at prefix[%s]: %s.\", propertyPrefix, e.getMessage()), e\n      );\n    }\n    catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) {\n      throw new ProvisionException(\n          StringUtils.format(\n              \"Problem instantiating object at prefix[%s]: %s: %s.\",\n              propertyPrefix,\n              e.getClass().getSimpleName(),\n              e.getMessage()\n          ),\n          e\n      );\n    }\n\n    final Set<ConstraintViolation<T>> violations = validator.validate(config);\n    if (!violations.isEmpty()) {\n      List<String> messages = new ArrayList<>();","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/guice/JsonConfigurator.java#L128-L164","documentation":"JsonConfigurator.configurate() converts a JSON map built from config properties into an instance of the target class. When the mapper throws IllegalArgumentException (bad structure/type during convertValue/constructType), it is wrapped in this ProvisionException so the failing config prefix (e.g. druid.storage.type's sibling keys) is identified.","triggerScenarios":"Properties under a propertyPrefix produce a JSON map whose shape does not match the target class (wrong value types, unexpected fields requiring strict validation, invalid enum names) when JsonConfigurator deserializes config for a Guice-provided object.","commonSituations":"Typos in enum-valued config (e.g. a bad druid.emitter.* value); supplying a string where a number/list is expected; nested config keys that don't match the class's properties; config keys left over from a deprecated extension version.","solutions":["Read e.getMessage() in the exception — it names the offending property/value","Fix the type or spelling of the config property at that prefix","Compare your config against the target class's documented properties","Use the same Jackson-compatible value formats (lists as comma- or JSON-formatted values per JsonConfigurator parsing rules)"],"exampleFix":"// before\n-Ddruid.emitter.http.flushThreshold=\"lots\"\n// after\n-Ddruid.emitter.http.flushThreshold=100000","handlingStrategy":"try-catch","validationCode":"// pre-flight: deserialize the same map outside Guice\njsonMapper.convertValue(propsToJsonMap(propertyPrefix), MyConfigClass.class);","typeGuard":null,"tryCatchPattern":"try { startDruid(); } catch (ProvisionException e) {\n  if (e.getMessage().startsWith(\"Problem parsing object at prefix\")) {\n    throw new ConfigurationException(\"Fix config at \" + extractPrefix(e.getMessage()), e);\n  }\n  throw e;\n}","preventionTips":["Keep config values in the JSON/Jackson types the target class expects","Validate enum-valued settings against documented allowed values","Test config in a dev process before deploying to production"],"tags":["configuration","json","guice"],"backgroundTag":"config-type-mismatch","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}