{"record":{"id":"0fe67efc17cb9888","repo":"pentaho/pentaho-kettle","slug":"unexpected-error-reading-step-information-from-the-0fe67e","errorCode":null,"errorMessage":"Unexpected error reading step information from the repository","messagePattern":"Unexpected error reading step information from the repository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/fileinput/text/TextFileInputMeta.java","lineNumber":986,"sourceCode":"      content.dateFormatLenient = rep.getStepAttributeBoolean( id_step, 0, \"date_format_lenient\", true );\n\n      String dateLocale = rep.getStepAttributeString( id_step, 0, \"date_format_locale\" );\n      if ( dateLocale != null ) {\n        content.dateFormatLocale = EnvUtil.createLocale( dateLocale );\n      } else {\n        content.dateFormatLocale = Locale.getDefault();\n      }\n      additionalOutputFields.shortFilenameField = rep.getStepAttributeString( id_step, \"shortFileFieldName\" );\n      additionalOutputFields.pathField = rep.getStepAttributeString( id_step, \"pathFieldName\" );\n      additionalOutputFields.hiddenField = rep.getStepAttributeString( id_step, \"hiddenFieldName\" );\n      additionalOutputFields.lastModificationField =\n          rep.getStepAttributeString( id_step, \"lastModificationTimeFieldName\" );\n      additionalOutputFields.uriField = rep.getStepAttributeString( id_step, \"uriNameFieldName\" );\n      additionalOutputFields.rootUriField = rep.getStepAttributeString( id_step, \"rootUriNameFieldName\" );\n      additionalOutputFields.extensionField = rep.getStepAttributeString( id_step, \"extensionFieldName\" );\n      additionalOutputFields.sizeField = rep.getStepAttributeString( id_step, \"sizeFieldName\" );\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unexpected error reading step information from the repository\", 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, \"accept_filenames\", inputFiles.acceptingFilenames );\n      rep.saveStepAttribute( id_transformation, id_step, \"passing_through_fields\", inputFiles.passingThruFields );\n      rep.saveStepAttribute( id_transformation, id_step, \"accept_field\", inputFiles.acceptingField );\n      rep.saveStepAttribute( id_transformation, id_step, \"accept_stepname\", ( acceptingStep != null ? acceptingStep\n          .getName() : \"\" ) );\n\n      rep.saveStepAttribute( id_transformation, id_step, \"separator\", content.separator );\n      rep.saveStepAttribute( id_transformation, id_step, \"enclosure\", content.enclosure );\n      rep.saveStepAttribute( id_transformation, id_step, \"enclosure_breaks\", content.breakInEnclosureAllowed );\n      rep.saveStepAttribute( id_transformation, id_step, \"escapechar\", content.escapeCharacter );\n      rep.saveStepAttribute( id_transformation, id_step, \"header\", content.header );","sourceCodeStart":968,"sourceCodeEnd":1004,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/fileinput/text/TextFileInputMeta.java#L968-L1004","documentation":"The TextFileInputMeta(Repository, ...) constructor reads step attributes from a repository and wraps any failure in a KettleException 'Unexpected error reading step information from the repository'. This protects callers from partially initialized step metadata when the repository read fails mid-way.","triggerScenarios":"Loading a TextFileInput step definition from a repository database (getStepAttributeString calls) when the repository connection drops, the r_step_attribute table is unavailable/corrupt, or the repository API throws (permission, network, DB down).","commonSituations":"Repository DB restarted or network blip while opening a transformation; insufficient repository permissions for the user; corrupted repository schema after an upgrade; timeout on a slow DB link.","solutions":["Check repository connectivity (ping the DB, test login in Spoon's repository dialog).","Verify the repository user has read permission on the transformation/step attributes.","Inspect the chained cause for the concrete SQL/repository error and fix that (schema corruption → restore backup).","Re-open the transformation after connectivity is restored; the read is not retried automatically.","If a version upgrade broke the schema, run the repository upgrade/repair scripts for your PDI version."],"exampleFix":"// before: constructing metadata with a stale repository connection\nTextFileInputMeta meta = new TextFileInputMeta(rep, metaStore, transMeta, stepId);\n// after: verify repository is alive first\nif (!rep.isConnected() && !rep.connect()) { throw new KettleException(\"Repository unavailable\"); }\nTextFileInputMeta meta = new TextFileInputMeta(rep, metaStore, transMeta, stepId);","handlingStrategy":"try-catch","validationCode":"if (rep == null || !rep.isConnected()) {\n  throw new KettleException(\"Repository not connected before reading step metadata\");\n}","typeGuard":"if (rep == null || id_step == null) return false; // cannot read from repository","tryCatchPattern":"try {\n  TextFileInputMeta meta = new TextFileInputMeta(rep, metaStore, transMeta, id_step);\n} catch (KettleException e) {\n  log.logError(\"Repository read failed: \" + e.getCause(), e);\n  // retry after reconnect or load from XML export instead\n}","preventionTips":["Check repository connectivity before opening repository-based transformations.","Grant repository users read access to required objects.","Back up the repository DB and keep upgrade scripts current.","Keep an XML export of critical transformations as a fallback source."],"tags":["kettle","etl","repository","database"],"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"}