{"record":{"id":"9b1fe99c4f3aca95","repo":"pentaho/pentaho-kettle","slug":"repository-norepositoryexists-messages","errorCode":"Repository.NoRepositoryExists.Messages","errorMessage":"Repository.NoRepositoryExists.Messages","messagePattern":"Repository\\.NoRepositoryExists\\.Messages","errorType":"error_code","errorClass":"KettleException","httpStatus":null,"severity":"critical","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryConnectionDelegate.java","lineNumber":207,"sourceCode":"        callRead( () -> database.getOneRow( \"SELECT * FROM \" + userTable ) );\n\n        // Still here? That means we have a repository...\n        //\n        // If we can't retrieve the last available upgrade date:\n        // this means the R_VERSION table doesn't exist.\n        // This table was introduced in version 2.3.0\n        //\n        if ( log.isBasic() ) {\n          log.logBasic( BaseMessages.getString( PKG, \"Repository.Error.GettingInfoVersionTable\", versionTable ) );\n          log.logBasic( BaseMessages.getString( PKG, \"Repository.Error.NewTable\" ) );\n          log.logBasic( \"Stack trace: \" + Const.getStackTracker( e ) );\n        }\n        majorVersion = 2;\n        minorVersion = 2;\n\n        lastUpgrade = null;\n      } catch ( Exception ex ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"Repository.NoRepositoryExists.Messages\" ) );\n      }\n    }\n\n    if ( lastUpgrade != null ) {\n      majorVersion = (int) lastUpgrade.getInteger( KettleDatabaseRepository.FIELD_VERSION_MAJOR_VERSION, -1 );\n      minorVersion = (int) lastUpgrade.getInteger( KettleDatabaseRepository.FIELD_VERSION_MINOR_VERSION, -1 );\n    }\n\n    if ( majorVersion < REQUIRED_MAJOR_VERSION\n      || ( majorVersion == REQUIRED_MAJOR_VERSION && minorVersion < REQUIRED_MINOR_VERSION ) ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"Repository.UpgradeRequired.Message\", getVersion(), getRequiredVersion() ) );\n    }\n\n    if ( majorVersion == 3 && minorVersion == 0 ) {\n      // The exception: someone upgraded the repository to version 3.0.0\n      // In that version, one column got named incorrectly.\n      // Another upgrade to 3.0.1 or later will fix that.","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryConnectionDelegate.java#L189-L225","documentation":"KettleException with the localized message Repository.NoRepositoryExists.Messages thrown by verifyVersion when reading the repository version rows fails with an unexpected Exception, indicating the connected database is not a valid/initialized Kettle repository (version table missing or unreadable). This catches databases that exist but were never initialized as repositories.","triggerScenarios":"Connecting to a database where R_VERSION does not exist or its contents cannot be read (empty result set from the version lookup) during connect(..., ignoreVersion=false).","commonSituations":"Pointing Kettle at a plain/empty database instead of a repository, connecting after manual deletion of R_VERSION, or a pre-2.x/foreign schema that doesn't match expected tables.","solutions":["Run the repository creation/upgrade wizard (or RepositoryConnectController / SQL scripts) to initialize the repository tables","Verify you connected to the correct database that actually hosts the Kettle repository","Restore the R_VERSION table from backup if it was dropped","Check the database user has SELECT permission on R_VERSION"],"exampleFix":"// before\nKettleDatabaseRepository repo = ...;\nrepo.connect(\"user\", \"pass\"); // throws NoRepositoryExists\n\n// after\n// initialize first, e.g. via Spoon's repository create dialog or SQL scripts,\n// then connect and guard:\ntry {\n  repo.connect(\"user\", \"pass\");\n} catch (KettleException e) {\n  log.error(\"Repository not initialized; run upgrade scripts\", e);\n}","handlingStrategy":"validation","validationCode":"Database db = new Database(meta); db.connect(); ResultSet rs = db.openQuery(\"SELECT COUNT(*) FROM R_VERSION\"); // throws if table missing -> repository not initialized","typeGuard":"boolean isInitializedRepo = versionTableExists && versionRowCount > 0;","tryCatchPattern":"try { repository.connect(u, p); } catch (KettleException e) { if (String.valueOf(e.getMessage()).contains(\"NoRepositoryExists\")) { initializeRepositorySchema(); repository.connect(u, p); } else { throw e; } }","preventionTips":["Only point Kettle at databases initialized as Kettle repositories","Run repository creation scripts before first connect","Verify R_VERSION exists and is readable by the connect user","Restore version tables from backup after manual cleanup"],"tags":["repository","version-check","initialization"],"backgroundTag":"missing-required-config","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"}