{"record":{"id":"19cbe6375fbc9a4b","repo":"pentaho/pentaho-kettle","slug":"jobentrydeletefiles-unabletosavetorepo","errorCode":null,"errorMessage":"JobEntryDeleteFiles.UnableToSaveToRepo","messagePattern":"JobEntryDeleteFiles\\.UnableToSaveToRepo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/deletefiles/JobEntryDeleteFiles.java","lineNumber":190,"sourceCode":"      throw new KettleException( BaseMessages.getString( PKG, \"JobEntryDeleteFiles.UnableToLoadFromRepo\", String\n        .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\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( PKG, \"JobEntryDeleteFiles.UnableToSaveToRepo\", String\n        .valueOf( id_job ) ), dbe );\n    }\n  }\n\n  public Result execute( Result result, int nr ) throws KettleException {\n    List<RowMetaAndData> resultRows = result.getRows();\n\n    int numberOfErrFiles = 0;\n    result.setResult( false );\n    result.setNrErrors( 1 );\n\n    if ( argFromPrevious && log.isDetailed() ) {\n      logDetailed( BaseMessages.getString( PKG, \"JobEntryDeleteFiles.FoundPreviousRows\", String\n        .valueOf( ( resultRows != null ? resultRows.size() : 0 ) ) ) );\n    }\n\n    //Set Embedded NamedCluster MetaStore Provider Key so that it can be passed to VFS\n    if ( parentJobMeta.getNamedClusterEmbedManager() != null ) {","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/deletefiles/JobEntryDeleteFiles.java#L172-L208","documentation":"Kettle wraps a KettleDatabaseException thrown while persisting the 'Delete Files' job entry's file arguments (name/filemask pairs) into the repository. The message includes the job id to identify which job's metadata failed to save. It is thrown from saveRep() when rep.saveJobEntryAttribute() fails for any row.","triggerScenarios":"Calling saveRep() (directly or via JobMeta.save / repository export) when the underlying database insert/update of the 'name' or 'filemask' attributes fails, e.g. the r_jobentry_attribute table is missing, locked, or the connection dropped mid-save.","commonSituations":"Repository database down or network dropped during save; missing Kettle schema tables (no r_jobentry_attribute); DB permissions revoked; attribute value too long for column; repository connection configured wrong in ~/.kettle/repositories.xml.","solutions":["Check the repository database is reachable and the cause (dbe) chained in the exception logs the real SQL error","Run the Kettle repository upgrade scripts so r_jobentry_attribute exists and matches your Pentaho version","Verify the DB user has INSERT/UPDATE/DELETE rights on the repository tables","Retry the save after restoring connectivity; reduce attribute length if a column-size error appears"],"exampleFix":"// before\njobEntry.saveRep(rep, metaStore, idJob); // throws KettleException on DB failure\n// after\ntry {\n  jobEntry.saveRep(rep, metaStore, idJob);\n} catch (KettleException e) {\n  logError(\"Could not save DeleteFiles entry for job \" + idJob, e); // inspect chained KettleDatabaseException\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":"// before save\nif (!rep.isConnected() && rep instanceof KettleDatabaseRepository) {\n  throw new IllegalStateException(\"Repository not connected\");\n}\n// ensure arguments/filemasks are non-null and paired\nif (jobEntry.getArguments() == null || jobEntry.getFilemasks() == null) {\n  throw new IllegalStateException(\"arguments/filemasks must be initialized before save\");\n}","typeGuard":"boolean repositoryReady(Repository rep) {\n  return rep != null && !(rep instanceof KettleDatabaseRepository)\n    || ((KettleDatabaseRepository) rep).isConnected();\n}","tryCatchPattern":"try {\n  jobEntry.saveRep(rep, metaStore, idJob);\n} catch (KettleException e) {\n  Throwable cause = e.getCause();\n  if (cause instanceof KettleDatabaseException) {\n    // log SQL detail, alert, optionally queue for retry\n  }\n  throw e;\n}","preventionTips":["Verify repository connectivity before any save operation","Keep the repository schema upgraded to your Pentaho version","Monitor DB health and retry transient connection failures","Set up logging of chained causes to catch SQL-level errors early"],"tags":["kettle","database","persistence","job-entry"],"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"}