{"record":{"id":"6f9ff4eca07e2f7a","repo":"pentaho/pentaho-kettle","slug":"getfilesrowscountmeta-exception-errorreadingrepository","errorCode":null,"errorMessage":"GetFilesRowsCountMeta.Exception.ErrorReadingRepository","messagePattern":"GetFilesRowsCountMeta\\.Exception\\.ErrorReadingRepository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/getfilesrowscount/GetFilesRowsCountMeta.java","lineNumber":546,"sourceCode":"\n      allocate( nrFiles );\n\n      for ( int i = 0; i < nrFiles; i++ ) {\n        fileName[i] = rep.getStepAttributeString( id_step, i, \"file_name\" );\n        fileMask[i] = rep.getStepAttributeString( id_step, i, \"file_mask\" );\n        excludeFileMask[i] = rep.getStepAttributeString( id_step, i, \"exclude_file_mask\" );\n        fileRequired[i] = rep.getStepAttributeString( id_step, i, \"file_required\" );\n        if ( !YES.equalsIgnoreCase( fileRequired[i] ) ) {\n          fileRequired[i] = NO;\n        }\n        includeSubFolders[i] = rep.getStepAttributeString( id_step, i, \"include_subfolders\" );\n        if ( !YES.equalsIgnoreCase( includeSubFolders[i] ) ) {\n          includeSubFolders[i] = NO;\n        }\n      }\n\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"GetFilesRowsCountMeta.Exception.ErrorReadingRepository\" ), e );\n    }\n  }\n\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {\n    try {\n\n      rep.saveStepAttribute( id_transformation, id_step, \"files_count\", includeFilesCount );\n      rep.saveStepAttribute( id_transformation, id_step, \"files_count_fieldname\", filesCountFieldName );\n      rep.saveStepAttribute( id_transformation, id_step, \"rows_count_fieldname\", rowsCountFieldName );\n      rep.saveStepAttribute( id_transformation, id_step, \"rowseparator_format\", RowSeparator_format );\n      rep.saveStepAttribute( id_transformation, id_step, \"row_separator\", RowSeparator );\n      rep.saveStepAttribute( id_transformation, id_step, \"isaddresult\", isaddresult );\n      rep.saveStepAttribute( id_transformation, id_step, \"smartCount\", smartCount );\n\n      rep.saveStepAttribute( id_transformation, id_step, \"filefield\", filefield );\n      rep.saveStepAttribute( id_transformation, id_step, \"filename_Field\", outputFilenameField );\n","sourceCodeStart":528,"sourceCodeEnd":564,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/getfilesrowscount/GetFilesRowsCountMeta.java#L528-L564","documentation":"GetFilesRowsCountMeta.readRep() wraps any exception raised while loading this step's attributes from the Kettle repository into a KettleException with localized message GetFilesRowsCountMeta.Exception.ErrorReadingRepository. The step metadata could not be read, so the transformation fails to load from the repository.","triggerScenarios":"readRep (public) executes and a rep.getStepAttribute(...) call or subsequent array index/parse fails: missing step attributes in the repository, DB errors, or attribute values in unexpected format.","commonSituations":"Repository rows for the step were partially deleted; schema mismatch between plugin versions (attribute keys renamed); repository connectivity problems during load.","solutions":["Check repository connectivity and re-open the transformation.","Inspect the wrapped cause for the underlying SQL/schema error.","Re-save the step with the current plugin version to rewrite attributes.","Verify the repository schema matches the installed Kettle version (run upgrade scripts)."],"exampleFix":"// before\nString v = rep.getStepAttributeString(id_step, \"file_mask\");\nString[] masks = new String[]{ v }; // assumes present\n// after\nString v = rep.getStepAttributeString(id_step, \"file_mask\");\nif (v == null) { v = \"\"; logDetailed(\"file_mask missing for step, defaulting to empty\"); }","handlingStrategy":"try-catch","validationCode":"if (!repository.isConnected()) { throw new IllegalStateException(\"Repository not connected; cannot load transformation\"); }","typeGuard":null,"tryCatchPattern":"try { transMeta.loadTransMeta(rep, dir, name, metaStore); } catch (KettleException e) { if (e.getMessage().contains(\"ErrorReadingRepository\")) { log.error(\"Repository read failed: \", e.getCause()); } throw e; }","preventionTips":["Confirm repository connectivity before loading","Keep repository schema upgraded to match the Kettle version","Re-save steps after plugin upgrades","Check for partially deleted repository rows after crashes"],"tags":["kettle","repository","metadata-load","persistence"],"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"}