{"record":{"id":"534b3184889daeae","repo":"apache/druid","slug":"invalid-input-source-specification","errorCode":null,"errorMessage":"Invalid input source specification","messagePattern":"Invalid input source specification","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"server/src/main/java/org/apache/druid/catalog/model/table/BaseInputSourceDefn.java","lineNumber":248,"sourceCode":"    );\n  }\n\n  /**\n   * Convert from a generic Java map to the target input source using the object\n   * mapper provided. Translates Jackson errors into a generic unchecked error.\n   */\n  protected InputSource convertSource(\n      final Map<String, Object> jsonMap,\n      final ObjectMapper jsonMapper\n  )\n  {\n    try {\n      auditInputSource(jsonMap);\n      return jsonMapper.convertValue(jsonMap, inputSourceClass());\n    }\n    catch (Exception e) {\n      LOG.debug(e, \"Invalid input source specification\");\n      throw new IAE(e, \"Invalid input source specification\");\n    }\n  }\n\n  /**\n   * Optional step to audit or adjust the input source properties prior to\n   * conversion via Jackson. Changes are made directly in the {@code jsonMap}.\n   */\n  protected void auditInputSource(Map<String, Object> jsonMap)\n  {\n  }\n\n  /**\n   * Convert the format spec, if any, to an input format.\n   */\n  protected abstract InputFormat convertTableToFormat(ResolvedExternalTable table);\n\n  /**\n   *  Choose table or SQL-provided columns: table takes precedence.","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/catalog/model/table/BaseInputSourceDefn.java#L230-L266","documentation":"Thrown by BaseInputSourceDefn.convertSource when the input source JSON map cannot be converted into the corresponding Druid InputSource class via Jackson, after an optional audit step. The underlying Jackson (or audit) exception is attached as the cause and logged at debug level, so the real reason (unknown property, wrong type, malformed nested object) is in the cause chain.","triggerScenarios":"Calling convertArgsToSource or convertTableToSource with a properties map whose fields do not match the InputSource class: misspelled property names, wrong value types (string where object expected), or an auditInputSource adjustment that produces an invalid map.","commonSituations":"Hand-written or externally generated table specs with a typo in an input source property; a format object passed as a string; a spec produced by an older Druid version using a property name that was renamed.","solutions":["Inspect the wrapped cause exception (IAE.getCause() or debug logs) for the exact Jackson error and property name.","Fix the property names and value types in the input source map to match the InputSource class.","Validate the input source JSON with the format's ParameterDefn list before conversion.","Confirm the input source 'type' matches a registered InputSourceDefn."],"exampleFix":"// before\n{\"type\":\"inline\",\"datas\":\"{\\\"a\\\":1}\"}\n// after\n{\"type\":\"inline\",\"data\":\"{\\\"a\\\":1}\"}","handlingStrategy":"try-catch","validationCode":"// before calling convertSource\nif (jsonMap.get(\"type\") == null) throw new IllegalArgumentException(\"input source type required\");\n// ensure nested values are Maps, not Strings, e.g.\nif (!(jsonMap.get(\"format\") instanceof Map) && jsonMap.get(\"format\") != null) throw new IllegalArgumentException(\"format must be an object\");","typeGuard":"boolean isValidInputSourceMap(Map<String,Object> m) { return m != null && m.get(\"type\") instanceof String; }","tryCatchPattern":"try { InputSource s = defn.convertSource(jsonMap); ... } catch (IAE e) { LOG.error(\"bad input source: %s\", e.getCause() != null ? e.getCause().getMessage() : e.getMessage()); throw e; }","preventionTips":["Build input source maps from typed objects, not hand-written JSON","Inspect getCause() for the underlying Jackson failure","Keep property names in sync with the InputSource class","Validate specs through the console UI before storing"],"tags":["druid","input-source","jackson","invalid-input"],"backgroundTag":"invalid-argument-format","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}