{"record":{"id":"7b4c4bf5fdc9227a","repo":"pentaho/pentaho-kettle","slug":"jobmeta-log-unabletoreaddatabasesfromrepository","errorCode":null,"errorMessage":"JobMeta.Log.UnableToReadDatabasesFromRepository","messagePattern":"JobMeta\\.Log\\.UnableToReadDatabasesFromRepository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryJobDelegate.java","lineNumber":726,"sourceCode":"        DatabaseMeta check = jobMeta.findDatabase( databaseMeta.getName() );\n\n        // We only add, never overwrite database connections.\n        //\n        if ( check == null || overWriteShared ) {\n          if ( databaseMeta.getName() != null ) {\n            jobMeta.getDatabaseManagementInterface().add( databaseMeta );\n            if ( !overWriteShared ) {\n              databaseMeta.setChanged( false );\n            }\n          }\n        }\n      }\n      jobMeta.setChanged( false );\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException(\n        BaseMessages.getString( PKG, \"JobMeta.Log.UnableToReadDatabaseIDSFromRepository\" ), dbe );\n    } catch ( KettleException ke ) {\n      throw new KettleException(\n        BaseMessages.getString( PKG, \"JobMeta.Log.UnableToReadDatabasesFromRepository\" ), ke );\n    }\n  }\n\n  /**\n   * Read the slave servers in the repository and add them to this transformation if they are not yet present.\n   *\n   * @param jobMeta\n   *          The job to put the slave servers in\n   * @param overWriteShared\n   *          if an object with the same name exists, overwrite\n   * @throws KettleException\n   */\n  public void readSlaves( JobMeta jobMeta, boolean overWriteShared ) throws KettleException {\n    try {\n      ObjectId[] dbids = repository.getSlaveIDs( false );\n      for ( int i = 0; i < dbids.length; i++ ) {\n        SlaveServer slaveServer = repository.loadSlaveServer( dbids[i], null ); // Load last version","sourceCodeStart":708,"sourceCodeEnd":744,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryJobDelegate.java#L708-L744","documentation":"The same readDatabases method also catches a KettleException (not just KettleDatabaseException) raised while processing the repository's database connection definitions and rewraps it with the message 'unable to read databases from the repository'. It signals a higher-level failure (e.g. constructing/looking up a DatabaseMeta failed) during shared-object loading into JobMeta.","triggerScenarios":"Calling readDatabases via repository read/save paths (also readSharedObjects) when database meta lookup/instantiation from repository rows throws KettleException: e.g. a repository DatabaseMeta row references an invalid plugin type or the DatabaseMeta cannot be created.","commonSituations":"Repository rows for connections created with a plugin no longer installed; malformed connection metadata; missing database driver preventing DatabaseMeta creation while loading shared objects.","solutions":["Inspect the chained KettleException cause to find which database connection row/definition failed.","Reinstall the missing database driver/plugin used by the stored connection.","Fix or remove the broken connection definitions in the repository metadata.","Ensure repository read occurs after a successful repository connection (databases list available)."],"exampleFix":"// before\nreadDatabases(jobMeta, true); // KettleException from bad connection row\n// after\ntry {\n  readDatabases(jobMeta, true);\n} catch (KettleException e) {\n  logError(\"Failed to load shared database connections: \" + e.getCause(), e);\n  // remove/repair offending connection definition in repository, then retry\n}","handlingStrategy":"try-catch","validationCode":"if (!repository.isConnected()) { repository.connect(user, password); }\n// ensure all DatabaseMeta plugins used by stored connections are installed before load","typeGuard":null,"tryCatchPattern":"try {\n  readSharedObjects(jobMeta);\n} catch (KettleException e) {\n  logError(\"Shared database connection could not be loaded: \" + (e.getCause() != null ? e.getCause().getMessage() : e.getMessage()), e);\n  // repair/remove the offending connection definition, then retry\n}","preventionTips":["Install the JDBC drivers/plugins for every connection stored in the repository on all installations.","Audit R_DATABASE rows for obsolete or third-party connection types.","Recreate stored connections after major version migrations.","Load shared objects only from a connected, healthy repository."],"tags":["database","repository","jobmeta","shared-objects"],"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"}