{"record":{"id":"3fee2e77beac437a","repo":"pentaho/pentaho-kettle","slug":"unable-to-save-job-entry-of-type-sftp-to-the-repository-for","errorCode":null,"errorMessage":"Unable to save job entry of type 'SFTP' to the repository for id_job=","messagePattern":"Unable to save job entry of type 'SFTP' to the repository for id_job=","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/get-file-sftp/impl/src/main/java/org/pentaho/di/job/entries/sftp/JobEntrySFTP.java","lineNumber":272,"sourceCode":"      rep.saveJobEntryAttribute( id_job, getObjectId(), \"remove\", remove );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"isaddresult\", isaddresult );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"createtargetfolder\", createtargetfolder );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"copyprevious\", copyprevious );\n\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"usekeyfilename\", usekeyfilename );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"keyfilename\", keyfilename );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"keyfilepass\", Encr\n        .encryptPasswordIfNotUsingVariables( keyfilepass ) );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"compression\", compression );\n\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"proxyType\", proxyType );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"proxyHost\", proxyHost );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"proxyPort\", proxyPort );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"proxyUsername\", proxyUsername );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"proxyPassword\", Encr\n        .encryptPasswordIfNotUsingVariables( proxyPassword ) );\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException(\n        \"Unable to save job entry of type 'SFTP' to the repository for id_job=\" + id_job, dbe );\n    }\n  }\n\n  /**\n   * @return Returns the directory.\n   */\n  public String getScpDirectory() {\n    return sftpDirectory;\n  }\n\n  /**\n   * @param directory\n   *          The directory to set.\n   */\n  public void setScpDirectory( String directory ) {\n    this.sftpDirectory = directory;\n  }","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/get-file-sftp/impl/src/main/java/org/pentaho/di/job/entries/sftp/JobEntrySFTP.java#L254-L290","documentation":"JobEntrySFTP.saveRep() throws this KettleException when writing the SFTP entry's attributes (server, port, credentials, proxy fields, including encrypted password) to the repository fails with a KettleDatabaseException. The message is \"Unable to save job entry of type 'SFTP' to the repository for id_job=\" + id_job, with the database exception as cause — a repository persistence failure, not an SFTP connectivity issue.","triggerScenarios":"Saving a job containing the SFTP entry when the repository write fails: broken DB connection, read-only database, insufficient INSERT/UPDATE privileges on r_jobentry_attribute, constraint violations, or transaction rollback.","commonSituations":"Repository database offline or network interruption during save; user lacks write rights to repository tables; disk full on the DB server; save conflicts from concurrent edits.","solutions":["Check the cause KettleDatabaseException for the SQL error and resolve the repository-side problem (connection, privileges, space).","Grant the repository user write access to the job entry attribute tables.","Retry saving after restoring the repository connection; use Repository::test in Spoon to verify first.","If corruption persists, recreate the entry in a fresh job and re-save."],"exampleFix":"// before: assuming save always succeeds\njobEntry.saveRep( rep, metaStore, id_job );\n// after: guard with a connection check\nif ( !rep.isConnected() ) throw new KettleException( \"Repository not connected; cannot save SFTP entry\" );\njobEntry.saveRep( rep, metaStore, id_job );","handlingStrategy":"try-catch","validationCode":"if ( !rep.isConnected() ) throw new KettleException( \"Repository not connected; cannot save SFTP entry\" );","typeGuard":null,"tryCatchPattern":"try {\n  entry.saveRep( rep, metaStore, id_job );\n} catch ( KettleException e ) {\n  log.error( \"SFTP entry repo save failed: \" + e.getCause() );\n  throw new KettleException( \"Resolve repository DB issue (connection/privileges) and retry\", e );\n}","preventionTips":["Verify repository write access for the DB user.","Test the repository connection before bulk saves.","Watch for DB disk-full or read-only maintenance windows.","Retry saves once after transient connectivity errors before escalating."],"tags":["kettle","sftp","repository","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"}