{"record":{"id":"ee6660381d92fd97","repo":"pentaho/pentaho-kettle","slug":"unable-to-read-all-databases","errorCode":null,"errorMessage":"Unable to read all databases","messagePattern":"Unable to read all databases","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java","lineNumber":1500,"sourceCode":"      //Grab data from all objects at once to lower calls to server\n      List<NodeRepositoryFileData> data = pur.getDataForReadInBatch( children, NodeRepositoryFileData.class );\n      Iterator<NodeRepositoryFileData> dataIter = data.iterator();\n\n      for ( RepositoryFile file : children ) {\n        //Both list should be ordered, so the items match\n        DataNode node = dataIter.next().getNode();\n        if ( !hasOsgiFolder && StringUtils.equals( node.getProperty( \"TYPE\" ).getString(), \"KettleThin\" ) ) {\n          log.logDetailed( \"Unable to find database {\" + file.getName() + \"}\" );\n          continue;\n        }\n        DatabaseMeta databaseMeta = (DatabaseMeta) databaseMetaTransformer.dataNodeToElement( node );\n        databaseMeta.setName( file.getTitle() );\n        dbMetas.add( databaseMeta );\n      }\n\n      return dbMetas;\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to read all databases\", e );\n    } finally {\n      readWriteLock.readLock().unlock();\n    }\n  }\n\n  @Override\n  public void deleteDatabaseMeta( final String databaseName ) throws KettleException {\n    RepositoryFile fileToDelete = null;\n    ObjectId idDatabase = null;\n\n    try {\n      readWriteLock.writeLock().lock();\n      try {\n        fileToDelete = pur.getFile( getPath( databaseName, null, RepositoryObjectType.DATABASE ) );\n        idDatabase = new StringObjectId( fileToDelete.getId().toString() );\n        permanentlyDeleteSharedObject( idDatabase );\n        removeFromSharedObjectCache( RepositoryObjectType.DATABASE, idDatabase );\n      } finally {","sourceCodeStart":1482,"sourceCodeEnd":1518,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java#L1482-L1518","documentation":"Repository access failure in PurRepository while reading all database definitions: the batched data read from the server failed or could not be interpreted. The message wraps the underlying exception; individual missing databases are only logged, this throw indicates a wholesale read failure.","triggerScenarios":"Calling readDatabases() when the underlying getAllFilesOfType(DATABASE)/data lookup fails — unreadable file content, missing nodes, or service errors.","commonSituations":"Corrupted shared database connections; permission issues on the databases folder; transient pentaho repository outage during transformation startup.","solutions":["Check the cause chain for the underlying repository exception.","Verify shared database connections exist and are readable in the repository.","Recreate the affected DatabaseMeta entries and save them again.","Catch and continue with locally defined connections."],"exampleFix":"// before\nfor (DatabaseMeta db : repository.readDatabases()) { ... }\n// after\nList<DatabaseMeta> dbs;\ntry {\n  dbs = repository.readDatabases();\n} catch (KettleException e) {\n  logError(\"Falling back to local DB connections\", e);\n  dbs = Collections.emptyList();\n}","handlingStrategy":"try-catch","validationCode":"if (!repository.isConnected()) throw new IllegalStateException(\"connect first\");\n// optionally pre-check: repository.getDatabaseNames(false) returns non-null","typeGuard":"boolean dbReadable = repository != null && repository.isConnected();","tryCatchPattern":"try { dbs = repository.readDatabases(); } catch (KettleException e) { log.error(\"read databases failed\", e); dbs = emptyList(); }","preventionTips":["Verify shared DB connections exist before reading.","Keep repository folders permission-correct for the service user.","Log the wrapped cause for diagnosis.","Maintain local fallback DatabaseMeta definitions."],"tags":["repository","kettle","database-metadata"],"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"}