{"record":{"id":"b70ddf056beae520","repo":"pentaho/pentaho-kettle","slug":"jobmovefiles-error-exception-unablesaverep","errorCode":null,"errorMessage":"JobMoveFiles.Error.Exception.UnableSaveRep","messagePattern":"JobMoveFiles\\.Error\\.Exception\\.UnableSaveRep","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/movefiles/JobEntryMoveFiles.java","lineNumber":358,"sourceCode":"      rep.saveJobEntryAttribute( id_job, getObjectId(), \"create_move_to_folder\", create_move_to_folder );\n      rep\n        .saveJobEntryAttribute(\n          id_job, getObjectId(), \"AddMovedDateBeforeExtension\", AddMovedDateBeforeExtension );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"simulate\", simulate );\n\n      // save the arguments...\n      if ( source_filefolder != null ) {\n        for ( int i = 0; i < source_filefolder.length; i++ ) {\n          rep.saveJobEntryAttribute( id_job, getObjectId(), i, \"source_filefolder\", source_filefolder[i] );\n          rep\n            .saveJobEntryAttribute(\n              id_job, getObjectId(), i, \"destination_filefolder\", destination_filefolder[i] );\n          rep.saveJobEntryAttribute( id_job, getObjectId(), i, \"wildcard\", wildcard[i] );\n        }\n      }\n    } catch ( KettleDatabaseException dbe ) {\n\n      throw new KettleException( BaseMessages.getString( PKG, \"JobMoveFiles.Error.Exception.UnableSaveRep\" )\n        + id_job, dbe );\n    }\n  }\n\n  public Result execute( Result previousResult, int nr ) throws KettleException {\n    Result result = previousResult;\n    List<RowMetaAndData> rows = result.getRows();\n    RowMetaAndData resultRow = null;\n    result.setNrErrors( 1 );\n    result.setResult( false );\n\n    NrErrors = 0;\n    NrSuccess = 0;\n    successConditionBroken = false;\n    successConditionBrokenExit = false;\n    limitFiles = Const.toInt( environmentSubstitute( getNrErrorsLessThan() ), 10 );\n\n    if ( log.isDetailed() ) {","sourceCodeStart":340,"sourceCodeEnd":376,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/movefiles/JobEntryMoveFiles.java#L340-L376","documentation":"This KettleException is thrown by JobEntryMoveFiles.saveRep() when persisting the move-files job entry's per-row attributes (source/destination filefolders, wildcard, etc.) to the Kettle repository fails with a KettleDatabaseException. It wraps the underlying database error and appends the job id. It signals a repository (database) problem during save, not a problem with the job entry configuration itself.","triggerScenarios":"Calling saveRep() on a JobEntryMoveFiles when the repository database insert/update of job entry attributes fails — e.g. repository connection lost, table locked, constraint violation, or oversized attribute values.","commonSituations":"Saving a job with a 'Move files' entry while the repository database is down or the network to it dropped; repository schema version mismatch (missing columns); write permissions revoked for the repository user.","solutions":["Check the wrapped KettleDatabaseException's cause/message for the actual JDBC error and fix the repository database or connection.","Verify the repository R schema is up to date (run repository upgrade/repair) so all attribute columns exist.","Test repository connectivity and credentials; reconnect and retry the save.","If attributes are too large or violate constraints, shorten/normalize field values (paths, wildcards) and resave."],"exampleFix":"// before\nrep.saveJobEntryAttribute( id_job, getObjectId(), i, \"wildcard\", wildcard[i] );\n// after\n// ensure rep is connected first\nif ( !rep.isConnected() && !rep.connect() ) { throw new KettleException( \"Repository not connected\" ); }\nrep.saveJobEntryAttribute( id_job, getObjectId(), i, \"wildcard\", wildcard[i] );","handlingStrategy":"try-catch","validationCode":"// before save\nif ( !rep.isConnected() ) { rep.connect(); }\nif ( wildcard == null || destination_filefolder == null ) { throw new KettleValidationException( \"entry fields not initialized\" ); }","typeGuard":"boolean canSave = (rep != null && rep.isConnected());","tryCatchPattern":"try { jobEntry.saveRep( rep, metaStore, id_job ); } catch ( KettleException e ) { logError( \"Repository save failed: \" + e.getCause(), e ); /* retry after reconnect */ }","preventionTips":["Ensure the repository is connected and healthy before programmatic saves","Keep the repository schema upgraded to your Pentaho version","Validate entry fields are initialized before save","Catch KettleException and log the cause chain, not just the message"],"tags":["kettle","repository","database","job-entry","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"}