{"record":{"id":"f49baf0e2329519c","repo":"pentaho/pentaho-kettle","slug":"error-0003-jobentrypgpverify-cannot-save-job-entry","errorCode":"ERROR_0003","errorMessage":"JobEntryPGPVerify.ERROR_0003_Cannot_Save_Job_Entry","messagePattern":"JobEntryPGPVerify\\.ERROR_0003_Cannot_Save_Job_Entry","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/pgpverify/JobEntryPGPVerify.java","lineNumber":130,"sourceCode":"    try {\n      gpglocation = rep.getJobEntryAttributeString( id_jobentry, \"gpglocation\" );\n      filename = rep.getJobEntryAttributeString( id_jobentry, \"filename\" );\n      detachedfilename = rep.getJobEntryAttributeString( id_jobentry, \"detachedfilename\" );\n      useDetachedSignature = rep.getJobEntryAttributeBoolean( id_jobentry, \"useDetachedSignature\" );\n    } catch ( KettleException dbe ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"JobEntryPGPVerify.ERROR_0002_Cannot_Load_Job_From_Repository\", 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(), \"gpglocation\", gpglocation );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"filename\", filename );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"detachedfilename\", detachedfilename );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"useDetachedSignature\", useDetachedSignature );\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"JobEntryPGPVerify.ERROR_0003_Cannot_Save_Job_Entry\", id_job ), dbe );\n    }\n  }\n\n  public void setGPGLocation( String gpglocation ) {\n    this.gpglocation = gpglocation;\n  }\n\n  public String getGPGLocation() {\n    return gpglocation;\n  }\n\n  public void setFilename( String filename ) {\n    this.filename = filename;\n  }\n\n  public String getFilename() {\n    return filename;","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/pgpverify/JobEntryPGPVerify.java#L112-L148","documentation":"JobEntryPGPVerify.saveRep wraps any KettleDatabaseException thrown while saving the entry's attributes (gpglocation, filename, detachedfilename, useDetachedSignature) into a KettleException with ERROR_0003 'Cannot save job entry' plus the job id. The database error is kept as the cause. It indicates the job entry could not be persisted to the repository.","triggerScenarios":"Calling saveRep (directly or via saving the job) when a rep.saveJobEntryAttribute call throws KettleDatabaseException: connection failure, constraint violation, read-only DB, or invalid ObjectId (unsaved entry).","commonSituations":"Repository connection dropped mid-save; saving an entry whose ObjectId is null/not yet inserted; database quota or permissions problems; schema mismatch after upgrade.","solutions":["Check the cause for the SQL-level error and fix the repository DB issue (permissions, space, connectivity)","Ensure the job entry is inserted first (valid ObjectId) before saving attributes — save the whole job via rep.save(...) rather than calling saveRep on an unsaved entry","Reconnect and retry the save; remove any partially written rows first"],"exampleFix":"// before\nentry.saveRep(rep, metaStore, idJob); // may throw ERROR_0003\n// after\ntry {\n  entry.saveRep(rep, metaStore, idJob);\n} catch (KettleException e) {\n  logError(\"Cannot save PGP verify entry: \" + e.getCause(), e);\n  // alert user the job changes were not persisted\n}","handlingStrategy":"try-catch","validationCode":"// before saveRep\nif (entry.getObjectId() == null) throw new KettleException(\"Entry not inserted yet; save the job first\");","typeGuard":null,"tryCatchPattern":"try {\n  entry.saveRep(rep, metaStore, idJob);\n} catch (KettleException e) {\n  logError(\"Cannot save PGP verify entry: \" + e.getCause(), e);\n  // retry after restoring DB connection; check for partial writes\n}","preventionTips":["Only call saveRep on entries with a valid (inserted) ObjectId","Keep repository connections healthy; reconnect on failure before retrying","Watch DB quotas/permissions in shared repository environments"],"tags":["persistence","repository","database-write","kettle"],"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"}