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

  1. Confirm you are connected to the correct existing DolphinScheduler database that was previously initialized (check JDBC URL in the tool's datasource config).
  2. If the DB is fresh, run the init-schema command instead of upgrade.
  3. 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.
  4. 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

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


AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06). Data as JSON: /api/errors/6501a9248d1068d1. Report an issue: GitHub.