{"record":{"id":"3f0d1a08fd55bd71","repo":"apache/dolphinscheduler","slug":"failed-to-get-the-product-version-description-file","errorCode":null,"errorMessage":"Failed to get the product version description file. The file could not be found","messagePattern":"Failed to get the product version description file\\. The file could not be found","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/datasource/utils/SchemaUtils.java","lineNumber":116,"sourceCode":"        // If the version and schema version is the same from 0 up to the arrlength-1 element,whoever has a larger\n        // arrLength has a larger version number\n        return schemaVersionArr.length > versionArr.length;\n    }\n\n    /**\n     * Gets the current software version number of the system\n     *\n     * @return current software version\n     */\n    public static String getSoftVersion() throws IOException {\n        final ClassPathResource softVersionFile = new ClassPathResource(\"sql/soft_version\");\n        String softVersion;\n        try (InputStream inputStream = softVersionFile.getInputStream()) {\n            softVersion = FileUtils.readFile2Str(inputStream);\n            softVersion = Strings.nullToEmpty(softVersion).replaceAll(\"\\\\s+|\\r|\\n\", \"\");\n        } catch (FileNotFoundException e) {\n            log.error(e.getMessage(), e);\n            throw new RuntimeException(\n                    \"Failed to get the product version description file. The file could not be found\", e);\n        }\n        return softVersion;\n    }\n\n}\n","sourceCodeStart":98,"sourceCodeEnd":123,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/datasource/utils/SchemaUtils.java#L98-L123","documentation":"SchemaUtils.getSoftVersion loads the product version description file (soft_version) from the classpath and reads it into a string. If the file cannot be found (FileNotFoundException while opening its InputStream), the tool cannot determine which SQL upgrade scripts to apply, so it logs and rethrows as a RuntimeException with this message.","triggerScenarios":"Running the datasource upgrade tool when the schema/soft_version resource is absent from the classpath — e.g. a broken/partial build of dolphinscheduler-tools, wrong working directory for a file-based lookup, or the resource was renamed/removed for the target version.","commonSituations":"Running the upgrade tool from an incomplete distribution (missing resources folder); building only part of the project so resources are not packaged; custom classloading that excludes the datasource resources; typo in the configured soft-version file path.","solutions":["Rebuild/re-extract the full dolphinscheduler-tools distribution so the version description resource is packaged","Verify the soft-version file exists on the classpath (e.g. under the datasource schema/ directory) for your version","Check the file path configuration passed to getSoftVersion and correct typos","Run the upgrade tool from the distribution root per official docs, not from an IDE partial classpath"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// verify the resource exists before running the upgrade\nString resource = \"org/apache/dolphinscheduler/tools/datasource/schema/soft_version\";\nif (SchemaUtils.class.getClassLoader().getResource(resource) == null) {\n    throw new IllegalStateException(\"soft_version resource missing from classpath: \" + resource);\n}","typeGuard":null,"tryCatchPattern":"try {\n    String softVersion = SchemaUtils.getSoftVersion(softVersionFile);\n} catch (RuntimeException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"version description file\")) {\n        log.error(\"soft_version resource missing; reinstall/repair the tools distribution\", e);\n    } else { throw e; }\n}","preventionTips":["Use the official full distribution, not a partial build, when running the upgrade tool","Confirm resource files are packaged (check the tools jar for the schema resources)","Run the tool per documented steps from the distribution root","Pin the tool version to match the DB version being upgraded"],"tags":["classpath","resource","upgrade","file"],"backgroundTag":"file-not-found","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}