{"record":{"id":"02556f310889d217","repo":"pentaho/pentaho-kettle","slug":"unable-to-save-job-entry-copy-to-the-repository-id-job-id","errorCode":null,"errorMessage":"Unable to save job entry copy to the repository, id_job=id_job","messagePattern":"Unable to save job entry copy to the repository, id_job=id_job","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryJobEntryDelegate.java","lineNumber":243,"sourceCode":"      // Get the entry type...\n      //\n      ObjectId id_jobentry_type = getJobEntryTypeID( entry.getPluginId() );\n\n      // Oops, not found: update the repository!\n      if ( id_jobentry_type == null ) {\n        repository.updateJobEntryTypes();\n\n        // Try again!\n        id_jobentry_type = getJobEntryTypeID( entry.getPluginId() );\n      }\n\n      // Save the entry copy..\n      //\n      copy.setObjectId( insertJobEntryCopy( id_job, id_jobentry, id_jobentry_type, copy.getNr(), copy\n        .getLocation().x, copy.getLocation().y, copy.isDrawn(), copy.isLaunchingInParallel() ) );\n\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( \"Unable to save job entry copy to the repository, id_job=\" + id_job, dbe );\n    }\n  }\n\n  @SuppressWarnings( \"deprecation\" )\n  private void compatibleEntrySaveRep( JobEntryInterface entry, Repository repository, ObjectId id_job ) throws KettleException {\n    entry.saveRep( repository, id_job );\n  }\n\n  public synchronized ObjectId insertJobEntry( ObjectId id_job, JobEntryBase jobEntryBase ) throws KettleException {\n    ObjectId id = repository.connectionDelegate.getNextJobEntryID();\n\n    ObjectId id_jobentry_type = getJobEntryTypeID( jobEntryBase.getPluginId() );\n\n    log.logDebug( \"ID_JobEntry_type = \" + id_jobentry_type + \" for type = [\" + jobEntryBase.getPluginId() + \"]\" );\n\n    RowMetaAndData table = new RowMetaAndData();\n\n    table.addValue( new ValueMetaInteger(","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryJobEntryDelegate.java#L225-L261","documentation":"Wrapper error in KettleDatabaseRepositoryJobEntryDelegate.saveJobEntryCopy(): inserting the job entry copy row (insertJobEntryCopy) or resolving its type id failed while saving a job entry to the repository. The transformation/job id is referenced in the message; the cause is chained to the outer KettleException.","triggerScenarios":"Calling saveJobEntryCopy where insertJobEntryCopy (or the preceding entry/type inserts) throws KettleDatabaseException — e.g. FK violation on id_job or id_jobentry_type, constraint failure, connection drop.","commonSituations":"Saving a job whose job entry plugin type is not registered (missing plugin jar), repository schema missing tables, DB read-only/permissions, network interruption during job save.","solutions":["Read the wrapped KettleDatabaseException cause for the SQL error and fix it (FK, constraint, permissions)","Ensure the job entry plugin is installed so the R_JOBENTRY_TYPE row/id resolves before the copy insert","Verify repository schema is current for your Pentaho version","Retry the save once DB connectivity is restored; avoid leaving the repository connection half-open"],"exampleFix":"// before: saving with a plugin that is not installed\nrepository.save(jobMeta, VERSION_COMMENT, null);\n// after: check plugin availability first\nif (JobEntryLoader.getInstance().findPluginWithId(entry.getPluginId()) == null) {\n  throw new IllegalStateException(\"Install plugin id=\" + entry.getPluginId() + \" before saving\");\n}\nrepository.save(jobMeta, VERSION_COMMENT, null);","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":["kettle","repository","database","save","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"}