pentaho/pentaho-kettle · error · KettleException

GetFilesRowsCountMeta.Exception.ErrorSavingToRepository

Error message

GetFilesRowsCountMeta.Exception.ErrorSavingToRepository

What it means

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.

Solutions

  1. Verify repository connectivity and retry the save.
  2. Check the repository user's write permissions.
  3. Inspect the wrapped cause for the underlying repository/SQL error.
  4. Shorten mask/name values exceeding column lengths.

Example fix

// before
rep.saveStepAttribute( id_transformation, id_step, i, "file_mask", fileMask[i] ); // NPE on null entry
// after
rep.saveStepAttribute( id_transformation, id_step, i, "file_mask", fileMask[i] == null ? "" : fileMask[i] );
Defensive patterns

Strategy: try-catch

Validate before calling

if (!repository.isConnected() || repository.getUserInfo().isReadOnly()) { throw new IllegalStateException("Repository not writable"); }

Try / catch

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 */ } }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/9001be6116766638. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/getfilesrowscount/GetFilesRowsCountMeta.java:574

      rep.saveStepAttribute( id_transformation, id_step, "rows_count_fieldname", rowsCountFieldName );
      rep.saveStepAttribute( id_transformation, id_step, "rowseparator_format", RowSeparator_format );
      rep.saveStepAttribute( id_transformation, id_step, "row_separator", RowSeparator );
      rep.saveStepAttribute( id_transformation, id_step, "isaddresult", isaddresult );
      rep.saveStepAttribute( id_transformation, id_step, "smartCount", smartCount );

      rep.saveStepAttribute( id_transformation, id_step, "filefield", filefield );
      rep.saveStepAttribute( id_transformation, id_step, "filename_Field", outputFilenameField );

      for ( int i = 0; i < fileName.length; i++ ) {
        rep.saveStepAttribute( id_transformation, id_step, i, "file_name", fileName[i] );
        rep.saveStepAttribute( id_transformation, id_step, i, "file_mask", fileMask[i] );
        rep.saveStepAttribute( id_transformation, id_step, i, "exclude_file_mask", excludeFileMask[i] );
        rep.saveStepAttribute( id_transformation, id_step, i, "file_required", fileRequired[i] );
        rep.saveStepAttribute( id_transformation, id_step, i, "include_subfolders", includeSubFolders[i] );
      }

    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString(
        PKG, "GetFilesRowsCountMeta.Exception.ErrorSavingToRepository", "" + id_step ), e );
    }
  }

  public FileInputList getFiles( Bowl bowl, VariableSpace space ) {
    return FileInputList.createFileList(
      bowl, space, fileName, fileMask, excludeFileMask, fileRequired, includeSubFolderBoolean() );
  }

  private boolean[] includeSubFolderBoolean() {
    int len = fileName.length;
    boolean[] includeSubFolderBoolean = new boolean[len];
    for ( int i = 0; i < len; i++ ) {
      includeSubFolderBoolean[i] = YES.equalsIgnoreCase( includeSubFolders[i] );
    }
    return includeSubFolderBoolean;
  }

View on GitHub (pinned to f3058517a1)