apache/dolphinscheduler · error · RuntimeException
Unable to determine current software version, so cannot upgr
Error message
Unable to determine current software version, so cannot upgrade
What it means
DolphinSchedulerManager.upgradeDolphinScheduler throws this RuntimeException when the target database has no t_ds_version table, so the currently installed schema version cannot be read. The upgrade tool refuses to proceed rather than guessing the schema version, because upgrade scripts depend on knowing the starting version.
Source
Thrown at dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/datasource/DolphinSchedulerManager.java:95
public void initDolphinSchedulerSchema() {
log.info("Start initializing the DolphinScheduler manager table structure");
upgradeDao.initSchema();
}
public void upgradeDolphinScheduler() throws IOException {
// Gets a list of all upgrades
List<String> schemaList = SchemaUtils.getAllSchemaList();
if (schemaList == null || schemaList.isEmpty()) {
log.info("There is no schema to upgrade!");
} else {
String version;
// Get the version of the current system
if (databaseDialect.tableExists("t_ds_version")) {
version = upgradeDao.getCurrentVersion("t_ds_version");
} else {
log.error("Unable to determine current software version, so cannot upgrade");
throw new RuntimeException("Unable to determine current software version, so cannot upgrade");
}
// The target version of the upgrade
String schemaVersion;
for (String schemaDir : schemaList) {
schemaVersion = schemaDir.split("_")[0];
if (SchemaUtils.isAGreatVersion(schemaVersion, version)) {
log.info("upgrade DolphinScheduler metadata version from {} to {}", version, schemaVersion);
log.info("Begin upgrading DolphinScheduler's table structure");
upgradeDao.upgradeDolphinScheduler(schemaDir);
DolphinSchedulerVersion.getVersion(schemaVersion).ifPresent(v -> upgraderMap.get(v).doUpgrade());
version = schemaVersion;
}
}
}
// Assign the value of the version field in the version table to the version of the product
upgradeDao.updateVersion(SchemaUtils.getSoftVersion());
}View on GitHub (pinned to 02eac45a1b)
Solutions
- Confirm you are connected to the correct existing DolphinScheduler database that was previously initialized (check JDBC URL in the tool's datasource config).
- If the DB is fresh, run the init-schema command instead of upgrade.
- Check the database manually: SELECT * FROM t_ds_version; if missing, determine the actual schema version from table shapes and insert a version row before upgrading.
- Verify the user account can see the table (schema/catalog visibility on PostgreSQL/Oracle).
Defensive patterns
Strategy: validation
Validate before calling
// check before running the upgrade tool
java.sql.DatabaseMetaData md = connection.getMetaData();
try (java.sql.ResultSet rs = md.getTables(null, null, "t_ds_version", null)) {
if (!rs.next()) throw new IllegalStateException("t_ds_version missing: run init-schema or check you target the right DB");
} Try / catch
try {
manager.upgradeDolphinScheduler();
} catch (RuntimeException e) {
if (e.getMessage().contains("Unable to determine current software version")) {
log.error("Target DB has no t_ds_version table - verify JDBC URL or run init-schema", e);
} else { throw e; }
} Prevention
- Always init-schema before ever running upgrade.
- Double-check the upgrade tool's JDBC URL points at the production DB.
- Snapshot/backup the DB before upgrading.
- Confirm the DB user can see t_ds_version (schema/search_path).
When it happens
Trigger: Running the upgrade (tools/datasource upgrade) against a database where the t_ds_version table does not exist — typically a fresh/empty database, a database initialized by a very old version, or connecting to the wrong database/schema.
Common situations: Pointing the upgrade tool at an empty database instead of the existing production DB; pointing at the wrong database name or host; running upgrade before ever running init-schema; version table dropped manually.
Understand the failure class
Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.
Related errors
- The version table does not exist
- sql file not found
- Execute ddl file failed, meet an unknown exception
- Upgrade version error, sql:
- Query t_ds_process_instance error
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/6501a9248d1068d1.
Report an issue: GitHub.