{"record":{"id":"9f6fd17f47eba3f2","repo":"pentaho/pentaho-kettle","slug":"jobcopyfiles-error-exception-unablesaverep","errorCode":null,"errorMessage":"JobCopyFiles.Error.Exception.UnableSaveRep","messagePattern":"JobCopyFiles\\.Error\\.Exception\\.UnableSaveRep","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/copyfiles/JobEntryCopyFiles.java","lineNumber":320,"sourceCode":"      rep.saveJobEntryAttribute( id_job, getObjectId(), \"arg_from_previous\", arg_from_previous );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"overwrite_files\", overwrite_files );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"include_subfolders\", include_subfolders );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"remove_source_files\", remove_source_files );\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\n      // save the arguments...\n      if ( source_filefolder != null ) {\n        for ( int i = 0; i < source_filefolder.length; i++ ) {\n          saveSourceRep( rep, id_job, getObjectId(), i, source_filefolder[i] );\n          saveDestinationRep( rep, id_job, getObjectId(), i, 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, \"JobCopyFiles.Error.Exception.UnableSaveRep\" )\n        + id_job, dbe );\n    }\n  }\n\n  String[] preprocessfilefilder( String[] folders ) {\n    List<String> nfolders = new ArrayList<>();\n    if ( folders != null ) {\n      for ( int i = 0; i < folders.length; i++ ) {\n        nfolders.add( folders[ i ].replace( JobEntryCopyFiles.SOURCE_URL + i + \"-\", \"\" )\n          .replace( JobEntryCopyFiles.DEST_URL + i + \"-\", \"\" ) );\n      }\n    }\n    return nfolders.toArray( new String[ nfolders.size() ] );\n  }\n\n  public Result execute( Result previousResult, int nr ) throws KettleException {\n    Result result = previousResult;\n","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/copyfiles/JobEntryCopyFiles.java#L302-L338","documentation":"JobEntryCopyFiles.saveRep throws this KettleException when persisting the job entry's configuration to the Pentaho repository fails. It wraps KettleDatabaseException raised while saving job entry attributes (source, destination, wildcard per row) and appends the object id.","triggerScenarios":"Calling saveRep (job save to repository) when the repository connection fails, an attribute value violates a DB constraint (e.g. value too long for VALUE_STR column), or the job entry object id is invalid/not yet committed.","commonSituations":"Repository DB disk full or read-only; oversized wildcard/source path strings exceeding column length; network drop between Spoon and repository database; concurrent edits causing lock timeouts.","solutions":["Check repository DB connectivity and disk space / read-only state.","Shorten attribute values (paths/wildcards) that exceed R_JOBENTRY_ATTRIBUTE column limits.","Retry the save after resolving transient connection issues; commit/reopen the job.","Inspect the chained KettleDatabaseException for the failing SQL statement."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// before saving\nfor (String s : source) if (s != null && s.length() > 2000) throw new IllegalArgumentException(\"Source path too long for repository\");\nif (!rep.isConnected()) throw new IllegalStateException(\"Repository not connected before saveRep\");","typeGuard":null,"tryCatchPattern":"try {\n  jobEntry.saveRep(rep, metaStore, id_job);\n} catch (KettleException e) {\n  logError(\"Repository save failed for id_job=\" + id_job + \": \" + e.getCause(), e);\n  // notify user, keep in-memory job intact so the save can be retried\n}","preventionTips":["Check DB disk space and writability before bulk saves","Keep paths and wildcards within repository column length limits","Avoid concurrent saves of the same job from multiple Spoon sessions","Handle transient DB outages with a retry before giving up"],"tags":["pdi","kettle","repository","database-write"],"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"}