{"record":{"id":"86f2447cf5ea6f76","repo":"pentaho/pentaho-kettle","slug":"no-metadata-available-to-determine-connection-information","errorCode":null,"errorMessage":"No metadata available to determine connection information from.","messagePattern":"No metadata available to determine connection information from\\.","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/monet-db-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/monetdbbulkloader/MonetDBBulkLoader.java","lineNumber":618,"sourceCode":"    }\n    return false;\n  }\n\n  @Override\n  public void dispose( StepMetaInterface smi, StepDataInterface sdi ) {\n    meta = (MonetDBBulkLoaderMeta) smi;\n    data = (MonetDBBulkLoaderData) sdi;\n\n    super.dispose( smi, sdi );\n  }\n\n  protected MonetDBBulkLoaderData getData() {\n    return this.data;\n  }\n\n  protected MapiSocket getMonetDBConnection() throws Exception {\n    if ( this.meta == null ) {\n      throw new KettleException( \"No metadata available to determine connection information from.\" );\n    }\n    DatabaseMeta dm = meta.getDatabaseMeta();\n    String hostname = environmentSubstitute( Const.NVL( dm.getHostname(), \"\" ) );\n    String portnum = environmentSubstitute( Const.NVL( dm.getDatabasePortNumberString(), \"\" ) );\n    String user = environmentSubstitute( Const.NVL( dm.getUsername(), \"\" ) );\n    String password = Utils.resolvePassword( variables, Const.NVL( dm.getPassword(), \"\" ) );\n    String db = environmentSubstitute( Const.NVL( dm.getDatabaseName(), \"\" ) );\n\n    MapiSocket mserver = getMonetDBConnection( hostname, Integer.valueOf( portnum ), user, password, db, log );\n    return mserver;\n\n  }\n\n  protected static MapiSocket getMonetDBConnection( String host, int port,\n      String user, String password, String db ) throws Exception {\n    return getMonetDBConnection( host, port, user, password, db, null );\n  }\n","sourceCodeStart":600,"sourceCodeEnd":636,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/monet-db-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/monetdbbulkloader/MonetDBBulkLoader.java#L600-L636","documentation":"getMonetDBConnection() refuses to build a MapiSocket when the step's meta (MonetDBBulkLoaderMeta) is null, since connection host/port/user/password can only be derived from that metadata. The message 'No metadata available to determine connection information from.' signals a lifecycle bug: the step is being used before init()/setMeta ran.","triggerScenarios":"getMonetDBConnection() is invoked (directly or via mserver-related paths) while this.meta is null - typically the step was never initialized through init(smi, sdi) or the meta was never assigned on the instance being used.","commonSituations":"Programmatic/ unit-test usage of MonetDBBulkLoader that skips init(); calling connection helpers on a fresh instance without loading step metadata from XML/repository.","solutions":["Ensure the step is initialized: call init(StepMetaInterface, StepDataInterface) with a fully loaded MonetDBBulkLoaderMeta before using connection methods","When testing, construct and assign meta explicitly instead of using a bare instance","Check for code paths that create a second MonetDBBulkLoader instance bypassing the normal Kettle lifecycle"],"exampleFix":"// before\nMonetDBBulkLoader loader = new MonetDBBulkLoader();\nloader.getMonetDBConnection(); // meta is null\n// after\nloader.init( meta, new MonetDBBulkLoaderData() );\nloader.getMonetDBConnection();","handlingStrategy":"validation","validationCode":"// ensure initialization before any connection use\nif ( loaderNotInitialized( loader ) ) { loader.init( meta, new MonetDBBulkLoaderData() ); }","typeGuard":"boolean usable( MonetDBBulkLoader l ) { return l != null && l.getData() != null && l.meta != null; }","tryCatchPattern":"try { socket = getMonetDBConnection(); } catch ( Exception e ) { if ( e.getMessage().contains( \"No metadata available\" ) ) { initialize step and retry once; } else rethrow; }","preventionTips":["Always go through the Kettle lifecycle (init before use)","Never call helper methods on hand-constructed step instances without setting meta","In tests, build meta explicitly before invoking connection code","Add an assert in custom code that meta != null before connection use"],"tags":["lifecycle","initialization","monetdb","null"],"backgroundTag":"internal-invariant-violation","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"}