{"record":{"id":"9cc23dab773642c9","repo":"pentaho/pentaho-kettle","slug":"jsoninputmeta-exception-errorreadingrepository","errorCode":"JsonInputMeta.Exception.ErrorReadingRepository","errorMessage":"JsonInputMeta.Exception.ErrorReadingRepository","messagePattern":"JsonInputMeta\\.Exception\\.ErrorReadingRepository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/json/core/src/main/java/org/pentaho/di/trans/steps/jsoninput/JsonInputMeta.java","lineNumber":931,"sourceCode":"        field.setRepeated( rep.getStepAttributeBoolean( id_step, i, \"field_repeat\" ) );\n\n        getInputFields()[i] = field;\n      }\n      setInFields( rep.getStepAttributeBoolean( id_step, \"IsInFields\" ) );\n      isAFile = rep.getStepAttributeBoolean( id_step, \"IsAFile\" );\n\n      valueField = rep.getStepAttributeString( id_step, \"valueField\" );\n\n      setShortFileNameField( rep.getStepAttributeString( id_step, \"shortFileFieldName\" ) );\n      setPathField( rep.getStepAttributeString( id_step, \"pathFieldName\" ) );\n      setIsHiddenField( rep.getStepAttributeString( id_step, \"hiddenFieldName\" ) );\n      setLastModificationDateField( rep.getStepAttributeString( id_step, \"lastModificationTimeFieldName\" ) );\n      setUriField( rep.getStepAttributeString( id_step, \"uriNameFieldName\" ) );\n      setRootUriField( rep.getStepAttributeString( id_step, \"rootUriNameFieldName\" ) );\n      setExtensionField( rep.getStepAttributeString( id_step, \"extensionFieldName\" ) );\n      setSizeField( rep.getStepAttributeString( id_step, \"sizeFieldName\" ) );\n    } catch ( Exception e ) {\n      throw new KettleException(\n        BaseMessages.getString( PKG, \"JsonInputMeta.Exception.ErrorReadingRepository\" ), e );\n    }\n  }\n\n  @Override\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step )\n    throws KettleException {\n    try {\n      rep.saveStepAttribute( id_transformation, id_step, \"include\", includeFilename );\n      rep.saveStepAttribute( id_transformation, id_step, \"include_field\", filenameField );\n      rep.saveStepAttribute( id_transformation, id_step, \"addresultfile\", addResultFile );\n      rep.saveStepAttribute( id_transformation, id_step, \"readurl\", readurl );\n\n      rep.saveStepAttribute( id_transformation, id_step, \"removeSourceField\", removeSourceField );\n\n      rep.saveStepAttribute( id_transformation, id_step, \"IsIgnoreEmptyFile\", isIgnoreEmptyFile );\n      rep.saveStepAttribute( id_transformation, id_step, \"ignoreMissingPath\", ignoreMissingPath );\n      rep.saveStepAttribute( id_transformation, id_step, \"defaultPathLeafToNull\", defaultPathLeafToNull );","sourceCodeStart":913,"sourceCodeEnd":949,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/json/core/src/main/java/org/pentaho/di/trans/steps/jsoninput/JsonInputMeta.java#L913-L949","documentation":"KettleException with message key JsonInputMeta.Exception.ErrorReadingRepository, thrown by JsonInputMeta.readRep when any exception occurs loading the step's attributes from the repository (database) by id_step. It means the step definition could not be read from the repository storage.","triggerScenarios":"readRep -> rep.getStepAttributeString / field-loading loop throws: repository DB connection failure, missing step row in R_STEP_ATTRIBUTE, schema mismatch, or invalid field attribute values while reconstructing JsonInputField entries.","commonSituations":"Repository database temporarily down or connection dropped; transformation referencing a step deleted by another user; repository schema version mismatch after a PDI upgrade; corrupted attribute rows.","solutions":["Check the wrapped cause in the log — usually a repository DB connectivity error; restore the connection and retry.","Verify the step's rows exist in R_STEP_ATTRIBUTE for the given id_step (query by ID_STEP).","Re-save the transformation from Spoon to rewrite the step attributes.","If after an upgrade, run the repository upgrade scripts so the schema matches your PDI version."],"exampleFix":"// before: readRep fails on stale connection\nDatabaseMeta stale = ...; // connection dropped\n// after: validate connection before opening transformations\nif (!rep.testConnectionSuccess()) { rep.connect(); }\nTransMeta tm = new TransMeta(rep, transName, dir);","handlingStrategy":"retry","validationCode":"// check repository health before loading\nif (!rep.testConnectionSuccess()) { throw new IllegalStateException(\"Repository unreachable\"); }","typeGuard":null,"tryCatchPattern":"try { transMeta = new TransMeta(rep, name, dir); }\ncatch (KettleException e) {\n  if (getRootCause(e) instanceof SQLException && isTransient(e)) { rep.disconnect(); rep.connect(); /* retry once */ }\n  else throw e;\n}","preventionTips":["Run repository upgrade scripts after every PDI upgrade.","Monitor repository DB availability before scheduled transformation loads.","Avoid deleting steps/transformation objects while others load them.","Verify the step's attribute rows exist if the transformation came from import."],"tags":["repository","database","metadata","kettle"],"backgroundTag":"database-query-failed","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"}