{"record":{"id":"2c57c32c0dbecacc","repo":"pentaho/pentaho-kettle","slug":"jobentryconnectedtorepository-meta-unabletosavetorep","errorCode":null,"errorMessage":"JobEntryConnectedToRepository.Meta.UnableToSaveToRep","messagePattern":"JobEntryConnectedToRepository\\.Meta\\.UnableToSaveToRep","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/connected-to-repository/impl/src/main/java/org/pentaho/di/job/entries/connectedtorepository/JobEntryConnectedToRepository.java","lineNumber":155,"sourceCode":"\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"JobEntryConnectedToRepository.Meta.UnableToLoadFromRep\" )\n        + id_jobentry, dbe );\n\n    }\n  }\n\n  // Save the attributes of this job entry\n  //\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_job ) throws KettleException {\n    try {\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"isspecificrep\", isspecificrep );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"repname\", repname );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"isspecificuser\", isspecificuser );\n      rep.saveJobEntryAttribute( id_job, getObjectId(), \"username\", username );\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"JobEntryConnectedToRepository.Meta.UnableToSaveToRep\" )\n        + id_job, dbe );\n    }\n  }\n\n  /**\n   * Execute this job entry and return the result. In this case it means, just set the result boolean in the Result\n   * class.\n   *\n   * @param previousResult\n   *          The result of the previous execution\n   * @return The Result of the execution.\n   */\n  public Result execute( Result previousResult, int nr ) {\n    Result result = previousResult;\n    result.setNrErrors( 1 );\n    result.setResult( false );\n","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/connected-to-repository/impl/src/main/java/org/pentaho/di/job/entries/connectedtorepository/JobEntryConnectedToRepository.java#L137-L173","documentation":"JobEntryConnectedToRepository.saveRep wraps KettleDatabaseException from saving the entry's attributes (isspecificrep, repname, isspecificuser, username) into a KettleException keyed 'JobEntryConnectedToRepository.Meta.UnableToSaveToRep' plus the job id. It means the job entry could not be persisted to the repository database.","triggerScenarios":"saveRep called during job save when the repository insert/update of r_jobentry_attribute rows fails — DB connection loss, constraint violation, read-only repository, or schema mismatch.","commonSituations":"Repository database offline or connection dropped mid-save; repository opened read-only; user lacks write permission; version mismatch between client and repository schema.","solutions":["Verify repository DB connectivity and write permissions","Retry the save once the database is reachable","Save the job locally (.kjb) as a fallback while the repository is unavailable","Check the wrapped KettleDatabaseException for the failing SQL/constraint"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// confirm write access before saving\nif ( rep.isReadOnly() ) {\n  throw new ValidationException( \"Repository is read-only\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  jobMeta.saveToRepository( rep, null );\n} catch ( KettleException e ) {\n  if ( e.getCause() instanceof KettleDatabaseException ) {\n    // retry after reconnecting, or save locally as fallback\n    jobMeta.saveToFile( \"/tmp/backup.kjb\", \"none\", \"none\" );\n  }\n}","preventionTips":["Ensure repository write permissions for the user","Reconnect stale repository sessions before saving","Keep client and repository schema versions in sync","Keep a local .kjb copy as fallback"],"tags":["repository","database","job-entry","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"}