{"record":{"id":"f32fa978bddb05ca","repo":"pentaho/pentaho-kettle","slug":"jobentrycopymoveresultfilenames-cannotsavetorep","errorCode":null,"errorMessage":"JobEntryCopyMoveResultFilenames.CanNotSaveToRep","messagePattern":"JobEntryCopyMoveResultFilenames\\.CanNotSaveToRep","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/copymoveresultfilenames/JobEntryCopyMoveResultFilenames.java","lineNumber":241,"sourceCode":"      rep.saveJobEntryAttribute( id_job, getObjectId(), \"wildcardexclude\", wildcardexclude );\n\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"destination_folder\", 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 );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"AddDateBeforeExtension\", AddDateBeforeExtension );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"action\", action );\n\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"OverwriteFile\", OverwriteFile );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"CreateDestinationFolder\", CreateDestinationFolder );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"RemovedSourceFilename\", RemovedSourceFilename );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"AddDestinationFilename\", AddDestinationFilename );\n\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleXMLException( BaseMessages.getString(\n        PKG, \"JobEntryCopyMoveResultFilenames.CanNotSaveToRep\", \"\" + id_job, dbe.getMessage() ) );\n    }\n  }\n\n  public void setSpecifyWildcard( boolean specifywildcard ) {\n    this.specifywildcard = specifywildcard;\n  }\n\n  public boolean isSpecifyWildcard() {\n    return specifywildcard;\n  }\n\n  public void setFoldername( String foldername ) {\n    this.foldername = foldername;\n  }\n\n  public String getFoldername() {\n    return foldername;","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/copymoveresultfilenames/JobEntryCopyMoveResultFilenames.java#L223-L259","documentation":"JobEntryCopyMoveResultFilenames.saveRep throws this KettleXMLException (wrapping KettleDatabaseException) when saving the entry's attributes to the repository fails. The message includes id_job and the DB error message. Note the exception type is inconsistent with the operation (save), which is a known quirk of this class.","triggerScenarios":"Calling saveRep when rep.saveJobEntryAttribute fails — repository connection lost, DB constraint violation (e.g. boolean/string value too long), or invalid object id — while persisting 'OverwriteFile', 'CreateDestinationFolder', 'RemovedSourceFilename', 'AddDestinationFilename' flags.","commonSituations":"Saving a job to a repository whose connection timed out; DB in read-only mode; column length exceeded by destination folder paths; concurrent repository access locking.","solutions":["Restore repository DB connectivity (check network, credentials) and retry the save.","Ensure the repository is not read-only and the user has write permissions.","Shorten values that may exceed R_JOBENTRY_ATTRIBUTE column sizes.","Inspect dbe.getMessage() in the exception for the failing statement."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (!rep.isConnected()) throw new IllegalStateException(\"Connect repository before saveRep\");\nif (destinationFolder != null && destinationFolder.length() > 2000) throw new IllegalArgumentException(\"Destination folder value too long\");","typeGuard":null,"tryCatchPattern":"try {\n  jobEntry.saveRep(rep, metaStore, id_job);\n} catch (KettleXMLException e) {\n  logError(\"Repository save failed for id_job=\" + id_job + \": \" + e.getMessage(), e);\n  // retry after restoring DB connectivity; the job remains in memory\n}","preventionTips":["Ensure repository user has write privileges","Monitor DB for read-only mode or quota exhaustion","Retry saves after transient connection failures","Remember this class throws KettleXMLException even on save — catch that type"],"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"}