{"record":{"id":"9001be6116766638","repo":"pentaho/pentaho-kettle","slug":"getfilesrowscountmeta-exception-errorsavingtorepository","errorCode":null,"errorMessage":"GetFilesRowsCountMeta.Exception.ErrorSavingToRepository","messagePattern":"GetFilesRowsCountMeta\\.Exception\\.ErrorSavingToRepository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/getfilesrowscount/GetFilesRowsCountMeta.java","lineNumber":574,"sourceCode":"      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\n      for ( int i = 0; i < fileName.length; i++ ) {\n        rep.saveStepAttribute( id_transformation, id_step, i, \"file_name\", fileName[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"file_mask\", fileMask[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"exclude_file_mask\", excludeFileMask[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"file_required\", fileRequired[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"include_subfolders\", includeSubFolders[i] );\n      }\n\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"GetFilesRowsCountMeta.Exception.ErrorSavingToRepository\", \"\" + id_step ), e );\n    }\n  }\n\n  public FileInputList getFiles( Bowl bowl, VariableSpace space ) {\n    return FileInputList.createFileList(\n      bowl, space, fileName, fileMask, excludeFileMask, fileRequired, includeSubFolderBoolean() );\n  }\n\n  private boolean[] includeSubFolderBoolean() {\n    int len = fileName.length;\n    boolean[] includeSubFolderBoolean = new boolean[len];\n    for ( int i = 0; i < len; i++ ) {\n      includeSubFolderBoolean[i] = YES.equalsIgnoreCase( includeSubFolders[i] );\n    }\n    return includeSubFolderBoolean;\n  }\n","sourceCodeStart":556,"sourceCodeEnd":592,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/getfilesrowscount/GetFilesRowsCountMeta.java#L556-L592","documentation":"GetFilesRowsCountMeta.saveRep() wraps any exception raised while persisting the step's per-file attributes to the repository into a KettleException with localized message GetFilesRowsCountMeta.Exception.ErrorSavingToRepository including the id_step. Saving the transformation fails for this step, leaving incomplete metadata.","triggerScenarios":"saveRep (public) executes and rep.saveStepAttribute(...) throws for any file attribute: repository connection failure, DB constraint/column-length violation, or null array element causing an error.","commonSituations":"Repository DB outage or network drop during save; read-only repository user; file masks longer than the repository column; two users saving the same transformation concurrently.","solutions":["Verify repository connectivity and retry the save.","Check the repository user's write permissions.","Inspect the wrapped cause for the underlying repository/SQL error.","Shorten mask/name values exceeding column lengths."],"exampleFix":"// before\nrep.saveStepAttribute( id_transformation, id_step, i, \"file_mask\", fileMask[i] ); // NPE on null entry\n// after\nrep.saveStepAttribute( id_transformation, id_step, i, \"file_mask\", fileMask[i] == null ? \"\" : fileMask[i] );","handlingStrategy":"try-catch","validationCode":"if (!repository.isConnected() || repository.getUserInfo().isReadOnly()) { throw new IllegalStateException(\"Repository not writable\"); }","typeGuard":null,"tryCatchPattern":"try { transMeta.saveRep(dir, metaStore, name); } catch (KettleException e) { if (e.getMessage().contains(\"ErrorSavingToRepository\")) { log.error(\"Save failed for step: \" + e.getMessage(), e.getCause()); /* retry or export to XML */ } }","preventionTips":["Save with an account that has write access","Verify connectivity before large saves","Keep mask/name values within column limits","Avoid two designers saving the same transformation simultaneously"],"tags":["kettle","repository","metadata-save","persistence"],"backgroundTag":"database-write-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"}