{"record":{"id":"cba2c842906c250d","repo":"pentaho/pentaho-kettle","slug":"unable-to-open-repository-connection","errorCode":null,"errorMessage":"Unable to open repository connection","messagePattern":"Unable to open repository connection","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/www/SlaveServerConfig.java","lineNumber":292,"sourceCode":"\n  private void openRepository( String repositoryId ) throws KettleException {\n    try {\n\n      RepositoriesMeta repositoriesMeta = new RepositoriesMeta();\n      repositoriesMeta.readData();\n      repositoryMeta = repositoriesMeta.findRepository( repositoryId );\n      if ( repositoryMeta == null ) {\n        throw new KettleException( \"Unable to find repository: \" + repositoryId );\n      }\n      PluginRegistry registry = PluginRegistry.getInstance();\n      repository = registry.loadClass( RepositoryPluginType.class, repositoryMeta, Repository.class );\n      repository.init( repositoryMeta );\n      repository.connect( repositoryUsername, repositoryPassword );\n\n      LogChannel.GENERAL.logBasic( \"Connected to repository '\" + repository.getName() + \"'\" );\n\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to open repository connection\", e );\n    }\n  }\n\n  public void readAutoSequences() throws KettleException {\n    if ( autoSequence == null ) {\n      return;\n    }\n\n    Database database = null;\n\n    try {\n      DatabaseMeta databaseMeta = autoSequence.getDatabaseMeta();\n      LoggingObjectInterface loggingInterface =\n        new SimpleLoggingObject( \"auto-sequence\", LoggingObjectType.GENERAL, null );\n      database = new Database( loggingInterface, databaseMeta );\n      database.connect();\n      String schemaTable =\n        databaseMeta.getQuotedSchemaTableCombination( autoSequence.getSchemaName(), autoSequence.getTableName() );","sourceCodeStart":274,"sourceCodeEnd":310,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/www/SlaveServerConfig.java#L274-L310","documentation":"After SlaveServerConfig.openRepository finds the repository metadata and instantiates the Repository plugin, repository.connect(username, password) failing (bad credentials, network, driver missing) is caught and rethrown as the less specific KettleException(\"Unable to open repository connection\") with the real cause chained. It signals the repository was identified but a live connection could not be established.","triggerScenarios":"repository.connect() throwing for any reason during openRepository: wrong username/password for the repository, the repository's backing database is down, the JDBC driver for the repository DB is not on Carte's classpath, or repository.init fails.","commonSituations":"Password changed after a policy rotation and carte-config.xml still has the old one; firewall blocking Carte host to the repository DB; ojdbc/postgresql driver jar missing from lib/ on the Carte server; repository database upgraded and driver incompatible.","solutions":["Inspect the chained cause (e) for the real driver/SQL/network error.","Verify repository username and password in the Carte config are current; update after password rotations.","Test connectivity from the Carte host to the repository database (ping/telnet host:port, check firewall).","Ensure the repository DB's JDBC driver jar is in the Carte lib/ directory.","Re-test credentials by connecting in Spoon on the Carte host itself."],"exampleFix":"// before: carte-config.xml with stale password\n<repository username=\"admin\" password=\"oldPass\" .../>\n\n// after\n<repository username=\"admin\" password=\"newRotatedPass\" .../>","handlingStrategy":"retry","validationCode":"// pre-flight: verify the repository DB is reachable and credentials work\ntry (Connection c = DriverManager.getConnection(repoDbUrl, user, pass)) {\n  if (!c.isValid(5)) throw new SQLException(\"cannot connect to repository DB\");\n}","typeGuard":null,"tryCatchPattern":"int attempts = 0;\nwhile (true) {\n  try { slaveServerConfig.getRepository(); break; }\n  catch (KettleException e) {\n    if (++attempts > 3 || e.getCause() instanceof AuthenticationException) throw e;\n    Thread.sleep(5000L * attempts); // transient network only\n  }\n}","preventionTips":["Update stored repository credentials whenever passwords rotate.","Put the repository JDBC driver in Carte's lib/ and keep it version-matched.","Whitelist Carte hosts to the repository DB in firewall rules."],"tags":["carte","repository","connection","database","credentials"],"backgroundTag":"connection-refused","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"}