{"record":{"id":"eed4fa32a126b28b","repo":"pentaho/pentaho-kettle","slug":"jobentryaddresultfilenames-unabletosavetorepo","errorCode":null,"errorMessage":"JobEntryAddResultFilenames.UnableToSaveToRepo","messagePattern":"JobEntryAddResultFilenames\\.UnableToSaveToRepo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/core/impl/src/main/java/org/pentaho/di/job/entries/addresultfilenames/JobEntryAddResultFilenames.java","lineNumber":190,"sourceCode":"        PKG, \"JobEntryAddResultFilenames.UnableToLoadFromRepo\", String.valueOf( id_jobentry ) ), dbe );\n    }\n  }\n\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_job ) throws KettleException {\n    try {\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"arg_from_previous\", argFromPrevious );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"include_subfolders\", includeSubfolders );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"delete_all_before\", deleteallbefore );\n\n      // save the arguments...\n      if ( arguments != null ) {\n        for ( int i = 0; i < arguments.length; i++ ) {\n          rep.saveJobEntryAttribute( id_job, getObjectId(), i, \"name\", arguments[i] );\n          rep.saveJobEntryAttribute( id_job, getObjectId(), i, \"filemask\", filemasks[i] );\n        }\n      }\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"JobEntryAddResultFilenames.UnableToSaveToRepo\", String.valueOf( id_job ) ), dbe );\n    }\n  }\n\n  public Result execute( Result result, int nr ) throws KettleException {\n    List<RowMetaAndData> rows = result.getRows();\n    RowMetaAndData resultRow = null;\n\n    int nrErrFiles = 0;\n    result.setResult( true );\n\n    if ( deleteallbefore ) {\n      // clear result filenames\n      int size = result.getResultFiles().size();\n      if ( log.isBasic() ) {\n        logBasic( BaseMessages.getString( PKG, \"JobEntryAddResultFilenames.log.FilesFound\", \"\" + size ) );\n      }\n","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core/impl/src/main/java/org/pentaho/di/job/entries/addresultfilenames/JobEntryAddResultFilenames.java#L172-L208","documentation":"saveRep throws KettleException with this message when saving the entry's per-row name/filemask attributes to the repository fails with a KettleDatabaseException. The job id is embedded in the message so the failing record can be located.","triggerScenarios":"rep.saveJobEntryAttribute(id_job, getObjectId(), i, \"name\"/\"filemask\", ...) failing due to DB constraint violation, connection loss, read-only repository, or null arguments array element issues.","commonSituations":"Repository database disk full, transaction deadlocks, saving a job while the DB schema is mid-upgrade, or credentials without INSERT/UPDATE rights.","solutions":["Check the wrapped KettleDatabaseException cause for the SQL error and fix the repository DB issue (space, locks, permissions).","Confirm the DB user has INSERT/UPDATE rights on R_JOBENTRY_ATTRIBUTE.","Retry saving the job after re-establishing the repository connection."],"exampleFix":"// before\nrep.saveJobEntryAttribute( id_job, getObjectId(), i, \"filemask\", filemasks[i] );\n// after\nrep.saveJobEntryAttribute( id_job, getObjectId(), i, \"filemask\", filemasks[i] != null ? filemasks[i] : \"\" );","handlingStrategy":"try-catch","validationCode":"// pre-save sanity checks\nif ( arguments == null || filemasks == null || arguments.length != filemasks.length ) throw new IllegalStateException( \"mismatched argument/filemask arrays\" );\nrep.getConnection() != null; // verify repository DB reachable","typeGuard":null,"tryCatchPattern":"try { entry.saveRep( rep, metaStore, id_job ); } catch ( KettleException e ) { logError( \"save failed for job \" + id_job + \": \" + e.getMessage(), e ); /* inspect KettleDatabaseException cause for SQL error */ }","preventionTips":["Ensure repository DB user has INSERT/UPDATE grants.","Monitor repository DB disk space and locks.","Avoid concurrent edits of the same job."],"tags":["repository","database","persistence","write-failed"],"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"}