{"record":{"id":"14fe760b0a394177","repo":"pentaho/pentaho-kettle","slug":"monetdbversion-exception-versionisnull","errorCode":"MonetDBVersion.Exception.VersionIsNull","errorMessage":"MonetDBVersion.Exception.VersionIsNull","messagePattern":"MonetDBVersion\\.Exception\\.VersionIsNull","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":149,"sourceCode":"    if ( result != 0 ) {\n      return result;\n    }\n    return result;\n  }\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  }","sourceCodeStart":131,"sourceCodeEnd":167,"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#L131-L167","documentation":"MonetDbVersion.parseVersion() throws MonetDbVersionException with this message when the MonetDB server's product version string is null. The version is normally read from the server (e.g. via the 'SELECT @@version' / productVersion connection property) and must be non-null before pattern validation. A null means the driver/connection did not return any version string at all.","triggerScenarios":"Constructing MonetDbVersion (which calls parseVersion internally) with a null productVersion — typically because the MonetDB JDBC connection returned no version metadata property.","commonSituations":"Connecting through a proxy/non-MonetDB driver that omits the productVersion property; database metadata lookups failing silently before version negotiation (the loader checks the server version for feature gating); misconfigured JDBC URL pointing at a non-MonetDB service.","solutions":["Verify the JDBC URL targets a real MonetDB server and the connection is open before the loader reads its version (getDatabaseProductVersion).","Check driver configuration: use the supported MonetDB JDBC driver so connection metadata includes the product version.","Log/print DatabaseMetaData.getDatabaseProductVersion() on your connection to confirm what is actually returned; if null, fix connectivity/auth first.","If the error persists during the bulk-load step, test the same connection with a plain Table Output step to isolate the loader's version check."],"exampleFix":"// before\nString ver = dbMeta.getDatabaseProductVersion(); // may be null\nMonetDbVersion v = new MonetDbVersion(ver); // throws VersionIsNull\n// after\nString ver = dbMeta.getDatabaseProductVersion();\nif (ver == null) {\n  throw new MonetDbVersionException(\"MonetDB server did not report a product version\");\n}\nMonetDbVersion v = new MonetDbVersion(ver);","handlingStrategy":"try-catch","validationCode":"// Java: confirm the server reports a product version before building MonetDbVersion\njava.sql.DatabaseMetaData md = connection.getMetaData();\nString ver = md.getDatabaseProductVersion();\nif (ver == null || ver.trim().isEmpty()) {\n  throw new IllegalStateException(\"MonetDB connection returned no product version; check driver/URL\");\n}","typeGuard":"// Java\nstatic boolean hasVersion(String productVersion) {\n  return productVersion != null && !productVersion.trim().isEmpty();\n}","tryCatchPattern":null,"preventionTips":["Use the official MonetDB JDBC driver so getDatabaseProductVersion() is populated.","Confirm connectivity and authentication to the MonetDB server before the loader's version check runs.","Log connection metadata (product name/version) at startup to catch null versions early.","Test non-MonetDB URLs fail fast elsewhere so the loader never sees null metadata."],"tags":["monetdb","jdbc","version-check","null-version"],"backgroundTag":"null-argument","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"}