{"record":{"id":"8f5947231d9000f4","repo":"pentaho/pentaho-kettle","slug":"jobmovefiles-error-exception-unableloadrep","errorCode":null,"errorMessage":"JobMoveFiles.Error.Exception.UnableLoadRep","messagePattern":"JobMoveFiles\\.Error\\.Exception\\.UnableLoadRep","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/movefiles/JobEntryMoveFiles.java","lineNumber":312,"sourceCode":"      create_move_to_folder = rep.getJobEntryAttributeBoolean( id_jobentry, \"create_move_to_folder\" );\n      add_moved_date = rep.getJobEntryAttributeBoolean( id_jobentry, \"add_moved_date\" );\n      add_moved_time = rep.getJobEntryAttributeBoolean( id_jobentry, \"add_moved_time\" );\n      SpecifyMoveFormat = rep.getJobEntryAttributeBoolean( id_jobentry, \"SpecifyMoveFormat\" );\n      simulate = rep.getJobEntryAttributeBoolean( id_jobentry, \"simulate\" );\n\n      // How many arguments?\n      int argnr = rep.countNrJobEntryAttributes( id_jobentry, \"source_filefolder\" );\n      allocate( argnr );\n\n      // Read them all...\n      for ( int a = 0; a < argnr; a++ ) {\n        source_filefolder[a] = rep.getJobEntryAttributeString( id_jobentry, a, \"source_filefolder\" );\n        destination_filefolder[a] = rep.getJobEntryAttributeString( id_jobentry, a, \"destination_filefolder\" );\n        wildcard[a] = rep.getJobEntryAttributeString( id_jobentry, a, \"wildcard\" );\n      }\n    } catch ( KettleException dbe ) {\n\n      throw new KettleException( BaseMessages.getString( PKG, \"JobMoveFiles.Error.Exception.UnableLoadRep\" )\n        + 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(), \"move_empty_folders\", move_empty_folders );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"arg_from_previous\", arg_from_previous );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"include_subfolders\", include_subfolders );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"add_result_filesname\", add_result_filesname );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"destination_is_a_file\", destination_is_a_file );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"create_destination_folder\", create_destination_folder );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"nr_errors_less_than\", nr_errors_less_than );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"success_condition\", success_condition );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"add_date\", add_date );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"add_time\", add_time );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"SpecifyFormat\", SpecifyFormat );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"date_time_format\", date_time_format );","sourceCodeStart":294,"sourceCodeEnd":330,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/movefiles/JobEntryMoveFiles.java#L294-L330","documentation":"JobEntryMoveFiles.loadRep() wraps any KettleException thrown while reading the entry's attributes (fields array with source_filefolder, destination_filefolder, wildcard) from the repository into a KettleException with localized 'JobMoveFiles.Error.Exception.UnableLoadRep' plus id_jobentry. The entry's repository rows could not be read.","triggerScenarios":"Calling loadRep for a Move Files entry when the R_JOBENTRY_ATTRIBUTE rows are missing/corrupt, the repository DB errors mid-read, or the number of field rows is inconsistent with the stored nr_fields value.","commonSituations":"Repository schema/version drift; partially written entry from a failed saveRep; DB connectivity loss during job load; manually deleted repository rows.","solutions":["Check the chained cause (dbe) for the underlying database error and fix connectivity/constraints","Verify the repository schema matches your PDI version (run repair/upgrade)","Delete and re-create the Move Files entry in Spoon to rebuild its repository rows","Verify R_JOBENTRY_ATTRIBUTE rows for that id_jobentry are complete (nr_fields matches data rows)"],"exampleFix":"// before\njobEntry.loadRep(rep, metaStore, id, databases, slaveServers);\n// after\ntry {\n  jobEntry.loadRep(rep, metaStore, id, databases, slaveServers);\n} catch (KettleException e) {\n  logError(\"MoveFiles entry \" + id + \" unreadable: \" + e.getCause(), e);\n  // fall back to defaults or abort the job load\n}","handlingStrategy":"try-catch","validationCode":"// before loadRep, verify repository rows are readable\nif (rep == null) throw new IllegalStateException(\"Repository not connected\");\nint nrFields = Const.toInt(rep.getJobEntryAttributeString(idJobentry, \"nr_fields\"), -1);\nif (nrFields < 0) throw new IllegalStateException(\"Move Files entry rows missing for \" + idJobentry);","typeGuard":null,"tryCatchPattern":"try {\n  entry.loadRep(rep, metaStore, idJobentry, databases, slaveServers);\n} catch (KettleException e) {\n  Throwable cause = e.getCause();\n  if (cause != null) logError(\"Repository read failed: \" + cause.getMessage(), cause);\n  // re-create the entry in Spoon or repair the repository schema\n  throw e;\n}","preventionTips":["Run the repository schema repair/upgrade tool after PDI version changes","Avoid manual deletion of R_JOBENTRY_ATTRIBUTE rows","Ensure DB connectivity is stable during job loads","Verify entry completeness after a failed saveRep by re-saving in Spoon"],"tags":["pdi","kettle","repository","database"],"backgroundTag":"database-query-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"}