{"record":{"id":"d2ffb31401eb6f2c","repo":"pentaho/pentaho-kettle","slug":"monetdbversion-exception-versionformatisinvalid","errorCode":"MonetDBVersion.Exception.VersionFormatIsInvalid","errorMessage":"MonetDBVersion.Exception.VersionFormatIsInvalid","messagePattern":"MonetDBVersion\\.Exception\\.VersionFormatIsInvalid","errorType":"exception","errorClass":"MonetDbVersionException","httpStatus":null,"severity":"error","filePath":"plugins/monet-db-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/monetdbbulkloader/MonetDbVersion.java","lineNumber":153,"sourceCode":"  }\n\n  /**\n   * Parses string representation of MonetDb version. Sets up <code>majorVersion</code>. Also <code>minorVersion</code>\n   * and <code>patchVersion</code> if they are present in the product version. Omits all other possible parts as\n   * insignificant.\n   *\n   * @param productVersion\n   *          a string representation of version\n   * @throws MonetDbVersionException\n   *           if productVersion is null or has incorrect format ( see {@link MonetDbVersion#VERSION_PATTERN} )\n   */\n  private void parseVersion( String productVersion ) throws MonetDbVersionException {\n    if ( productVersion == null ) {\n      throw new MonetDbVersionException( BaseMessages.getString( PKG, \"MonetDBVersion.Exception.VersionIsNull\" ) );\n    }\n\n    if ( !VERSION_PATTERN.matcher( productVersion ).matches() ) {\n      throw new MonetDbVersionException( BaseMessages.getString( PKG,\n          \"MonetDBVersion.Exception.VersionFormatIsInvalid\", productVersion ) );\n    }\n\n    int startIndex = 0;\n    String[] versionParts = productVersion.split( SEPARATOR );\n    majorVersion = Integer.valueOf( versionParts[startIndex] );\n    if ( versionParts.length > 1 ) {\n      minorVersion = Integer.valueOf( versionParts[startIndex + 1] );\n    }\n    if ( versionParts.length > 2 ) {\n      patchVersion = Integer.valueOf( versionParts[startIndex + 2] );\n    }\n\n  }\n\n  @Override\n  public String toString() {\n    return \"MonetDbVersion: \" + majorVersion + \".\" + minorVersion + \".\" + patchVersion;","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/monet-db-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/monetdbbulkloader/MonetDbVersion.java#L135-L171","documentation":"MonetDbVersion.parseVersion() throws MonetDbVersionException with this message when the server's productVersion string is non-null but does not match VERSION_PATTERN (major[.minor[.patch]] style numeric version). The loader parses the version into major/minor/patch integers for feature comparisons, so any non-conforming string (or one with extra non-numeric parts) is rejected.","triggerScenarios":"Constructing MonetDbVersion with a productVersion like 'oct-2020-1', 'v11.35.7-beta', an empty string, or a build string with suffixes that fail MonetDbVersion.VERSION_PATTERN.","commonSituations":"Upgraded MonetDB servers that changed their version-string format (e.g. date-based release naming); a driver returning a full descriptive version line instead of the bare numeric version; connecting to a non-MonetDB endpoint whose product version is a different format.","solutions":["Check the message for the offending version string, then compare it against VERSION_PATTERN in MonetDbVersion.java and update the pattern or driver to match your server's format.","Upgrade the monet-db-bulk-loader plugin (or its MonetDB driver dependency) to a build that supports your server's version string format.","Pre-normalize the version string before construction: strip 'v' prefixes and non-numeric suffixes so it is major[.minor[.patch]].","If you own a fork, extend VERSION_PATTERN to accept the new format; otherwise pin your MonetDB server to a version the plugin recognizes."],"exampleFix":"// before\nString ver = \"oct2020-1\"; // fails VERSION_PATTERN\nMonetDbVersion v = new MonetDbVersion(ver); // throws VersionFormatIsInvalid\n// after\nString raw = dbMeta.getDatabaseProductVersion();\nString ver = raw.replaceFirst(\"^[a-zA-Z]+\", \"\").replaceAll(\"[^0-9.].*$\", \"\"); // \"2020.1\"\nMonetDbVersion v = new MonetDbVersion(ver);","handlingStrategy":"validation","validationCode":"// Java: pre-check the version string against the expected format before construction\nstatic final java.util.regex.Pattern VERSION_PATTERN =\n    java.util.regex.Pattern.compile(\"\\\\d+(\\\\.\\\\d+(\\\\.\\\\d+)?)?\"); // mirror MonetDbVersion.VERSION_PATTERN\nstatic boolean isParseableVersion(String productVersion) {\n  return productVersion != null && VERSION_PATTERN.matcher(productVersion).matches();\n}","typeGuard":"// Java\nstatic boolean hasValidVersionFormat(String productVersion) {\n  return productVersion != null\n      && java.util.regex.Pattern.compile(\"\\\\d+(\\\\.\\\\d+(\\\\.\\\\d+)?)?\").matcher(productVersion).matches();\n}","tryCatchPattern":null,"preventionTips":["Normalize server version strings (strip 'v', build dates, beta suffixes) before parsing to major.minor.patch.","Keep the monet-db-bulk-loader plugin and MonetDB driver versions compatible with your server's release naming.","Write a unit test parsing your actual server's version string with MonetDbVersion before upgrading environments.","Check MonetDbVersion.VERSION_PATTERN whenever changing MonetDB server versions."],"tags":["monetdb","jdbc","version-check","version-format"],"backgroundTag":"invalid-argument-format","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"}