{"record":{"id":"4bfde079211d4175","repo":"pentaho/pentaho-kettle","slug":"unable-to-load-notepad-from-repository-id-note-id-note","errorCode":null,"errorMessage":"Unable to load Notepad from repository (id_note=id_note)","messagePattern":"Unable to load Notepad from repository \\(id_note=id_note\\)","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryNotePadDelegate.java","lineNumber":98,"sourceCode":"\n        // Border color\n        note.setBorderColorRed( (int) r.getInteger(\n          \"FONT_BORDER_COLOR_RED\", NotePadMeta.COLOR_RGB_DEFAULT_BORDER_RED ) );\n        note.setBorderColorGreen( (int) r.getInteger(\n          \"FONT_BORDER_COLOR_GREEN\", NotePadMeta.COLOR_RGB_DEFAULT_BORDER_GREEN ) );\n        note.setBorderColorBlue( (int) r.getInteger(\n          \"FONT_BORDER_COLOR_BLUE\", NotePadMeta.COLOR_RGB_DEFAULT_BORDER_BLUE ) );\n        note.setDrawShadow( r.getBoolean( \"DRAW_SHADOW\", true ) );\n\n        // Done!\n        return note;\n      } else {\n        note.setObjectId( null );\n        throw new KettleException( \"I couldn't find Notepad with id_note=\" + id_note + \" in the repository.\" );\n      }\n    } catch ( KettleDatabaseException dbe ) {\n      note.setObjectId( null );\n      throw new KettleException( \"Unable to load Notepad from repository (id_note=\" + id_note + \")\", dbe );\n    }\n  }\n\n  /**\n   *\n   * @param rep\n   * @param id_transformation\n   * @throws KettleException\n   */\n  public void saveNotePadMeta( NotePadMeta note, ObjectId id_transformation ) throws KettleException {\n    try {\n      Point location = note.getLocation();\n      int x = location == null ? -1 : location.x;\n      int y = location == null ? -1 : location.y;\n\n      // Insert new Note in repository\n      note.setObjectId( insertNote(\n        note.getNote(), x, y, note.getWidth(), note.getHeight(), note.getFontName(), note.getFontSize(), note","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryNotePadDelegate.java#L80-L116","documentation":"This KettleException wraps a KettleDatabaseException thrown while loading a NotePadMeta by id_note. Unlike the 'couldn't find Notepad' error (no row), this indicates the load query itself failed — connection problems, SQL errors, or schema issues — so the note could not be read from R_NOTE.","triggerScenarios":"Calling loadNotePadMeta(id_note) when the underlying SELECT on R_NOTE throws KettleDatabaseException: DB connection dropped, table missing/locked, or driver-level SQL error.","commonSituations":"Repository database temporarily unreachable; R_NOTE schema mismatch after partial upgrade; database lock contention during concurrent repository access.","solutions":["Inspect the chained KettleDatabaseException cause for the SQL error","Check repository DB connectivity and retry after the connection recovers","Verify R_NOTE table exists and matches the expected schema for your Pentaho version","Avoid long-held transactions that lock R_NOTE during concurrent saves"],"exampleFix":"// before\nNotePadMeta note = delegate.loadNotePadMeta(idNote);\n// after\nNotePadMeta note;\ntry { note = delegate.loadNotePadMeta(idNote); }\ncatch (KettleException e) {\n  log.error(\"DB failure loading note \" + idNote + \": \" + e.getCause(), e);\n  throw e; // retry after connectivity is restored\n}","handlingStrategy":"try-catch","validationCode":"try (Connection c = dataSource.getConnection()) { if (c.isClosed()) throw new IllegalStateException(\"Repository DB unreachable\"); }","typeGuard":null,"tryCatchPattern":"try { note = delegate.loadNotePadMeta(idNote); } catch (KettleException e) { if (e.getCause() instanceof KettleDatabaseException) { /* transient DB issue: retry with backoff */ } throw e; }","preventionTips":["Use a connection pool with health checks for the repository DB","Retry transient SQL failures with exponential backoff","Keep R_NOTE schema aligned with the Pentaho version after upgrades","Avoid long transactions that hold locks on R_NOTE"],"tags":["database","repository","notepad","sql"],"backgroundTag":"database-query-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"}