{"record":{"id":"19c7371ef20c5ac3","repo":"pentaho/pentaho-kettle","slug":"jsonreader-error-readurl-null","errorCode":"JsonReader.Error.ReadUrl.Null","errorMessage":"JsonReader.Error.ReadUrl.Null","messagePattern":"JsonReader\\.Error\\.ReadUrl\\.Null","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/json/core/src/main/java/org/pentaho/di/trans/steps/jsoninput/reader/FastJsonReader.java","lineNumber":122,"sourceCode":"    return defaultPathLeafToNull;\n  }\n\n  Configuration getJsonConfiguration() {\n    return jsonConfiguration;\n  }\n\n  private ParseContext getParseContext() {\n    return JsonPath.using( jsonConfiguration );\n  }\n\n  private ReadContext getReadContext() {\n    return jsonReadContext;\n  }\n\n  protected void readInput( InputStream is ) throws KettleException {\n    jsonReadContext = getParseContext().parse( is, JSON_CHARSET );\n    if ( jsonReadContext == null ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"JsonReader.Error.ReadUrl.Null\" ) );\n    }\n  }\n\n  public boolean isIgnoreMissingPath() {\n    return this.ignoreMissingPath;\n  }\n\n  public void setInputFields( JsonInputField[] inputFields ) {\n    if ( null != inputFields ) {\n      this.inputFields = inputFields;\n\n      compiledJsonPaths = new JsonPath[ inputFields.length ];\n      int i = 0;\n      for ( JsonInputField inputField : inputFields ) {\n        if ( System.getProperty( Const.KETTLE_COMPATIBILITY_JSON_INPUT_LEGACY_MODE, \"N\" ).equals( \"Y\" ) ) {\n          compiledJsonPaths[ i++ ] = JsonPath.compile( step.environmentSubstitute( inputField.getPath(), false ).trim() );\n        } else {\n          compiledJsonPaths[ i++ ] = JsonPath.compile( step.environmentSubstitute( inputField.getPath(), true ) );","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/json/core/src/main/java/org/pentaho/di/trans/steps/jsoninput/reader/FastJsonReader.java#L104-L140","documentation":"KettleException with message key JsonReader.Error.ReadUrl.Null thrown by FastJsonReader.readInput() when the Json parse of the input stream returns a null JsonReadContext. It indicates the fastjson-based reader parsed the stream but produced no usable context, so the step cannot extract any JSON data.","triggerScenarios":"parse -> readInput: getParseContext().parse(is, JSON_CHARSET) returns null — empty or whitespace-only input stream, or a stream whose content fastjson cannot build a context from (e.g. empty body fetched from a URL).","commonSituations":"URL source returns 200 with empty body; source file exists but is zero bytes; upstream service returns blank response during maintenance windows; wrong field chosen so the fetched resource has no content.","solutions":["Check the input source: confirm the file/URL actually returns non-empty JSON content (curl the URL / cat the file).","Validate the upstream service or file producer is not emitting empty payloads; add a size check before the step.","Verify the step's source field (filename or URL field from a previous step) is populated and points to the intended resource.","If the source legitimately can be empty, guard upstream with a filter step that skips empty files/rows."],"exampleFix":"// before: URL may return empty body\nString body = httpClient.get(url); // \"\"\n// after: guard before feeding the step\nif (body == null || body.trim().isEmpty()) { throw new IllegalStateException(\"Empty JSON from \" + url); }\nnew JSONObject(body); // also validates it parses","handlingStrategy":"validation","validationCode":"// ensure the source yields non-empty content before the JSON Input step\nString body = fetch(urlOrFile);\nif (body == null || body.trim().isEmpty()) throw new IllegalStateException(\"Empty JSON payload from source\");","typeGuard":null,"tryCatchPattern":"try { runTransformation(); }\ncatch (KettleException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"ReadUrl.Null\")) { alert(\"Empty JSON source\"); }\n  else throw e;\n}","preventionTips":["Check file size / HTTP body length upstream and skip empty sources with a filter step.","Confirm the filename/URL field from the previous step is populated.","Monitor upstream producers so silent empty payloads are caught early.","Make the previous step fail loudly rather than passing empty rows downstream."],"tags":["json","empty-input","url-source","kettle"],"backgroundTag":"empty-response-body","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}