{"record":{"id":"c3fae1e489c6394a","repo":"pentaho/pentaho-kettle","slug":"unexpected-error-reading-step-information-from-the-c3fae1","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":"plugins/get-repository-names/impl/src/main/java/org/pentaho/di/trans/steps/getrepositorynames/GetRepositoryNamesMeta.java","lineNumber":280,"sourceCode":"      if ( objectTypeString != null ) {\n        objectTypeSelection = ObjectTypeSelection.valueOf( objectTypeString );\n      }\n      if ( objectTypeSelection == null ) {\n        objectTypeSelection = ObjectTypeSelection.All;\n      }\n      includeRowNumber = rep.getStepAttributeBoolean( id_step, \"rownum\" );\n      rowNumberField = rep.getStepAttributeString( id_step, \"rownum_field\" );\n\n      allocate( nrfiles );\n\n      for ( int i = 0; i < nrfiles; i++ ) {\n        directory[i] = rep.getStepAttributeString( id_step, i, \"directory\" );\n        nameMask[i] = rep.getStepAttributeString( id_step, i, \"name_mask\" );\n        excludeNameMask[i] = rep.getStepAttributeString( id_step, i, \"exclude_name_mask\" );\n        includeSubFolders[i] = rep.getStepAttributeBoolean( id_step, i, \"include_subfolders\" );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unexpected error reading step information from the repository\", e );\n    }\n  }\n\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {\n    try {\n      rep.saveStepAttribute( id_transformation, id_step, \"object_type\", objectTypeSelection.toString() );\n      rep.saveStepAttribute( id_transformation, id_step, \"rownum\", includeRowNumber );\n      rep.saveStepAttribute( id_transformation, id_step, \"rownum_field\", rowNumberField );\n\n      for ( int i = 0; i < directory.length; i++ ) {\n        rep.saveStepAttribute( id_transformation, id_step, i, \"directory\", directory[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"name_mask\", nameMask[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"exclude_name_mask\", excludeNameMask[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"include_subfolders\", includeSubFolders[i] );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to save step information to the repository for id_step=\" + id_step, e );\n    }","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/get-repository-names/impl/src/main/java/org/pentaho/di/trans/steps/getrepositorynames/GetRepositoryNamesMeta.java#L262-L298","documentation":"GetRepositoryNamesMeta.readRep wraps any exception raised while loading this step's settings (directories, name masks, subfolder flags) from a Kettle repository into a KettleException. The library throws it because partial/corrupt repository metadata would otherwise leave the step metadata in an inconsistent state. The original cause is attached as the nested exception.","triggerScenarios":"Calling readRep(Repository, IMetaStore, ObjectId, List<DatabaseMeta>) when any rep.getStepAttributeString/getStepAttributeBoolean call for id_step throws — e.g. repository connection dropped mid-read, the step's id_step row was deleted by another user, or a repository plugin/driver error occurs.","commonSituations":"Opening a transformation stored in a database repository where the DB connection has timed out; concurrent modification of the transformation; a repository schema upgrade mismatch between Pentaho versions.","solutions":["Verify the repository connection is alive (reconnect) and retry loading the transformation.","Check the nested cause (e.getCause()) for the real repository/driver error and fix that underlying issue.","Re-save the transformation from a working client to repair corrupted step attributes.","Confirm repository plugin and Kettle versions match between writer and reader clients."],"exampleFix":"// before: reading from a stale repository connection\nKettleEnvironment.init();\nTransMeta tm = new TransMeta(rep, transMetaId, metaStore); // throws\n\n// after: ensure a live connection before loading\nif ( !rep.isConnected() ) {\n  rep.connect( username, password );\n}\ntry {\n  TransMeta tm = new TransMeta( rep, transMetaId, metaStore );\n} catch ( KettleException e ) {\n  logError( \"Failed to read step info\", e.getCause() );\n}","handlingStrategy":"try-catch","validationCode":"if ( rep == null || !rep.isConnected() ) {\n  throw new KettleException( \"Repository not connected before readRep\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  TransMeta tm = new TransMeta( rep, id, metaStore );\n} catch ( KettleException e ) {\n  log.error( \"readRep failed: \" + e.getMessage(), e.getCause() );\n  // reconnect and retry once\n}","preventionTips":["Always connect to the repository before loading transformations","Log e.getCause() to see the real repository error","Avoid concurrent edits of the same transformation","Keep Pentaho/repository plugin versions in sync"],"tags":["repository","metadata-read","kettle"],"backgroundTag":"file-read-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"}