{"record":{"id":"d9e2635aff43af04","repo":"pentaho/pentaho-kettle","slug":"unable-to-save-job-entry-of-type-unzip-to-the-repository-for","errorCode":null,"errorMessage":"Unable to save job entry of type 'unzip' to the repository for id_job=","messagePattern":"Unable to save job entry of type 'unzip' to the repository for id_job=","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/unzip/JobEntryUnZip.java","lineNumber":300,"sourceCode":"      rep.saveJobEntryAttribute( id_job, getObjectId(), \"addfiletoresult\", addfiletoresult );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"isfromprevious\", isfromprevious );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"addtime\", addtime );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"adddate\", adddate );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"addOriginalTimestamp\", addOriginalTimestamp );\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(), \"rootzip\", rootzip );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"createfolder\", createfolder );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"nr_limit\", nr_limit );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"wildcardSource\", wildcardSource );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"success_condition\", success_condition );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"iffileexists\", getIfFileExistsCode( iffileexist ) );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"create_move_to_directory\", createMoveToDirectory );\n      rep\n        .saveJobEntryAttribute(\n          id_job, getObjectId(), \"setOriginalModificationDate\", setOriginalModificationDate );\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException(\n        \"Unable to save job entry of type 'unzip' to the repository for id_job=\" + id_job, dbe );\n    }\n  }\n\n  public Result execute( Result previousResult, int nr ) {\n    Result result = previousResult;\n    result.setResult( false );\n    result.setNrErrors( 1 );\n\n    List<RowMetaAndData> rows = result.getRows();\n    RowMetaAndData resultRow = null;\n\n    String realFilenameSource = environmentSubstitute( zipFilename );\n    String realWildcardSource = environmentSubstitute( wildcardSource );\n    String realWildcard = environmentSubstitute( wildcard );\n    String realWildcardExclude = environmentSubstitute( wildcardexclude );\n    String realTargetdirectory = environmentSubstitute( sourcedirectory );\n    String realMovetodirectory = environmentSubstitute( movetodirectory );","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/unzip/JobEntryUnZip.java#L282-L318","documentation":"JobEntryUnZip.saveRep() wraps a KettleDatabaseException from rep.saveJobEntryAttribute(...) into a KettleException with message \"Unable to save job entry of type 'unzip' to the repository for id_job=\" plus the id. The unzip entry's settings (including 'iffileexists' and 'setOriginalModificationDate') could not be persisted.","triggerScenarios":"Calling saveRep(rep, metaStore, id_job) when the repository write fails: DB connection lost, constraint violation, insufficient privileges, or read-only repository schema.","commonSituations":"Repository DB read-only or full; network interruption while saving a job; locked attribute rows from a concurrent Spoon session; revoked write grants.","solutions":["Confirm the repository user has write rights on R_JOBENTRY_ATTRIBUTE and the DB is writable.","Inspect the cause KettleDatabaseException for the underlying SQL error and fix it (locks, constraints, space).","Retry the save; if it persists, export the job as .kjb and reconnect to the repository.","Restart Spoon to clear stale repository connections."],"exampleFix":"// before: save without checking repository health\njobEntry.saveRep(rep, metaStore, id_job);\n// after\nif ( rep.isConnected() && rep.getActiveDatabaseMeta() != null ) {\n  jobEntry.saveRep(rep, metaStore, id_job);\n} else {\n  throw new KettleException(\"Repository not connected\");\n}","handlingStrategy":"try-catch","validationCode":"// Verify writable repository before saveRep\nif ( !rep.isReadOnly() && rep.isConnected() ) {\n  jobEntry.saveRep(rep, metaStore, id_job);\n} else {\n  throw new KettleException(\"Repository unavailable or read-only\");\n}","typeGuard":"boolean canPersist(Repository rep, ObjectId id_job) {\n  return rep != null && rep.isConnected() && !rep.isReadOnly() && id_job != null;\n}","tryCatchPattern":"try {\n  jobEntry.saveRep(rep, metaStore, id_job);\n} catch ( KettleException e ) {\n  logError(\"Unzip entry save failed: \" + e.getCause().getMessage(), e);\n  jobMeta.saveXMLFile(backupPath); // preserve user work\n  throw e;\n}","preventionTips":["Keep repository connections alive-checks enabled in Spoon.","Fix DB lock contention before mass-saving jobs.","Grant repository users explicit write permissions.","Export .kjb backups before large repository operations."],"tags":["database","repository","kettle","persistence"],"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"}