{"record":{"id":"68dc50993e874958","repo":"pentaho/pentaho-kettle","slug":"transmeta-log-unabletoreaddatabaseidsfromrepository","errorCode":null,"errorMessage":"TransMeta.Log.UnableToReadDatabaseIDSFromRepository","messagePattern":"TransMeta\\.Log\\.UnableToReadDatabaseIDSFromRepository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryTransDelegate.java","lineNumber":952,"sourceCode":"      ObjectId[] dbids = repository.getDatabaseIDs( false );\n      for ( int i = 0; i < dbids.length; i++ ) {\n        DatabaseMeta databaseMeta = repository.loadDatabaseMeta( dbids[i], null ); // reads last version\n        databaseMeta.shareVariablesWith( transMeta );\n\n        DatabaseMeta check = transMeta.findDatabase( databaseMeta.getName() ); // Check if there already is one in the\n                                                                               // transformation\n        if ( check == null || overWriteShared ) { // We only add, never overwrite database connections.\n          if ( databaseMeta.getName() != null ) {\n            transMeta.getDatabaseManagementInterface().add( databaseMeta );\n            if ( !overWriteShared ) {\n              databaseMeta.setChanged( false );\n            }\n          }\n        }\n      }\n      transMeta.clearChangedDatabases();\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"TransMeta.Log.UnableToReadDatabaseIDSFromRepository\" ), dbe );\n    } catch ( KettleException ke ) {\n      throw new KettleException(\n        BaseMessages.getString( PKG, \"TransMeta.Log.UnableToReadDatabasesFromRepository\" ), ke );\n    }\n  }\n\n  /**\n   * Read the clusters in the repository and add them to this transformation if they are not yet present.\n   *\n   * @param transMeta\n   *          The transformation to load into.\n   * @param overWriteShared\n   *          if an object with the same name exists, overwrite\n   * @throws KettleException\n   */\n  public void readClusters( TransMeta transMeta, boolean overWriteShared ) throws KettleException {\n    try {","sourceCodeStart":934,"sourceCodeEnd":970,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryTransDelegate.java#L934-L970","documentation":"Raised by readDatabases (invoked from readTransSharedObjects) when reading the repository's database connections to attach to the transformation throws a KettleDatabaseException. Wrapped as a KettleException with the TransMeta.Log.UnableToReadDatabaseIDSFromRepository message and the DB cause.","triggerScenarios":"KettleDatabaseException while iterating repository database ids/objects (repository.getDatabaseIDs()/getDatabaseObjects) during shared-object loading of a transformation.","commonSituations":"R_DATABASE table missing or renamed; DB connection dropped while listing shared database connections; corrupted connection rows that fail deserialization.","solutions":["Check the wrapped dbe cause for the failing query on the database-connection tables.","Verify R_DATABASE (and related) tables exist and are readable by the repository user.","Repair or recreate repository metadata via the repository repair/upgrade tool.","Restore repository connectivity and retry loading the transformation's shared objects."],"exampleFix":"// before\ntransMeta = repository.loadTransformation(name, dir, monitor, true, null); // shared objects load fails\n// after\ntry {\n  transMeta = repository.loadTransformation(name, dir, monitor, true, null);\n} catch (KettleException e) {\n  log.logError(\"Could not read shared DB connections: \" + e.getCause(), e);\n  // proceed without shared objects or fix repository and retry\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":"// sanity check shared DB connections are listable before loading shared objects\nrepository.getDatabaseIDs();","typeGuard":null,"tryCatchPattern":"try { transMeta = repository.loadTransformation(name, dir, monitor, true, null); } catch (KettleException e) { if (e.getMessage().contains(\"UnableToReadDatabaseIDS\")) { /* repair repository DB tables */ } throw e; }","preventionTips":["Run repository upgrade/repair scripts after version upgrades","Keep R_DATABASE tables readable for the repository user","Verify DB connectivity before loading shared objects","Inspect the wrapped dbe for the exact failing query"],"tags":["repository","database-read","shared-objects","database-connections"],"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"}